/**
 * 梦航 - 登录/注册 统一现代化样式
 * 设计：深色品牌区 + 浅色表单区，专业简洁
 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --auth-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --auth-bg-dark: #0f172a;
    --auth-bg-dark-end: #1e293b;
    --auth-accent: #2563eb;
    --auth-accent-hover: #1d4ed8;
    --auth-accent-light: rgba(37, 99, 235, 0.08);
    --auth-surface: #ffffff;
    --auth-surface-2: #f8fafc;
    --auth-border: #e2e8f0;
    --auth-text: #0f172a;
    --auth-text-muted: #64748b;
    --auth-text-muted-2: #94a3b8;
    --auth-radius: 12px;
    --auth-radius-lg: 16px;
    --auth-shadow: 0 1px 3px rgba(0,0,0,.06);
    --auth-shadow-lg: 0 25px 50px -12px rgba(0,0,0,.12);
    --auth-transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body.auth-page {
    font-family: var(--auth-font);
    background: var(--auth-surface-2);
    min-height: 100%;
    height: 100%;
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ========== 主布局 ========== */
.auth-wrapper {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ========== 左侧品牌区 ========== */
.auth-brand {
    flex: 0 0 50%;
    min-width: 360px;
    max-width: 560px;
    background: linear-gradient(165deg, var(--auth-bg-dark) 0%, var(--auth-bg-dark-end) 50%, #334155 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.15), transparent),
                     radial-gradient(ellipse 60% 40% at 100% 100%, rgba(37, 99, 235, 0.08), transparent);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-logo {
    width: 56px;
    height: 56px;
    background: var(--auth-surface);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.2);
    color: var(--auth-accent);
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-surface);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.auth-brand-tagline {
    font-size: 0.9375rem;
    color: rgba(255,255,255,.72);
    line-height: 1.55;
    margin-bottom: 2rem;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.95);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,.12);
    margin-bottom: 2.5rem;
}

.auth-badge svg {
    width: 14px;
    height: 14px;
    opacity: .9;
}

.auth-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.auth-feature {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--auth-radius);
    padding: 1rem;
    transition: var(--auth-transition);
}

.auth-feature:hover {
    background: rgba(255,255,255,.09);
}

.auth-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.auth-feature-icon svg {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,.9);
}

.auth-feature h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-surface);
    margin-bottom: 0.15rem;
}

.auth-feature p {
    font-size: 0.75rem;
    color: rgba(255,255,255,.6);
    line-height: 1.35;
}

/* ========== 右侧表单区 ========== */
.auth-form-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: var(--auth-surface-2);
    overflow-y: auto;
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
    min-width: 0;
    background: var(--auth-surface);
    border-radius: var(--auth-radius-lg);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--auth-border);
}

.auth-form-header {
    margin-bottom: 1.75rem;
}

.auth-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-text);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.auth-form-subtitle {
    font-size: 0.9375rem;
    color: var(--auth-text-muted);
}

/* ========== 表单控件 ========== */
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form .form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

.auth-input-wrap {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    font-size: 0.9375rem;
    font-family: var(--auth-font);
    background: var(--auth-surface);
    color: var(--auth-text);
    transition: var(--auth-transition);
}

.auth-input::placeholder {
    color: var(--auth-text-muted-2);
}

.auth-input:hover {
    border-color: #cbd5e1;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-light);
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted-2);
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: color var(--auth-transition);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--auth-accent);
}

.auth-pwd-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--auth-text-muted-2);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--auth-transition);
}

.auth-pwd-toggle:hover {
    color: var(--auth-accent);
    background: var(--auth-accent-light);
}

.auth-pwd-toggle svg {
    width: 18px;
    height: 18px;
}

.auth-hint {
    font-size: 0.75rem;
    color: var(--auth-text-muted-2);
    margin-top: 0.4rem;
}

/* ========== 选项行 ========== */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--auth-text-muted);
    cursor: pointer;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

.auth-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-accent);
    text-decoration: none;
    transition: var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-accent-hover);
}

/* ========== 主按钮 ========== */
.auth-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--auth-accent);
    color: white;
    border: none;
    border-radius: var(--auth-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--auth-font);
    cursor: pointer;
    transition: var(--auth-transition);
    margin-bottom: 1.25rem;
}

.auth-btn:hover:not(:disabled) {
    background: var(--auth-accent-hover);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}

.auth-btn:active:not(:disabled) {
    transform: scale(0.99);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ========== 切换链接区 ========== */
.auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--auth-text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--auth-border);
}

.auth-switch a {
    font-weight: 600;
    color: var(--auth-accent);
    text-decoration: none;
    margin-left: 0.25rem;
}

.auth-switch a:hover {
    color: var(--auth-accent-hover);
}

/* ========== 消息提示 ========== */
.auth-message {
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: none;
}

.auth-message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-message.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.auth-error-inline {
    font-size: 0.8125rem;
    color: #b91c1c;
    margin-top: 0.35rem;
    display: none;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .auth-brand {
        flex: 0 0 44%;
        min-width: 300px;
        max-width: none;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .auth-wrapper {
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-brand {
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 280px;
        padding: 2rem 1.5rem;
        justify-content: flex-start;
        padding-top: 2.5rem;
    }

    .auth-brand-inner {
        max-width: 100%;
    }

    .auth-brand h1 {
        font-size: 1.5rem;
    }

    .auth-brand-tagline {
        margin-bottom: 1.25rem;
    }

    .auth-badge {
        margin-bottom: 1.5rem;
    }

    .auth-features {
        gap: 0.5rem;
    }

    .auth-feature {
        padding: 0.75rem;
    }

    .auth-form-section {
        flex: 1;
        min-height: 0;
        padding: 2rem 1.25rem;
        justify-content: flex-start;
        padding-top: 2rem;
    }

    .auth-form-card {
        padding: 1.75rem;
        margin: 0;
    }

    .auth-form-title {
        font-size: 1.35rem;
    }
}

@media (max-width: 480px) {
    .auth-brand {
        min-height: 240px;
        padding: 1.5rem 1rem;
    }

    .auth-form-section {
        padding: 1.5rem 1rem;
    }

    .auth-form-card {
        padding: 1.25rem;
        border-radius: 14px;
    }

    .auth-input {
        font-size: 16px; /* 防止 iOS 缩放 */
    }
}
