/* =============================================================================
   auth.css v2 - 2026-10-17
   Halaman: login, register, forgot-password, reset-password
   Model: split penuh - panel gelap (kiri) + panel formulir (kanan), tanpa
   kotak melayang di tengah. Bahasa desain sama dengan BluePrint: tinta
   #0b0b0c, aksen #1d4ed8, garis rambut, radius 16, Space Grotesk.

   CATATAN PERBAIKAN v1 -> v2:
   - v1 menumpuk 5 aturan .auth-branding (gradien per halaman) sehingga yang
     menang adalah gradien HIJAU reset-password dan dipakai SEMUA halaman.
     v2 memakai satu panel tinta + aksen untuk seluruh halaman.
   - v1 menyembunyikan panel merek di seluler; v2 mempertahankan pita ramping.

   Kelas kontrak yang DIPERTAHANKAN (dipakai handler inline / JS):
   .form-floating-custom, .input-group, .input-icon, .password-toggle-btn,
   .otp-digit (auto-advance + updateOtpCode), #otpCode, .password-strength-bar,
   .strength-step (#str1..#str3 diatur auth-register.js via inline style).
   ============================================================================= */

/* ---------- Kerangka split ---------- */
.auth-wrapper {
    --auth-ink: #0b0b0c;
    --auth-line: #e4e4e7;
    --auth-muted: #71717a;
    --auth-accent: #1d4ed8;
    --auth-accent-dark: #1e40af;
    background: #f7f7f8;
    padding: 0;
}

.auth-split {
    display: grid;
    grid-template-columns: minmax(320px, 44%) minmax(0, 1fr);
    min-height: max(560px, calc(100vh - 76px));
}

/* ---------- Panel gelap kiri ---------- */
.auth-branding {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    background: var(--auth-ink);
    color: #fafafa;
    padding: clamp(1.75rem, 4vw, 3.25rem);
}

.auth-branding::before {
    content: "";
    position: absolute;
    inset: auto -20% -40% -20%;
    height: 65%;
    background: radial-gradient(closest-side, rgba(29, 78, 216, 0.38), transparent 72%);
    pointer-events: none;
}

.auth-branding::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(130% 90% at 18% 0%, #000 25%, transparent 72%);
    mask-image: radial-gradient(130% 90% at 18% 0%, #000 25%, transparent 72%);
    pointer-events: none;
}

.auth-branding > * { position: relative; z-index: 1; }

.auth-branding-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.auth-branding-logo:hover { color: #ffffff; }

.auth-branding-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--auth-accent);
    color: #ffffff;
    font-size: 1.05rem;
    box-shadow: 0 10px 26px rgba(29, 78, 216, 0.38);
}

.auth-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8fb0ff;
    margin: 1.6rem 0 0.55rem;
}

.auth-kicker--blue { color: var(--auth-accent); margin: 0 0 0.5rem; }

.auth-headline {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: clamp(1.6rem, 2.4vw, 2.15rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 0 0 0.65rem;
}

.auth-sub {
    color: #a1a1aa;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 38ch;
    margin: 0;
}

.branding-features-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #1f1f23;
}

.branding-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #1f1f23;
    color: #d4d4d8;
    font-size: 0.9rem;
}

.branding-features-list li i {
    color: #7ea2ff;
    font-size: 1.05rem;
    margin-top: 0.05rem;
}

.auth-branding-foot { color: #6b6b74; font-size: 0.78rem; text-align: right; }

/* ---------- Panel formulir kanan ---------- */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 4rem) clamp(1.1rem, 3vw, 2.5rem);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    padding: clamp(1.4rem, 3vw, 2.25rem);
    box-shadow: 0 1px 2px rgba(11, 11, 12, 0.04), 0 14px 40px -28px rgba(11, 11, 12, 0.2);
}

.auth-form-header { margin-bottom: 1.5rem; }

.auth-form-header h2 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.55rem;
    letter-spacing: -0.02em;
    color: var(--auth-ink);
    margin: 0 0 0.35rem;
}

.auth-form-header p {
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.auth-form-header--center { text-align: center; }
.auth-form-header--center p strong { color: var(--auth-accent); }

.auth-icon-tile {
    width: 58px;
    height: 58px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #eef3ff;
    color: var(--auth-accent);
    font-size: 1.5rem;
}

/* ---------- Peringatan ---------- */
.auth-card .alert {
    border-radius: 12px;
    padding: 0.8rem 0.95rem;
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 1.1rem;
    border: 1px solid transparent;
}
.auth-card .alert i { margin-top: 0.1rem; }
.auth-card .alert-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.auth-card .alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* ---------- Bidang formulir ---------- */
.form-floating-custom { margin-bottom: 1.05rem; }

.form-floating-custom .form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-ink);
    margin-bottom: 0.4rem;
}

.form-floating-custom .input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-floating-custom .input-group:focus-within {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.form-floating-custom .input-group .input-icon {
    width: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    background: #fafafa;
    border-right: 1px solid var(--auth-line);
    color: var(--auth-muted);
    font-size: 1rem;
}

.form-floating-custom .input-group .form-control {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 48px;
    font-size: 0.95rem;
    color: var(--auth-ink);
    padding: 0 0.9rem;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}
.form-floating-custom .input-group .form-control::placeholder { color: #a1a1aa; }

.password-toggle-btn {
    border: 0;
    background: transparent;
    width: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    color: var(--auth-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.password-toggle-btn:hover { color: var(--auth-ink); background: #f4f4f5; }
.password-toggle-btn:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: -2px; }

/* ---------- Tombol ---------- */
.auth-card .btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Kelas Bootstrap pada markup lama (rounded-pill / py-3 memakai !important)
   dinetralkan supaya bentuk tombol seragam dengan sistem baru (radius 10). */
.auth-card .btn.rounded-pill { border-radius: 10px !important; }
.auth-card .btn.py-3 {
    padding-top: 0.78rem !important;
    padding-bottom: 0.78rem !important;
}

.auth-card .btn-primary {
    background: var(--auth-accent);
    border: 0;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: background 0.15s ease, transform 0.05s ease;
}
.auth-card .btn-primary:hover { background: var(--auth-accent-dark); }
.auth-card .btn-primary:active { transform: translateY(1px); }
.auth-card .btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.28); }

.auth-card .btn-success {
    background: #15803d;
    border: 0;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}
.auth-card .btn-success:hover { background: #166534; }

.auth-card .btn-link {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}
.auth-card .btn-link:hover { color: var(--auth-accent-dark); text-decoration: underline; }

/* Tautan teks di dalam kartu */
.auth-card .text-primary { color: var(--auth-accent) !important; }
.auth-card .small a { font-weight: 600; text-decoration: none; }
.auth-card .small a:hover { text-decoration: underline; }

/* ---------- Pembatas & tautan alternatif ---------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #a1a1aa;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 1.35rem 0;
    border-top: 0;
}
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--auth-line); }

.auth-alt { text-align: center; font-size: 0.88rem; color: var(--auth-muted); }
.auth-alt a { color: var(--auth-accent); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* ---------- OTP ---------- */
.otp-digit-boxes {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0.35rem 0 1.25rem;
}

.otp-digit-boxes input,
.otp-digit {
    width: 50px;
    height: 58px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    color: var(--auth-ink);
    background: #ffffff;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.otp-digit:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

/* ---------- Kekuatan sandi (#str1..#str3) ---------- */
.password-strength-bar { display: flex; gap: 6px; margin-top: 0.55rem; }
.strength-step {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--auth-line);
    transition: background 0.2s ease;
}

/* ---------- Checkbox ---------- */
.auth-card .form-check { display: flex; align-items: flex-start; gap: 0.55rem; margin: 0; }
.auth-card .form-check-input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0;
    border: 1px solid var(--auth-line);
    background-color: #ffffff;
    accent-color: var(--auth-accent);
}
.auth-card .form-check-input:checked { background-color: var(--auth-accent); border-color: var(--auth-accent); }
.auth-card .form-check-input:focus { box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14); border-color: var(--auth-accent); }
.auth-card .form-check-label { font-size: 0.85rem; color: #3f3f46; }

/* ---------- Mode gelap ---------- */
body.dark-mode .auth-wrapper { background: #0d0d0f; }
body.dark-mode .auth-card { background: #141416; border-color: #27272a; }
body.dark-mode .auth-form-header h2 { color: #fafafa; }
body.dark-mode .auth-form-header p { color: #a1a1aa; }
body.dark-mode .form-floating-custom .form-label { color: #e4e4e7; }
body.dark-mode .form-floating-custom .input-group { background: #101012; border-color: #27272a; }
body.dark-mode .form-floating-custom .input-group .input-icon { background: #18181b; border-color: #27272a; color: #a1a1aa; }
body.dark-mode .form-floating-custom .input-group .form-control { color: #fafafa; }
body.dark-mode .password-toggle-btn:hover { color: #fafafa; background: #1f1f23; }
body.dark-mode .otp-digit-boxes input,
body.dark-mode .otp-digit { background: #101012; border-color: #27272a; color: #fafafa; }
body.dark-mode .auth-divider { color: #71717a; }
body.dark-mode .auth-divider::before,
body.dark-mode .auth-divider::after { background: #27272a; }
body.dark-mode .auth-alt { color: #a1a1aa; }
body.dark-mode .strength-step { background: #27272a; }
body.dark-mode .auth-card .form-check-label { color: #d4d4d8; }
body.dark-mode .auth-card .form-check-input { background-color: #101012; border-color: #3f3f46; }
body.dark-mode .auth-card .alert-danger { background: rgba(185, 28, 28, 0.12); border-color: rgba(185, 28, 28, 0.35); color: #fca5a5; }
body.dark-mode .auth-card .alert-success { background: rgba(21, 128, 61, 0.14); border-color: rgba(21, 128, 61, 0.35); color: #86efac; }
body.dark-mode .auth-icon-tile { background: rgba(29, 78, 216, 0.16); }

/* ---------- Seluler: panel gelap jadi pita ramping ---------- */
@media (max-width: 991.98px) {
    .auth-split { grid-template-columns: 1fr; min-height: 0; }
    .auth-branding { gap: 0.75rem; padding: 1.4rem 1.4rem 1.5rem; }
    .auth-branding::after { display: none; }
    .auth-kicker { margin: 0.9rem 0 0.3rem; }
    .auth-headline { font-size: 1.4rem; margin-bottom: 0; }
    .auth-sub,
    .branding-features-list,
    .auth-branding-foot { display: none; }
    .auth-form-panel { padding: 1.4rem 1.1rem 2.2rem; }
    .auth-card { padding: 1.35rem 1.15rem; }
}

@media (max-width: 380px) {
    .otp-digit-boxes input,
    .otp-digit { width: 38px; height: 46px; font-size: 1.1rem; border-radius: 10px; }
}
