/*
 * 现代化登录页面样式
 * 基于Material Design和现代扁平化设计理念
 */

/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== 背景动画 ===== */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ===== 浮动装饰元素 ===== */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float-shapes 15s infinite linear;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 80%;
    animation-delay: 5s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 40%;
    left: 70%;
    animation-delay: 10s;
}

@keyframes float-shapes {
    0% { transform: translateY(0px) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ===== 背景容器 ===== */
#login-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.bg-img, .bg-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bg-color {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===== 登录容器 ===== */
.container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 120px 20px;
}

.login {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.8s ease-out;
    width: 100%;
    max-width: 520px;
    min-width: 480px;
    position: relative;
    overflow: hidden;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 登录头部样式 ===== */
.login-header {
    text-align: center;
    margin-bottom: 45px;
    position: relative;
}

.login-icon-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.login-icon-bg {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    animation: pulse 2s infinite;
}

.login-icon {
    color: white;
    font-size: 32px;
}

.icon-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    opacity: 0.3;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes glow {
    from { transform: scale(1); opacity: 0.3; }
    to { transform: scale(1.1); opacity: 0.1; }
}

.login-header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.login-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    font-weight: 400;
    margin: 0;
}

/* ===== 表单样式 ===== */
.form-group {
    margin-bottom: 28px;
    position: relative;
}

.form-control {
    width: 100%;
    padding: 18px 24px;
    border: 2px solid #e1e8ed;
    border-radius: 14px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    outline: none;
    min-height: 56px;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    background: white;
}

.form-control::placeholder {
    color: #95a5a6;
    font-weight: 400;
}

/* ===== 输入框图标 ===== */
.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 18px;
    transition: all 0.3s ease;
}

.form-control:focus + .input-icon {
    color: #667eea;
}

/* ===== 输入框图标和焦点效果 ===== */
.input-with-icon {
    position: relative;
}

.input-with-icon.focused .form-control {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-with-icon.has-value .form-control {
    background: white;
}

/* ===== 登录按钮 ===== */
.login-actions {
    margin-top: 30px;
}

#submit_btn, .btn-primary {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
}

#submit_btn::before, .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

#submit_btn:hover::before, .btn-primary:hover::before {
    left: 100%;
}

#submit_btn:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

#submit_btn:active, .btn-primary:active {
    transform: translateY(0);
}

/* ===== 按钮波纹效果 ===== */
.button-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== 加载状态 ===== */
#submit_btn.loading, .btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

#submit_btn.loading::after, .btn-primary.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== 验证码区域 ===== */
#smsCodeDD {
    animation: fadeInDown 0.5s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#smsCodeDD {
    display: flex;
    gap: 10px;
    align-items: center;
}

#smsCode {
    flex: 1;
}

.sendsms, #reSend {
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sendsms:hover, #reSend:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ===== 错误提示 ===== */
.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: none;
    animation: shake 0.5s ease-in-out;
}

.error-message.show {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== 安全提示 ===== */
.security-notice {
    position: fixed !important;
    bottom: 60px !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    padding: 16px 28px !important;
    border-radius: 35px !important;
    color: #2c3e50 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12), 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    z-index: 9999 !important;
    animation: slideInUp 1s ease-out 1s both;
    max-width: 90% !important;
    min-width: 200px !important;
    white-space: nowrap !important;
    text-align: center !important;
    margin: 0 !important;
    width: auto !important;
}

.security-notice i {
    color: #27ae60;
}

/* ===== 动画效果 ===== */
.login.loaded {
    animation: none;
}

.form-group.slide-in {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .login {
        padding: 40px 30px;
        margin: 20px;
        min-width: auto;
        max-width: 90%;
    }

    .security-notice {
        bottom: 45px !important;
        max-width: 85% !important;
        padding: 14px 22px !important;
        font-size: 13px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

@media (max-width: 480px) {
    .login {
        padding: 30px 20px;
        margin: 15px;
        min-width: auto;
        max-width: 95%;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .form-control {
        padding: 15px 18px;
        font-size: 15px;
        min-height: 50px;
    }

    #submit_btn, .btn-primary {
        padding: 15px 20px;
        font-size: 15px;
        min-height: 50px;
    }

    .security-notice {
        bottom: 40px !important;
        font-size: 12px !important;
        padding: 12px 18px !important;
        border-radius: 25px !important;
        gap: 8px !important;
        max-width: 95% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        text-align: center !important;
        right: auto !important;
    }
}

/* ===== 暗色主题支持 ===== */
@media (prefers-color-scheme: dark) {
    .login {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
    }

    .login-header h1 {
        color: #ecf0f1;
    }

    .login-subtitle {
        color: #bdc3c7;
    }

    .form-control {
        background: rgba(52, 73, 94, 0.8);
        border-color: #34495e;
        color: #ecf0f1;
    }

    .form-control::placeholder {
        color: #7f8c8d;
    }

    .sendsms, #reSend {
        background: rgba(52, 73, 94, 0.8);
        border-color: #34495e;
        color: #ecf0f1;
    }

    .security-notice {
        background: rgba(44, 62, 80, 0.9);
        color: #ecf0f1;
    }
}

/* ===== 强制居中安全提示 - 最高优先级 ===== */
body .security-notice,
html .security-notice,
div.security-notice {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    right: auto !important;
    top: auto !important;
}

/* 确保在所有屏幕尺寸下都居中 */
@media screen {
    .security-notice {
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
        right: auto !important;
    }
}
