/* ============================================================
   auth.css — satu-satunya gaya untuk halaman autentikasi
   (login, lupa password, verifikasi 2 langkah)

   Sebelumnya ketiga file menyalin aturan yang sama persis
   (body, kartu, header, footer) di dalam <style> inline:
     login.blade.php         4.125 byte
     lupa-password.blade.php 2.759 byte
     2fa.blade.php           1.576 byte
                    total    8.460 byte dikirim ulang tiap muat

   Halaman ini sengaja TIDAK memuat assets/css/style.css (23,5 KB).
   Semua komponen yang dibutuhkan (.alert, .btn, .form-*) didefinisikan
   di bawah, jadi halaman login tidak menarik 23 KB CSS umum yang
   isinya tidak terpakai.
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1e293b;
    background: radial-gradient(circle at top, #1e3a8a 0%, #0f172a 60%, #020617 100%);
}

/* ---------- Kartu ---------- */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    animation: auth-rise .28s ease-out both;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-wrapper { animation: none; }
    * { transition-duration: .01ms !important; }
}

/* Kartu jadi kolom flex: header dan footer identik di kedua
   halaman, sedangkan .auth-body memakai tinggi minimum yang sama. */
.auth-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .4);
    overflow: hidden;
}

.auth-header {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    padding: 36px 30px 28px;
    color: #ffffff;
    text-align: center;
}

.auth-logo {
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
}

/* Logo cadangan saat gambar gagal dimuat.
   Versi lama menulis <span> kosong sehingga muncul kotak hampa;
   now JS menukar gambar dengan ikon di bawah. */
.auth-logo-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .16);
    color: #ffffff;
}

.auth-logo-fallback.is-on { display: flex; }

.auth-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 900;
    font-family: 'Arial Black', 'Segoe UI', system-ui, sans-serif;
    letter-spacing: .02em;
    color: #ffffff;
}

/* Tinggi kartu mengikuti isi (tidak ada ruang putih hampa).
   Kedua halaman tetap sama lebar (440px). */
.auth-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 28px 30px;
}

/* Jarak antar field agar tidak berhimpitan. */
.auth-field { margin-bottom: 18px; }

/* Isi mulai dari atas seperti halaman login, lalu catatan didorong ke
   bawah. Tanpa ini semua elemen terkumpul di tengah kartu karena isinya
   lebih pendek daripada halaman login. */
.auth-body--note-bottom { justify-content: flex-start; }
.auth-body--note-bottom form { margin-bottom: 24px; }
.auth-body--note-bottom .auth-note { margin-top: auto; }

.auth-footer {
    flex: 0 0 auto;
    padding: 16px 30px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: .78rem;
    color: #64748b;
}

/* ---------- Teks ---------- */
.auth-welcome {
    margin: 0 0 20px;
    text-align: center;
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
}

.auth-subtitle {
    margin: 0 0 16px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.auth-note {
    margin-top: 24px;
    padding: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    font-size: .78rem;
    color: #475569;
    line-height: 1.5;
}

.auth-note svg { vertical-align: -1px; }

.auth-note-sub {
    display: block;
    margin-top: 4px;
    opacity: .8;
}

/* ---------- Pesan sistem ---------- */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 600;
}

.auth-alert-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.auth-alert-text { flex: 1; }

.auth-alert--success {
    border-color: #a7f3d0;
    border-left-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.auth-alert--info {
    border-color: #bfdbfe;
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.auth-alert--danger {
    border-color: #fecaca;
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.auth-alert--warning {
    border-color: #fcd34d;
    border-left-color: #d97706;
    background: #fffbeb;
    color: #92400e;
}

.auth-alert--plain {
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: .85rem;
}

.auth-alert--tight { margin-bottom: 16px; }

.auth-alert-close {
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.auth-alert-close:hover { color: #b91c1c; }

/* ---------- Toggle Password ---------- */
.auth-input-group { position: relative; display: flex; align-items: center; }

.auth-input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    color: #94a3b8;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    font-family: inherit;
    font-size: .95rem;
    color: inherit;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-input--plain { padding-left: 14px; }

/* Ruang untuk tombol mata di kanan (hanya field password). */
.auth-input--with-toggle { padding-right: 48px; }

/* Sembunyikan ikon mata bawaan browser (Edge/IE) supaya tidak menumpuk dengan tombol mata milik aplikasi. */
.auth-input::-ms-reveal,
.auth-input::-ms-clear { display: none; }

.auth-input::placeholder { color: #94a3b8; }

.auth-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .15);
}

.auth-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color .15s ease;
}

.auth-toggle:hover,
.auth-toggle:focus-visible {
    color: #2563eb;
    background: transparent;
    outline: none;
}

.auth-toggle:focus-visible { box-shadow: 0 0 0 2px rgba(37, 99, 235, .3); }

.auth-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    position: relative;
}

.auth-toggle-icon svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}

.auth-toggle[aria-pressed="true"] [data-ikon-mata] {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.8);
}

.auth-toggle[aria-pressed="false"] [data-ikon-mata-coret] {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.8);
}

.auth-toggle[aria-pressed="true"] [data-ikon-mata-coret],
.auth-toggle[aria-pressed="false"] [data-ikon-mata] {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Field jebakan bot: disembunyikan dari mata, tetap bisa diisi mesin. */
.auth-honeypot {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ---------- Tombol ---------- */
.auth-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    padding: 13px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: .98rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, .35);
    transition: transform .2s ease, box-shadow .2s ease;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 20px -3px rgba(37, 99, 235, .45);
}

.auth-btn:active { transform: translateY(0); }

.auth-btn--ghost {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.auth-btn--ghost:hover {
    background: #e9eef5;
    box-shadow: none;
}

.auth-btn--sm {
    display: inline-block;
    width: auto;
    margin: 0;
    padding: 6px 12px;
    font-size: .8rem;
    border-radius: 6px;
}

.auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.auth-actions .auth-btn { margin-top: 0; }
.auth-actions .auth-btn:first-child { flex: 1.2; }
.auth-actions .auth-btn:last-child { flex: 1; }

/* ---------- Baris bawah form ---------- */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    font-size: .82rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
}

.auth-link {
    color: #2563eb;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

/* ---------- Kotak akun terkunci ---------- */
.auth-lockbox {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    color: #991b1b;
    font-size: .85rem;
    line-height: 1.5;
}

.auth-lockbox-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* ---------- Kode 2FA ---------- */

/* ---------- Layar kecil ---------- */
@media (max-width: 420px) {
    body { padding: 14px; }
    .auth-header { padding: 26px 20px 20px; }
    .auth-body { padding: 24px 20px; }
    .auth-footer { padding: 14px 20px; }
    .auth-logo { width: 78px; height: 78px; }
    .auth-title { font-size: 1.2rem; }
    .auth-actions { flex-direction: column; }
    .auth-actions .auth-btn:first-child,
    .auth-actions .auth-btn:last-child { flex: auto; }
}

/* ---------- Layar pendek (laptop 768px) ---------- */
/* Padding dan logo dikecilkan supaya muat lebih cepat. Tinggi minimum
   .auth-body sengaja tidak diubah supaya kedua halaman tetap sama tinggi. */
@media (max-height: 800px) {
    .auth-header { padding: 24px 30px 20px; }
    .auth-logo { width: 82px; height: 82px; }
    .auth-body { padding: 24px 30px; }
}
