/* ============================================================================
   auth.css — kerangka halaman masuk Aizu
   Dipakai bersama oleh /login/ dan /forgot-password/ (dan halaman auth lain).

   Prinsip visual mengikuti ikon Aizu: monokrom, tanpa gradien, tanpa glow.
   Warna diambil dari variabel tema style.css supaya mode terang/gelap
   otomatis ikut.
   ========================================================================= */

/* ---------- Kerangka dua kolom ---------- */

html, body.auth-page { height: 100%; }

body.auth-page {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', system-ui, sans-serif;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    display: block;
    padding: 0;
    text-align: left;
    font-size: 15px;
    line-height: 1.5;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.15fr minmax(340px, 0.85fr);
    min-height: 100vh;
}

/* ---------- Kolom identitas ---------- */

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 56px 44px 64px;
    background: var(--bg-subtle);
    border-right: 1px solid var(--border-color);
}

/* Cincin orbit digambar sebagai SVG agar tajam di semua kerapatan piksel.
   Cincin terluar paling samar — memberi kesan medan yang berlanjut
   melewati tepi layar. */
.auth-orbit {
    position: absolute;
    inset: 0;
    pointer-events: none;
    color: var(--text-primary);
}
.auth-orbit svg {
    position: absolute;
    top: 50%;
    left: -18%;
    width: 132%;
    height: auto;
    transform: translateY(-50%);
    display: block;
}
.auth-orbit circle {
    fill: none;
    stroke: currentColor;
    vector-effect: non-scaling-stroke;
}
.auth-orbit .ring-1 { stroke-width: 1; opacity: .20; }
.auth-orbit .ring-2 { stroke-width: 1; opacity: .14; }
.auth-orbit .ring-3 { stroke-width: 1; opacity: .09; }
.auth-orbit .ring-4 { stroke-width: 1; opacity: .055; }

/* Satu cincin dibuat putus-putus supaya perputarannya terbaca —
   lingkaran polos yang berputar tampak diam. */
.auth-orbit .ring-3 { stroke-dasharray: 2 16; }

.auth-orbit .planet {
    fill: currentColor;
    opacity: .85;
}

/* Satelit kecil yang mengelilingi planet. */
.auth-orbit .sat {
    fill: currentColor;
    opacity: .45;
}
.auth-orbit .orb-c .sat { opacity: .7; }

/* Poros putar di titik pusat SVG (500,500 pada viewBox). */
.auth-orbit .orb {
    transform-box: view-box;
    transform-origin: 500px 500px;
    will-change: transform;
}

/* Empat jalur orbit, kecepatan dan arah berbeda supaya kedalamannya
   terasa. Semuanya lambat — ini latar, bukan tontonan. */
.auth-orbit .orb-a { animation: orbit-spin 96s linear infinite; }
.auth-orbit .orb-b { animation: orbit-spin 68s linear infinite reverse; }
.auth-orbit .orb-c { animation: orbit-spin 44s linear infinite; }
.auth-orbit .orb-d { animation: orbit-spin 30s linear infinite reverse; }

@keyframes orbit-spin {
    to { transform: rotate(360deg); }
}

.auth-brand-mid,
.auth-brand-bottom {
    position: relative;
    z-index: 1;
}

.auth-wordmark {
    margin: 0 0 14px;
    font-size: clamp(3.6rem, 7.2vw, 6rem);
    font-weight: 700;
    line-height: .92;
    letter-spacing: -0.045em;
    color: var(--text-primary);
}

.auth-tagline {
    margin: 0;
    max-width: 26ch;
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
}

.auth-legal {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ---------- Kolom formulir ---------- */

.auth-form-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    background: var(--bg-main);
}

.auth-form-inner {
    width: 100%;
    max-width: 372px;
}

.auth-h1 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text-primary);
}

.auth-sub {
    margin: 0 0 30px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.auth-field { margin-bottom: 18px; }

.auth-label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--text-secondary);
}

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

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color .16s ease, box-shadow .16s ease;
    appearance: none;
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:hover { border-color: var(--border-strong); }
.auth-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-primary) 12%, transparent);
}
.auth-input:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 40px var(--bg-card) inset;
}

.auth-input.has-toggle { padding-right: 82px; }

.auth-toggle-pass {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    padding: 0 8px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: color .16s ease, background-color .16s ease;
}
.auth-toggle-pass:hover { color: var(--text-primary); background: var(--bg-sunken); }
.auth-toggle-pass:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 1px;
}

/* Tombol utama memakai tinta pekat, bukan warna aksen — mengikuti ikon
   yang sepenuhnya monokrom. Otomatis terbalik di mode gelap. */
.auth-submit {
    width: 100%;
    margin-top: 6px;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--bg-main);
    background: var(--text-primary);
    border: 1px solid var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: opacity .16s ease, transform .16s ease;
}
.auth-submit:hover { opacity: .88; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 3px;
}

/* ---------- Pesan ---------- */

.auth-error,
.auth-success {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-primary);
    border-radius: 0 8px 8px 0;
}
.auth-error {
    background: var(--rose-wash);
    border-left: 3px solid var(--rose);
}
.auth-success {
    background: var(--emerald-wash);
    border-left: 3px solid var(--emerald);
}
.auth-error svg,
.auth-success svg { flex-shrink: 0; margin-top: 1px; }
.auth-error svg { color: var(--rose); }
.auth-success svg { color: var(--emerald); }

/* ---------- Tautan & catatan kaki ---------- */

.auth-links {
    margin: 22px 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.auth-links a,
.auth-inline-link {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 1px;
    transition: border-color .16s ease;
}
.auth-links a:hover,
.auth-inline-link:hover { border-color: var(--text-primary); }
.auth-links a:focus-visible,
.auth-inline-link:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 3px;
    border-radius: 2px;
}

.auth-footnote {
    margin: 26px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.auth-footnote a {
    color: var(--text-secondary);
    text-decoration: underline;
}
.auth-footnote a:hover { color: var(--text-primary); }

/* ---------- Tahap verifikasi (OTP) ---------- */

.auth-otp-input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: .48em;
    text-indent: .48em;
    font-variant-numeric: tabular-nums;
}

.auth-otp-help {
    margin: 18px 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--text-muted);
}

/* ---------- Ikon status untuk tahap selesai ---------- */

.auth-done-mark {
    width: 44px;
    height: 44px;
    margin: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--emerald);
    background: var(--bg-subtle);
}

/* ---------- Satu momen gerak: cincin menyusun diri ---------- */

@keyframes auth-ring-in {
    from { opacity: 0; transform: scale(.965); }
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(10px); }
}

.auth-orbit svg { animation: auth-ring-in .9s cubic-bezier(.22,.61,.36,1) both; }
.auth-h1, .auth-sub, .auth-field, .auth-submit, .auth-otp-help, .auth-done-mark {
    animation: auth-rise .5s cubic-bezier(.22,.61,.36,1) both;
}
.auth-h1        { animation-delay: .04s; }
.auth-sub       { animation-delay: .08s; }
.auth-field     { animation-delay: .12s; }
.auth-field + .auth-field { animation-delay: .16s; }
.auth-submit    { animation-delay: .20s; }
.auth-otp-help  { animation-delay: .20s; }
.auth-done-mark { animation-delay: .04s; }

@media (prefers-reduced-motion: reduce) {
    .auth-orbit svg,
    .auth-orbit .orb,
    .auth-h1, .auth-sub, .auth-field, .auth-submit,
    .auth-otp-help, .auth-done-mark {
        animation: none !important;
    }
    .auth-input, .auth-submit, .auth-toggle-pass, .auth-links a {
        transition: none !important;
    }
}

/* ---------- Layar sempit ---------- */

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 100dvh;
    }

    .auth-brand {
        padding: 34px 26px 30px;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
        justify-content: flex-start;
        gap: 22px;
        overflow: hidden;
    }

    .auth-orbit svg {
        top: 50%;
        left: auto;
        right: -34%;
        width: 116%;
        transform: translateY(-50%);
    }

    .auth-wordmark {
        font-size: clamp(2.5rem, 12vw, 3.25rem);
        margin-bottom: 8px;
    }

    .auth-tagline {
        font-size: 0.9375rem;
        max-width: 30ch;
    }

    .auth-legal { display: none; }

    .auth-form-col {
        padding: 34px 26px 48px;
        align-items: flex-start;
    }

    .auth-form-inner { max-width: none; }
}

@media (max-width: 380px) {
    .auth-brand { padding: 28px 20px 26px; }
    .auth-form-col { padding: 28px 20px 40px; }
}

/* ============================================================================
   Bagian khusus formulir pendaftaran (/register/)
   Halaman daftar memakai kerangka auth yang sama, jadi gayanya ikut di sini.
   ========================================================================= */

/* Kolom umpan bot: tak terlihat mata, tetapi tetap ada di DOM. */
.reg-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.reg-hint {
    margin: 7px 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
}
