/* Genius · Login — Editorial Language Studio
   genius-theme.css must be linked BEFORE this file (no @import for theme vars).
   Robust by design: a single centered card, no min-height traps, no JS required. */

/* ─────────────────────────────  Tokens (scoped to login pages)  ───────────────────────────── */
body.login-page {
    --ink: #0b1c3a;
    --ink-2: #16336e;
    --ink-3: #1f4ea3;
    --cobalt: #2563eb;
    --sky: #3b82f6;
    --gold: #f3b53f;
    --gold-soft: #fcd980;
    --paper: #eef3fc;
    --paper-2: #f7faff;
    --surface: #ffffff;
    --line: #e6ecf6;
    --line-strong: #d4ddec;
    --text: #0f1c33;
    --text-2: #475069;
    --muted: #7b859a;
    --serif: 'Fraunces', Georgia, 'Noto Serif SC', 'Songti SC', serif;
    --sans: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    --r-card: 28px;
    --r-input: 14px;
    --shadow-card: 0 40px 90px -30px rgba(11, 28, 58, 0.45), 0 12px 30px -18px rgba(11, 28, 58, 0.25);
}

body.login-page,
body.login-page *,
body.login-page *::before,
body.login-page *::after {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(1100px 700px at 88% -10%, rgba(37, 99, 235, 0.10), transparent 60%),
        radial-gradient(900px 600px at -5% 110%, rgba(243, 181, 63, 0.10), transparent 60%),
        linear-gradient(160deg, var(--paper-2) 0%, var(--paper) 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ─────────────────────────────  Ambient background  ───────────────────────────── */
.bg-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: orb-drift 18s ease-in-out infinite;
}
.bg-orb--1 { width: 46vw; height: 46vw; top: -14%; right: -8%; background: radial-gradient(circle, rgba(59, 130, 246, 0.30), transparent 70%); }
.bg-orb--2 { width: 38vw; height: 38vw; bottom: -16%; left: -10%; background: radial-gradient(circle, rgba(243, 181, 63, 0.26), transparent 70%); animation-delay: -6s; }
.bg-orb--3 { width: 26vw; height: 26vw; top: 42%; left: 48%; background: radial-gradient(circle, rgba(99, 102, 241, 0.16), transparent 70%); animation-delay: -11s; }

@keyframes orb-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(2.5%, -2%) scale(1.06); }
}

/* ─────────────────────────────  Shell + card  ───────────────────────────── */
.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 56px);
}

.auth-card {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1.04fr 0.96fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(22px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

/* ─────────────────────────────  Hero (left)  ───────────────────────────── */
.auth-hero {
    position: relative;
    padding: clamp(34px, 4vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 30px;
    min-height: 540px;
    color: #eaf1ff;
    background:
        radial-gradient(680px 380px at 78% 8%, rgba(37, 99, 235, 0.55), transparent 60%),
        radial-gradient(540px 420px at 12% 96%, rgba(243, 181, 63, 0.18), transparent 60%),
        linear-gradient(155deg, var(--ink) 0%, var(--ink-2) 58%, var(--ink-3) 130%);
    overflow: hidden;
}
.auth-hero__grain {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1.4px);
    background-size: 22px 22px;
    opacity: 0.5;
    mask-image: radial-gradient(120% 100% at 70% 20%, #000 35%, transparent 78%);
    -webkit-mask-image: radial-gradient(120% 100% at 70% 20%, #000 35%, transparent 78%);
    pointer-events: none;
}
.auth-hero__mark {
    position: absolute;
    right: -0.12em;
    bottom: -0.36em;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(13rem, 22vw, 20rem);
    line-height: 1;
    color: rgba(243, 181, 63, 0.14);
    pointer-events: none;
    user-select: none;
}

.auth-hero__top,
.auth-hero__body,
.auth-hero__foot { position: relative; z-index: 1; }

.hero-eyebrow {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--gold-soft);
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 16px;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(2.2rem, 3.4vw, 3.1rem);
    line-height: 1.06;
    letter-spacing: -0.015em;
    color: #fff;
}
.hero-title em {
    font-style: italic;
    color: var(--gold);
}
.hero-sub {
    margin: 0 0 26px;
    max-width: 30ch;
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(225, 233, 250, 0.82);
}

.hero-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hero-skill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(233, 240, 255, 0.92);
    backdrop-filter: blur(4px);
}
.hero-skill b {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-hero__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: rgba(206, 219, 245, 0.7);
}
.hero-foot-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(243, 181, 63, 0.2);
    flex-shrink: 0;
}

/* ─────────────────────────────  Form (right)  ───────────────────────────── */
.auth-form {
    position: relative;
    padding: clamp(34px, 3.4vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
}

.lang-btn {
    position: absolute;
    top: 22px;
    right: 22px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--paper-2);
    color: var(--cobalt);
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.25s ease;
}
.lang-btn:hover {
    border-color: var(--cobalt);
    background: #eaf1ff;
}

.auth-form__head { margin-bottom: 26px; }
.auth-logo {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 18px;
    border-radius: 18px;
    padding: 4px;
    background: linear-gradient(140deg, var(--cobalt), var(--ink-3) 60%, var(--gold));
    box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.55);
}
.auth-logo img {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    border: 2px solid #fff;
}
.form-title {
    margin: 0 0 6px;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.9rem;
    letter-spacing: -0.01em;
    color: var(--text);
}
.form-sub {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

/* Alerts */
.alert {
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 500;
}
.alert-error { background: #fff1f1; border: 1px solid #ffd0d0; color: #d32f2f; }
.alert-success { background: #effaf3; border: 1px solid #b9ebcc; color: #14894a; }

/* Form (shared with change_password) */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.field { display: flex; flex-direction: column; }
.field label {
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-2);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    width: 19px;
    height: 19px;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
}

.field input {
    width: 100%;
    padding: 13px 15px;
    border-radius: var(--r-input);
    border: 1px solid var(--line-strong);
    background: var(--paper-2);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
/* 图标绝对定位在 left:14px、宽 19px，须预留 ≥42px 左内边距；规则须在 .field input 之后以免被 padding 简写覆盖 */
.field .input-wrap input {
    padding-left: 42px;
}
.field .input-wrap:has(.pw-toggle) input {
    padding-right: 44px;
}
.field input::placeholder { color: #aab2c2; }
.field input:focus {
    outline: none;
    background: #fff;
    border-color: var(--cobalt);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}
.input-wrap:focus-within .input-icon { color: var(--cobalt); }

.pw-toggle {
    position: absolute;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.pw-toggle:hover { color: var(--cobalt); background: #eef3fc; }
.pw-toggle .pw-eye { width: 19px; height: 19px; }
.pw-toggle.is-on { color: var(--cobalt); }

/* Submit (shared with change_password) */
.login-submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    border: none;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(120deg, var(--cobalt), var(--ink-3));
    cursor: pointer;
    box-shadow: 0 14px 28px -12px rgba(37, 99, 235, 0.7);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.login-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.28) 50%, transparent 62%);
    background-size: 220% 100%;
    animation: btn-shimmer 4.5s ease-in-out infinite;
    pointer-events: none;
}
.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px -12px rgba(37, 99, 235, 0.75);
}
.login-submit:active { transform: translateY(0) scale(0.99); }

@keyframes btn-shimmer {
    0% { background-position: 200% center; }
    60%, 100% { background-position: -120% center; }
}

.login-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--muted);
}
.login-footer p { margin: 0; }

/* Staggered entrance for form contents */
.auth-form__head,
.auth-form .alert,
.login-form .field,
.login-form .login-submit,
.login-footer {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-form__head { animation-delay: 0.12s; }
.auth-form .alert { animation-delay: 0.16s; }
.login-form .field:nth-child(2) { animation-delay: 0.2s; }
.login-form .field:nth-child(3) { animation-delay: 0.27s; }
.login-form .login-submit { animation-delay: 0.34s; }
.login-footer { animation-delay: 0.4s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ─────────────────────────────  Legacy classes (change_password.php)  ───────────────────────────── */
.genius-login-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 48px);
}
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.login-glass {
    width: 100%;
    max-width: 440px;
    padding: 40px 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    text-align: center;
    animation: card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-glass .login-form { text-align: left; margin-top: 8px; }
.login-glass h2 {
    margin: 0 0 6px;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.7rem;
    color: var(--text);
}
.login-glass .subtitle {
    margin: 0 0 22px;
    font-size: 0.9rem;
    color: var(--muted);
}
.login-logo-ring {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 22px;
    padding: 4px;
    background: linear-gradient(140deg, var(--cobalt), var(--ink-3) 60%, var(--gold));
    box-shadow: 0 12px 26px -10px rgba(37, 99, 235, 0.55);
}
.login-logo-ring img {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
    background: #fff;
    border: 2px solid #fff;
}
.login-glass-compact { max-width: 440px; }

/* ─────────────────────────────  Responsive  ───────────────────────────── */
@media (max-width: 860px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 460px;
    }
    .auth-hero {
        min-height: auto;
        padding: 34px 30px;
        gap: 22px;
    }
    .auth-hero__mark { font-size: 11rem; bottom: -0.3em; }
    .hero-sub { margin-bottom: 20px; }
    .auth-form { padding: 34px 30px; }
}

@media (max-width: 420px) {
    .auth-hero { padding: 28px 22px; }
    .auth-form { padding: 28px 22px; }
    .hero-skills { gap: 8px; }
    .auth-card { border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .bg-orb,
    .login-submit::after { animation: none; }
    .auth-card,
    .login-glass,
    .auth-form__head,
    .auth-form .alert,
    .login-form .field,
    .login-form .login-submit,
    .login-footer { animation: none; }
}
