/* ==========================================================================
   BFI Library | auth page (Masuk, Daftar, Lupa Password)
   ========================================================================== */
body.auth-page { min-height: 100vh; background: var(--cream); }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ---------- Night panel ---------- */
.auth-sky {
    position: relative; display: flex; flex-direction: column; justify-content: flex-start; gap: 24px;
    padding: 32px clamp(28px, 4vw, 56px); overflow: hidden; color: var(--cream);
    background: #29263A;
}
.auth-sky > * { position: relative; z-index: 1; }
.auth-sky-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 800; font-size: 1.06rem; }
.auth-brand img { width: 38px; height: 38px; border-radius: 10px; }
.auth-back {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1.5px solid rgba(251, 246, 239, .35);
    border-radius: 999px; color: var(--cream); font-weight: 700; font-size: .88rem; text-decoration: none;
    transition: border-color .2s, background .2s;
}
.auth-back:hover { border-color: var(--cream); background: rgba(251, 246, 239, .08); }
.auth-back svg { width: 16px; height: 16px; }
.auth-art { display: grid; justify-items: center; gap: 22px; margin-block: auto; text-align: center; }
.auth-art img { width: min(380px, 80%); }
.auth-art .auth-art-logo { width: min(220px, 55%); height: auto; aspect-ratio: 1; border-radius: 26%; box-shadow: 0 18px 40px rgba(0, 0, 0, .28); }
.auth-art > div { display: grid; justify-items: center; gap: 14px; }
.auth-art h2 { color: var(--cream); font-family: var(--font-display); font-size: clamp(1.7rem, 2.4vw, 2.15rem); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; max-width: 24ch; }
.auth-art p { color: rgba(251, 246, 239, .74); max-width: 38ch; line-height: 1.6; }

/* ---------- Form panel ---------- */
.auth-panel { position: relative; z-index: 2; display: grid; place-items: center; padding: 32px clamp(20px, 5vw, 64px); }
.auth-sky-actions { display: flex; align-items: center; gap: 10px; }
.auth-sky .lang-toggle { color: var(--cream); border-color: rgba(251, 246, 239, .35); }
.auth-sky .lang-toggle:hover { border-color: var(--cream); }
.auth-card { width: min(440px, 100%); }
.auth-view { display: grid; gap: 22px; }
.auth-view[hidden] { display: none !important; }
.auth-view.is-entering { animation: auth-view-in .42s var(--ease) both; }
@keyframes auth-view-in { from { opacity: 0; transform: translateY(16px); } }
.auth-head { display: grid; gap: 10px; }
.auth-head .eyebrow { color: var(--accent); }
.auth-head h1 { font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -.035em; }
.auth-head p { color: var(--muted); }
.auth-form { display: grid; gap: 16px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.text-button { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 800; font-size: .88rem; text-decoration: none; cursor: pointer; }
.field-row .text-button { display: inline-flex; align-items: center; min-height: 44px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 2px; }
.strength span { height: 5px; border-radius: 4px; background: var(--line); transition: background .25s; }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--coral); }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--butter); }
.strength[data-level="4"] span { background: var(--success); }
.strength-label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-btn svg { width: 20px; height: 20px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .95rem; }
.auth-message { padding: 12px 14px; border-radius: 10px; font-size: .92rem; font-weight: 600; line-height: 1.45; }
.auth-message--error { background: var(--danger-soft); color: var(--danger); }
.auth-message--success { background: var(--success-soft); color: var(--success); }
.auth-message--info { background: var(--accent-soft); color: var(--accent-ink); }
.auth-note { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid rgba(251, 246, 239, .5); border-top-color: var(--cream);
    border-radius: 50%; animation: spin .7s linear infinite;
}
.btn:not(.btn--primary).is-loading::after { border-color: rgba(29, 27, 38, .2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.auth-steps li { display: flex; gap: 10px; color: var(--ink-2); font-size: .92rem; }
.auth-request-password { display: grid; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line, rgba(29, 27, 38, .12)); }
.auth-request-password strong { color: var(--ink); font-size: .95rem; }
.auth-request-password .auth-note { margin: 0; }
.auth-steps li::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; margin: .55em 4px 0 2px; border-radius: 50%; background: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-sky { min-height: auto; padding: 18px 20px 32px; gap: 14px; }
    /* Stacked (tablet/mobile) layout: only the brand bar sits above the form. */
    .auth-art { display: none; }
    .auth-panel { place-items: start center; margin-top: -16px; padding: 0 16px 36px; }
    .auth-card { padding: 26px 22px; border: 1.5px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 5px 5px 0 var(--ink); }
}
@media (max-width: 600px) {
    .auth-sky { padding: 14px 16px 24px; }
    .auth-panel { margin-top: -12px; padding: 0 12px 28px; }
    .auth-card { padding: 22px 18px; }
}
@media (max-width: 420px) {
    .auth-back span { display: none; }
    .auth-back { padding: 8px 10px; }
}
