/* ============================================================
   LOGIN PAGE — Creative Standalone Design
   Swiss grid reveal → typewriter tagline → form slide-in
   ============================================================ */

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

:root {
    --c-bg:     #0A0A0A;
    --c-surface:#111111;
    --c-border: #1E1E1E;
    --c-head:   #EEEEEE;
    --c-body:   #CCCCCC;
    --c-muted:  #555555;
    --c-accent: #820000;
    --c-hover:  #360000;
    --font-h:   'Space Grotesk', sans-serif;
    --font-b:   'Inter', sans-serif;
    --font-m:   'IBM Plex Mono', monospace;
}

html, body { height: 100%; }

.login-page-body {
    background: var(--c-bg);
    color: var(--c-body);
    font-family: var(--font-b);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Scene ──────────────────────────────────────────────────── */
.login-scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
}

/* ── Grid lines (Phase 1: 0→1s) ─────────────────────────────── */
.login-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.lg {
    position: absolute;
    background: #1A1A1A;
    transform-origin: center;
}

.lg--1, .lg--2 { /* Horizontal */
    left: 0; right: 0;
    height: 1px;
    transform: scaleX(0);
    animation: drawH 0.6s ease forwards;
}
.lg--3, .lg--4 { /* Vertical */
    top: 0; bottom: 0;
    width: 1px;
    transform: scaleY(0);
    animation: drawV 0.6s ease forwards;
}

.lg--1 { top: 30%; animation-delay: 0.1s; }
.lg--2 { top: 70%; animation-delay: 0.25s; }
.lg--3 { left: 33%; animation-delay: 0.15s; }
.lg--4 { left: 66%; animation-delay: 0.3s; }

@keyframes drawH { to { transform: scaleX(1); } }
@keyframes drawV { to { transform: scaleY(1); } }

/* ── Tagline (Phase 2: 0.8s→2.5s) ───────────────────────────── */
.login-tagline {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
    pointer-events: none;
}

.lt {
    display: block;
    font-family: var(--font-h);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--c-head);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUpIn 0.5s ease forwards;
}

.lt--1 { animation-delay: 0.5s; }
.lt--2 { animation-delay: 0.9s; }
.lt--3 { animation-delay: 1.3s; font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 400; color: var(--c-muted); }
.lt--4 { animation-delay: 1.6s; font-size: clamp(1rem, 2vw, 1.5rem); font-weight: 500; color: var(--c-accent); }
.lt--accent { color: var(--c-accent); }

@keyframes fadeUpIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Tagline fades out to reveal form */
.login-tagline {
    animation: fadeOut 0.5s ease forwards 3s;
}
@keyframes fadeOut { to { opacity: 0; pointer-events: none; } }

/* ── Form Wrapper (Phase 3: 3s+) ─────────────────────────────── */
.login-form-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-top: 3px solid var(--c-accent);
    padding: 2.5rem;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(30px);
    animation: formReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards 3.1s;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

@keyframes formReveal {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Login Brand ─────────────────────────────────────────────── */
.login-brand {
    margin-bottom: 1.5rem;
}
.login-brand-name {
    font-family: var(--font-h);
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-head);
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: color 150ms;
}
.login-brand-name:hover { color: var(--c-accent); }
.login-brand-sep {
    display: block;
    height: 1px;
    background: var(--c-border);
    margin-top: 0.75rem;
}

/* ── Login Heading ───────────────────────────────────────────── */
.login-heading {
    font-family: var(--font-h);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--c-head);
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.login-rights-note {
    font-size: 0.7rem;
    font-family: var(--font-m);
    color: var(--c-muted);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.75rem;
    text-transform: uppercase;
}
.login-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c-accent);
    flex-shrink: 0;
    animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}

/* ── Form Fields ─────────────────────────────────────────────── */
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

.lf-field { display: flex; flex-direction: column; gap: 6px; }
.lf-field label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.lf-field input[type="text"],
.lf-field input[type="password"] {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    color: var(--c-head);
    padding: 12px 14px;
    font-family: var(--font-b);
    font-size: 0.9375rem;
    border-radius: 2px;
    width: 100%;
    transition: border-color 150ms;
}
.lf-field input:focus {
    outline: none;
    border-color: var(--c-accent);
}
.lf-field input::placeholder { color: #444; }

.lf-password-wrap { position: relative; }
.lf-password-wrap input { padding-right: 44px; }
.lf-toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--c-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 150ms;
}
.lf-toggle-pass:hover { color: var(--c-head); }

.lf-row--remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.lf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    color: var(--c-muted);
    cursor: pointer;
}
.lf-checkbox-label input[type="checkbox"] { accent-color: var(--c-accent); }
.lf-forgot {
    font-size: 0.8125rem;
    color: var(--c-muted);
    text-decoration: none;
    transition: color 150ms;
}
.lf-forgot:hover { color: var(--c-accent); }

/* Error */
.lf-error {
    font-size: 0.8125rem;
    color: #ff9999;
    background: rgba(130, 0, 0, 0.12);
    border: 1px solid rgba(130, 0, 0, 0.3);
    padding: 10px 14px;
    border-radius: 2px;
    display: none;
}
.lf-error.is-visible { display: block; }

/* Submit button */
.lf-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--c-accent);
    color: #fff;
    border: 1px solid var(--c-accent);
    border-radius: 2px;
    padding: 13px 24px;
    font-family: var(--font-b);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    transition: background 200ms, transform 150ms;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}
.lf-submit:hover { background: var(--c-hover); border-color: var(--c-hover); transform: translateY(-1px); }
.lf-submit:active { transform: none; }
.lf-submit.is-loading .lf-submit-text { opacity: 0.5; }

.lf-submit-loader {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.lf-submit.is-loading .lf-submit-loader { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer links ────────────────────────────────────────────── */
.login-footer-links {
    margin-top: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--c-border);
    padding-top: 1rem;
}
.login-footer-links a {
    font-size: 0.8125rem;
    color: var(--c-muted);
    text-decoration: none;
    transition: color 150ms;
}
.login-footer-links a:hover { color: var(--c-head); }

/* ── Rights mark (corner) ────────────────────────────────────── */
.login-rights-mark {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    animation: fadeUpIn 0.6s ease forwards 3.5s;
    z-index: 5;
}
.rights-svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}
.rights-label {
    font-family: var(--font-m);
    font-size: 0.6rem;
    color: var(--c-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-form-wrapper { padding: 1.75rem 1.5rem; }
    .lf-row--remember { flex-direction: column; align-items: flex-start; }
    .login-rights-mark { display: none; }
}
