/* =====================================================
   LOGIN — Athletic editorial over a Three.js particle terrain
   ===================================================== */

body {
    background: #050505;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ---------- WebGL backdrop ---------- */

.hero-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* CSS fallback if WebGL is unavailable */
    background: radial-gradient(120% 90% at 50% 110%, rgba(0, 230, 176, 0.10) 0%, transparent 60%);
}

.hero-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(5,5,5,0.85) 0%, rgba(5,5,5,0.25) 30%, rgba(5,5,5,0.15) 55%, rgba(5,5,5,0.92) 100%);
}

/* ---------- Layout shell ---------- */

.login-shell {
    position: relative;
    z-index: 2;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 24px 22px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* ---------- Masthead ---------- */

.login-masthead {
    padding-top: 8px;
}

.masthead-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: clamp(28px, 9vh, 72px);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: heroRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-mark svg { width: 30px; height: 30px; }

.tagline {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.22em;
}

.login-lang-wrapper { position: relative; }

.wordmark {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(64px, 19vw, 104px);
    line-height: 0.88;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    color: var(--text-primary);
    margin: 0 0 14px -2px;
    animation: heroRise 0.8s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wordmark::after {
    content: '.';
    color: var(--accent);
}

.subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: heroRise 0.8s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.subtitle::before {
    content: '';
    display: inline-block;
    width: 26px;
    height: 1px;
    background: var(--accent);
    flex-shrink: 0;
}

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

/* ---------- Form card ---------- */

.login-card {
    margin-top: auto;
    background: rgba(9, 9, 9, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius-xl);
    padding: 24px 22px;
    animation: heroRise 0.8s 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Google button */
.btn-google {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color 150ms, transform 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 48px;
}

.btn-google:hover { border-color: #3a3a3a; }
.btn-google:active { transform: scale(0.97); }
.btn-google:disabled { opacity: 0.5; cursor: not-allowed; }

.google-icon { width: 18px; height: 18px; }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
    gap: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hairline);
}

.divider span {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

/* Form */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 500;
    margin-bottom: 7px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: border-color 150ms, box-shadow 150ms;
    font-family: var(--font-sans);
    background: #0A0A0A;
    color: var(--text-primary);
    min-height: 48px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(0, 230, 176, 0.12);
}

.form-group input::placeholder { color: #4A4A46; }

/* Primary button */
.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: transform 150ms, box-shadow 150ms;
    min-height: 50px;
    box-shadow: 0 6px 28px rgba(0, 230, 176, 0.22);
}

.btn-login:hover { box-shadow: 0 8px 36px rgba(0, 230, 176, 0.32); }
.btn-login:active { transform: scale(0.97); }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

/* Messages */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
    display: none;
}

.message.error {
    background: rgba(255, 68, 68, 0.08);
    color: #FF6B6B;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.message.success {
    background: rgba(0, 230, 176, 0.08);
    color: var(--accent);
    border: 1px solid rgba(0, 230, 176, 0.2);
}

.message.show {
    display: block;
    animation: heroRise 200ms ease;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: -2px;
}

/* Toggle mode */
.toggle-mode {
    text-align: center;
    margin-top: 18px;
}

.toggle-mode a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.toggle-mode a:hover { text-decoration: underline; }

/* ---------- Footer strip ---------- */

.login-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    animation: heroRise 0.8s 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-meta-rule {
    flex: 1;
    height: 1px;
    background: var(--hairline);
}

/* ---------- Desktop: split-screen editorial ---------- */

@media (min-width: 960px) {
    .login-shell {
        max-width: 1080px;
        flex-direction: row;
        align-items: center;
        gap: 80px;
        padding: 48px 40px;
    }

    .login-masthead {
        flex: 1.2;
        padding-top: 0;
    }

    .masthead-row { margin-bottom: 48px; }

    .wordmark { font-size: clamp(96px, 11vw, 148px); }

    .login-card {
        flex: 1;
        max-width: 400px;
        margin-top: 0;
        padding: 32px 28px;
    }

    .login-meta {
        position: fixed;
        left: 40px;
        bottom: 28px;
        width: 200px;
        margin-top: 0;
    }
}
