/* =============================================================
   登录/注册页样式 v7.2 — 紫色梦幻风（与首页 app.css 风格统一）
   主色：紫色渐变 #667eea → #764ba2
   辅色：粉色 #f093fb、橙色 #fa709a
   设计语言：玻璃拟态 / 紫粉光斑背景 / 浮动光斑
   输入框：白底深字（#1e293b），符合首页"小程序"观感
   ============================================================= */

.login-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    color: #1e293b;
    font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 50% at 30% 20%, rgba(102, 126, 234, 0.30) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 70% 80%, rgba(240, 147, 251, 0.25) 0%, transparent 60%),
        linear-gradient(180deg, #f5f7fb 0%, #fafbff 50%, #f0e9f8 100%);
    overflow: hidden;
}

.login-bg .blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.login-bg .b1 {
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, #818cf8, #667eea);
}

.login-bg .b2 {
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, #f093fb, #764ba2);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, -50px) scale(1.1); }
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    box-shadow:
        0 20px 50px rgba(102, 126, 234, 0.15),
        0 4px 12px rgba(15, 23, 42, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.login-header .subtitle {
    color: #64748b;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* v7.2.7+ 返回首页按钮（卡片左上角外侧，绝对定位） */
.login-back-home {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.15s ease;
    z-index: 10;
}
.login-back-home:hover {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(255, 255, 255, 0.9);
}

.tab-switch {
    display: flex;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 2rem;
    border: 1px solid rgba(102, 126, 234, 0.10);
}

.tab-switch .tab {
    flex: 1;
    padding: 0.6rem;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-switch .tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.30);
}

.login-form label {
    display: block;
    color: #475569;
    font-size: 0.85rem;
    margin: 1rem 0 0.5rem;
    font-weight: 500;
}

/* 关键：白底 + 深字（与首页 form-control 风格一致） */
.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    background-image: none;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 500;
    caret-color: #667eea;
    transition: all 0.2s;
    box-sizing: border-box;
    -webkit-text-fill-color: #1e293b;
    opacity: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-input:hover {
    border-color: #c7d2fe;
    background: #ffffff;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow:
        0 0 0 4px rgba(102, 126, 234, 0.12),
        0 2px 8px rgba(102, 126, 234, 0.08);
}

/* 浏览器 autofill 也要白底深字 */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-text-fill-color: #1e293b !important;
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    box-shadow: 0 0 0 1000px white inset !important;
    background-color: white !important;
    caret-color: #667eea;
    transition: background-color 5000s ease-in-out 0s;
}

.password-wrap {
    position: relative;
}

.pwd-toggle {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.pwd-toggle:hover {
    opacity: 1;
}

.agree-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
    margin: 1.5rem 0 0;
    cursor: pointer;
}

.agree-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.agree-row a {
    color: #667eea;
    text-decoration: none;
}

.agree-row a:hover {
    text-decoration: underline;
}

.btn-primary-lg {
    width: 100%;
    padding: 0.9rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 100%;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-sizing: border-box;
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.30);
    letter-spacing: 0.05em;
}

.btn-primary-lg:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.40);
}

.btn-primary-lg:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary-lg:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline-lg {
    width: 100%;
    padding: 0.85rem;
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.btn-outline-lg:hover {
    background: rgba(102, 126, 234, 0.06);
    border-color: #c7d2fe;
    color: #667eea;
}

.divider {
    text-align: center;
    color: #94a3b8;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    position: relative;
}

/* 错误提示：暖橘色（与首页 alert-warning 调子一致） */
.error-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.30);
    border-radius: 12px;
    color: #b45309;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fade-in 0.3s ease;
}

.error-msg .err-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.20);
    border-radius: 50%;
    font-size: 0.85rem;
    color: #b45309;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.3s;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .login-header .logo {
        font-size: 1.3rem;
    }
}

/* =====================================================
 * 用户协议弹窗（v7.2.7+）
 * 居中卡片，遮罩半透明，移动端适配
 * ===================================================== */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: modal-fade-in 0.2s ease-out;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background: linear-gradient(180deg, #1e1b3a 0%, #2a2750 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-pop-in 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modal-pop-in {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.05rem;
    font-weight: 600;
    color: #f3f4f6;
    flex: 0 0 auto;
}

.modal-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f3f4f6;
}

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.25rem;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.modal-body h4 {
    margin: 1rem 0 0.5rem 0;
    color: #f3f4f6;
    font-size: 0.95rem;
    font-weight: 600;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body p {
    margin: 0 0 0.5rem 0;
}

.modal-body b {
    color: #fbbf24;
    font-weight: 600;
}

.modal-body code {
    font-family: 'Courier New', Consolas, monospace;
    background: rgba(251, 191, 36, 0.1);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    color: #fbbf24;
    font-size: 0.85em;
}

.modal-footer-tip {
    margin-top: 1rem !important;
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    color: #c7d2fe;
    text-align: center;
    font-size: 0.8rem;
}

.modal-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
}

.modal-actions .btn-primary-lg {
    width: 100%;
    margin: 0;
}

@media (max-width: 480px) {
    .modal-mask {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .modal-box {
        max-height: 90vh;
        border-radius: 14px 14px 0 0;
        animation: modal-slide-up 0.25s ease-out;
    }

    @keyframes modal-slide-up {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-header,
    .modal-body,
    .modal-actions {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
