/* ============================================================================
   Halaman LOGIN — tata letak dua kolom (panel brand biru + panel form)
   ----------------------------------------------------------------------------
   Berkas ini hanya dimuat pada halaman auth (`$is_auth_page`), bukan di
   dashboard. Namanya sengaja tidak menumpang `custom.css`: aturan di sini
   memakai prefiks `ab-` sehingga tidak mungkin bertabrakan dengan komponen
   Bootstrap/tema yang dipakai halaman lain.

   🔑 Warna panel kiri mengikuti desain acuan: biru navy → biru terang, dengan
   aksen kuning. Warna ini TIDAK mengubah `--bs-primary` milik tema (indigo);
   seluruh tombol di sini memakai class sendiri (`ab-btn--primary`) supaya
   halaman lain tidak ikut berubah.

   🔑 Halaman auth dipaksa mode terang di `layout/header.php`. Berkas ini tidak
   menyediakan varian gelap — kalau nanti tema gelap diaktifkan lagi untuk
   halaman ini, seluruh panel form (putih) akan bertabrakan dengan latar gelap.
   ========================================================================== */

.ab-auth {
    /* Palet panel kiri */
    --ab-blue-900: #0a1f55;
    --ab-blue-800: #0d2a6b;
    --ab-blue-700: #12389a;
    --ab-blue-600: #1b4bd0;
    --ab-blue-500: #2563eb;
    --ab-yellow: #ffc61a;

    /* Palet panel kanan */
    --ab-ink: #0a1733;
    --ab-ink-2: #39476a;
    --ab-muted: #6b7a99;
    --ab-line: #e4e9f5;
    --ab-soft: #f5f8fe;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 32px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ab-ink-2);
    background:
        radial-gradient(900px 420px at 12% -12%, #e6edfc 0%, rgba(230, 237, 252, 0) 70%),
        radial-gradient(760px 420px at 100% 106%, #edf2ff 0%, rgba(237, 242, 255, 0) 70%),
        #f5f7fd;
}

/* `margin: auto` (bukan `justify-content: center`) supaya isi yang lebih tinggi
   dari layar tidak terpotong di sisi atas saat layar pendek. */
.ab-auth__inner {
    width: 100%;
    max-width: 1040px;
    margin: auto;
}

/* ----------------------------------------------------------------------------
   1. Kartu utama
   -------------------------------------------------------------------------- */
.ab-card {
    display: grid;
    /*
     * Dua kolom SAMA LEBAR.
     *
     * Sebelumnya 41% / 59%: panel form tampak jauh lebih besar daripada panel
     * biru, padahal isi panel form hanya satu tombol + dua tautan — akibatnya
     * separuh kanan terlihat kosong dan berat ke satu sisi. 50/50 membuat
     * keduanya terbaca sebagai satu kartu, bukan "kartu kecil di sebelah
     * formulir besar".
     */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: hidden;
    background: #ffffff;
    border-radius: 24px;
    box-shadow:
        0 30px 70px -42px rgba(10, 23, 51, 0.5),
        0 2px 10px rgba(10, 23, 51, 0.05);
}

/* ----------------------------------------------------------------------------
   2. Panel kiri (brand)
   -------------------------------------------------------------------------- */
.ab-card__aside {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 34px 32px 30px;
    overflow: hidden;
    color: #eaf0ff;
    background: linear-gradient(158deg, #12389a 0%, #0d2a6b 46%, #0a1f55 100%);
}

/* Cahaya lembut di kanan-atas, meniru sorotan pada desain acuan. */
.ab-card__aside::before {
    content: '';
    position: absolute;
    top: -110px;
    right: -120px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.38), rgba(96, 165, 250, 0) 68%);
    pointer-events: none;
}

/* Pita biru lebih terang di bawah, sebagai pemisah bidang. */
.ab-card__aside::after {
    content: '';
    position: absolute;
    right: -40%;
    bottom: -46%;
    width: 115%;
    height: 62%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0));
    pointer-events: none;
}

.ab-aside__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.ab-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.ab-brand:hover {
    color: inherit;
}

.ab-brand__logo {
    display: grid;
    place-items: center;
    padding: 6px 9px;
    background: #ffffff;
    border-radius: 11px;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.6);
}

.ab-brand__logo img {
    display: block;
    width: auto;
    max-width: 92px;
    height: 26px;
    object-fit: contain;
}

.ab-brand__name {
    display: block;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
}

.ab-brand__tag {
    display: block;
    margin: 2px 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #b9c9ee;
}

.ab-aside__rule {
    width: 54px;
    height: 4px;
    margin: 26px 0 22px;
    background: var(--ab-yellow);
    border-radius: 99px;
}

.ab-aside__title {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 2.6vw, 2.15rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.ab-aside__title em {
    display: block;
    font-style: normal;
    color: var(--ab-yellow);
}

.ab-aside__lead {
    max-width: 34ch;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #c6d3f2;
}

.ab-pills {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 26px;
}

.ab-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 14px 6px 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #eef3ff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 99px;
}

.ab-pill i {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.ab-pill--teal i {
    color: #6ee7d7;
}

.ab-pill--green i {
    color: #86efac;
}

.ab-pill--amber i {
    color: var(--ab-yellow);
}

/* Hiasan: contoh pesan OTP. Murni dekoratif (`aria-hidden`), tidak ada nilai
   kode sungguhan — hanya deret angka tetap supaya tinggi panel stabil. */
.ab-aside__mock {
    margin-top: auto;
    padding-top: 28px;
}

.ab-bubble {
    max-width: 268px;
    padding: 11px 14px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
}

.ab-bubble__head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9fb6e8;
}

.ab-bubble__code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: #ffffff;
}

/* ----------------------------------------------------------------------------
   3. Panel kanan (form)
   -------------------------------------------------------------------------- */
.ab-card__main {
    display: flex;
    flex-direction: column;
    /*
     * `justify-content: center` menaruh sisa ruang di atas DAN bawah, bukan
     * menumpuknya di bawah. Kolom kiri yang lebih tinggi sudah meregangkan
     * baris grid, jadi isi panel ini tidak akan pernah meluap dan terpotong.
     */
    justify-content: center;
    padding: 34px 32px 28px;
    background: #ffffff;
}

.ab-form__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ab-ink);
}

.ab-form__sub {
    margin: 0 0 20px;
    font-size: 0.855rem;
    line-height: 1.6;
    color: var(--ab-muted);
}

/* Tab metode login (segmented control) */
.ab-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 22px;
    background: #eef1f9;
    border-radius: 99px;
}

.ab-seg__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #5b6b8c;
    background: transparent;
    border: 0;
    border-radius: 99px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ab-seg__btn:hover {
    color: var(--ab-blue-700);
}

.ab-seg__btn.is-active {
    color: var(--ab-blue-700);
    background: #ffffff;
    box-shadow: 0 2px 10px -2px rgba(10, 23, 51, 0.18);
}

.ab-seg__btn:focus-visible {
    outline: 2px solid var(--ab-blue-500);
    outline-offset: 2px;
}

.ab-panel[hidden] {
    display: none !important;
}

/* Tombol */
.ab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 18px;
    font-size: 0.93rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.ab-btn--primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--ab-blue-600) 0%, var(--ab-blue-500) 100%);
    box-shadow: 0 14px 28px -16px rgba(37, 99, 235, 0.9);
}

.ab-btn--primary:hover,
.ab-btn--primary:focus-visible {
    color: #ffffff;
    filter: brightness(1.06);
}

.ab-btn--primary:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    box-shadow: none;
    filter: none;
}

.ab-btn--google {
    color: #20293d;
    background: #ffffff;
    border-color: var(--ab-line);
    box-shadow: 0 2px 6px rgba(10, 23, 51, 0.05);
}

.ab-btn--google:hover,
.ab-btn--google:focus-visible {
    color: #20293d;
    background: #f7f9fe;
    border-color: #cfd9ee;
}

.ab-btn--google.disabled,
.ab-btn--google[aria-disabled='true'] {
    pointer-events: none;
    opacity: 0.65;
}

.ab-btn:focus-visible {
    outline: 2px solid var(--ab-blue-500);
    outline-offset: 2px;
}

.ab-google-g {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* Kolom input */
.ab-field {
    margin-bottom: 14px;
}

.ab-field__label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #46547a;
}

.ab-field__wrap {
    position: relative;
}

.ab-field__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 1.05rem;
    color: #8494b4;
    pointer-events: none;
}

.ab-field__input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font-size: 0.92rem;
    color: var(--ab-ink);
    background: #f8fafd;
    border: 1px solid var(--ab-line);
    border-radius: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ab-field__input::placeholder {
    color: #9aa8c2;
}

.ab-field__input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--ab-blue-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.ab-field__input.is-valid {
    border-color: #16a34a;
}

.ab-field__input.is-invalid {
    border-color: #dc2626;
}

.ab-field__hint {
    margin-top: 6px;
    font-size: 0.73rem;
    line-height: 1.5;
    color: var(--ab-muted);
}

/* Baris "Ingat saya" + tautan bantuan */
.ab-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 16px;
}

.ab-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #46547a;
    cursor: pointer;
    user-select: none;
}

.ab-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--ab-blue-500);
    cursor: pointer;
}

.ab-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ab-blue-600);
    text-decoration: none;
}

.ab-link:hover {
    color: var(--ab-blue-700);
    text-decoration: underline;
}

/* reCAPTCHA */
.ab-captcha {
    margin-bottom: 16px;
    padding: 10px;
    overflow: hidden;
    background: var(--ab-soft);
    border: 1px dashed var(--ab-line);
    border-radius: 12px;
}

.ab-captcha__caption {
    margin-bottom: 8px;
    font-size: 0.73rem;
    text-align: center;
    color: var(--ab-muted);
}

.ab-captcha__box {
    display: flex;
    justify-content: center;
    transform-origin: center top;
}

.ab-captcha__feedback {
    margin-top: 8px;
    font-size: 0.75rem;
    text-align: center;
}

/* Kotak bantuan admin */
.ab-help {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
    background: var(--ab-soft);
    border: 1px solid #e6ecf9;
    border-radius: 14px;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.ab-help:hover,
.ab-help:focus-visible {
    color: inherit;
    background: #eef4ff;
    border-color: #d6e2f8;
}

.ab-help__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
    color: var(--ab-blue-600);
    background: #e3ecff;
    border-radius: 50%;
}

.ab-help__title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ab-ink);
}

.ab-help__sub {
    margin: 0;
    font-size: 0.74rem;
    color: var(--ab-muted);
}

.ab-help__chevron {
    margin-left: auto;
    font-size: 1.1rem;
    color: #9aa8c2;
}

/* Kaki panel form */
.ab-signup {
    margin: 18px 0 0;
    font-size: 0.82rem;
    text-align: center;
    color: var(--ab-muted);
}

.ab-signup a {
    font-weight: 700;
    color: var(--ab-blue-600);
    text-decoration: none;
}

.ab-signup a:hover {
    text-decoration: underline;
}

.ab-back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px auto 0;
    font-size: 0.8rem;
    color: var(--ab-muted);
    text-decoration: none;
}

.ab-back-home:hover {
    color: var(--ab-blue-700);
}

/* ----------------------------------------------------------------------------
   4. Kartu trust di bawah kartu utama
   -------------------------------------------------------------------------- */
.ab-trust {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.ab-trust__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    background: #ffffff;
    border: 1px solid var(--ab-line);
    border-radius: 16px;
    box-shadow: 0 16px 32px -28px rgba(10, 23, 51, 0.55);
}

.ab-trust__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    color: var(--ab-blue-600);
    background: #edf3ff;
    border-radius: 10px;
}

.ab-trust__title {
    margin: 0 0 2px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ab-ink);
}

.ab-trust__text {
    margin: 0;
    font-size: 0.73rem;
    line-height: 1.5;
    color: var(--ab-muted);
}

/* ----------------------------------------------------------------------------
   5. Responsif
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .ab-auth {
        padding: 20px 14px 32px;
    }

    .ab-card {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .ab-card__aside {
        padding: 24px 22px 22px;
    }

    .ab-aside__rule {
        margin: 18px 0 16px;
    }

    .ab-aside__title {
        margin-bottom: 10px;
        font-size: 1.5rem;
    }

    /* Panel kiri menjadi header ringkas: hiasan berat dibuang supaya form
       tetap terlihat tanpa perlu menggulir. */
    .ab-pills,
    .ab-aside__mock,
    .ab-aside__lead {
        display: none;
    }

    .ab-card__main {
        padding: 26px 22px 24px;
    }

    .ab-trust {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 575.98px) {
    .ab-card__main {
        padding: 22px 18px 20px;
    }

    .ab-form__title {
        font-size: 1.28rem;
    }

    /* reCAPTCHA berukuran tetap 304px; dikecilkan agar tidak meluber. */
    .ab-captcha__box {
        transform: scale(0.88);
    }
}

@media (prefers-reduced-motion: reduce) {

    .ab-auth *,
    .ab-auth *::before,
    .ab-auth *::after {
        transition-duration: 0.01ms !important;
    }
}