/* Halaman masuk (auth) — dipakai oleh layout/auth.php */

:root {
    --auth-brand: #435d7d;
    --auth-brand-dark: #2d4159;
    --auth-gold: #c8992a;
    --auth-ink: #16202b;
    --auth-ink-2: #52616f;
    --auth-ink-3: #8593a1;
    --auth-line: #dfe5ec;
    --auth-danger: #b3261e;
    --auth-danger-bg: #fdf2f1;
    --auth-danger-line: #f0cdc9;
    --auth-danger-ink: #8a2019;
}

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

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--auth-ink);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.18fr 1fr;
}

/* Panel identitas */
.auth__brand {
    position: relative;
    overflow: hidden;
    background: var(--auth-brand-dark);
    padding: 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
}

.auth__brand::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--auth-gold);
}

.auth__brand-top {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.auth__crest {
    width: 91px;
    height: 104px;
    object-fit: contain;
}

.auth__identity {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth__eyebrow {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.auth__title {
    margin: 0;
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 42px;
    line-height: 1.22;
    font-weight: 700;
    color: #ffffff;
    text-wrap: pretty;
    max-width: 560px;
}

.auth__lead {
    margin: 0;
    font-size: 16.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    max-width: 440px;
    text-wrap: pretty;
}

.auth__meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth__rule {
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
}

.auth__place {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.60);
}

.auth__dot { color: rgba(255, 255, 255, 0.30); }

/* Panel form */
.auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 72px;
}

.auth__form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.auth__heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth__h2 {
    margin: 0;
    font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    font-size: 27px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--auth-ink);
}

.auth__sub {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--auth-ink-2);
}

.auth__fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth__label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--auth-ink);
}

.auth__input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--auth-ink);
    background: #ffffff;
    border: 1px solid var(--auth-line);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth__input::placeholder { color: var(--auth-ink-3); }

.auth__input:focus {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 3px rgba(67, 93, 125, 0.14);
}

.auth__input--error {
    border-color: #d8837c;
    box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.10);
}

.auth__pw {
    position: relative;
    display: flex;
}

.auth__pw .auth__input { padding-right: 46px; }

.auth__toggle {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--auth-ink-3);
    cursor: pointer;
}

.auth__toggle:hover {
    color: var(--auth-ink-2);
    background: #f2f5f9;
}

/* Stylesheet bawaan browser membatasi aturan [hidden] ke elemen HTML,
   jadi atribut hidden pada <svg> tidak berefek tanpa aturan ini. */
.auth__toggle svg[hidden] { display: none; }

.auth__toggle:focus-visible {
    outline: 2px solid var(--auth-brand);
    outline-offset: 1px;
}

.auth__submit {
    height: 48px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: var(--auth-brand);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.auth__submit:hover { background: var(--auth-brand-dark); }

.auth__submit:focus-visible {
    outline: 2px solid var(--auth-brand-dark);
    outline-offset: 2px;
}

.auth__foot {
    margin: 0;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--auth-ink-3);
}

.auth__bantuan {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--auth-ink-3);
}

.auth__galat {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--auth-danger-ink);
}

.auth__sukses {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 13px 15px;
    background: #eaf6ee;
    border: 1px solid #b7e0c6;
    border-radius: 6px;
}

.auth__sukses p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #16653a;
}

/* Pesan galat flashdata */
.auth__alert {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 13px 15px;
    background: var(--auth-danger-bg);
    border: 1px solid var(--auth-danger-line);
    border-radius: 6px;
}

.auth__alert svg {
    flex-shrink: 0;
    color: var(--auth-danger);
    margin-top: 1px;
}

.auth__alert p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--auth-danger-ink);
}

/* Baris wilayah yang pindah ke bawah form saat layar sempit */
.auth__place--stacked { display: none; }

@media (max-width: 991.98px) {
    /* auto 1fr menahan pita identitas agar tidak ikut diregangkan
       memenuhi 100vh; sisa ruang jatuh ke panel form. */
    .auth {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth__brand {
        padding: 40px 24px 30px;
        gap: 20px;
        justify-content: flex-start;
    }

    .auth__brand-top { gap: 20px; }

    .auth__crest {
        width: 56px;
        height: 64px;
    }

    .auth__identity { gap: 10px; }

    .auth__eyebrow {
        font-size: 10.5px;
        letter-spacing: 0.15em;
    }

    .auth__title { font-size: 23px; }

    .auth__lead,
    .auth__meta { display: none; }

    .auth__panel {
        align-items: flex-start;
        padding: 32px 24px 28px;
    }

    .auth__form {
        max-width: none;
        gap: 26px;
    }

    .auth__h2 { font-size: 22px; }

    .auth__sub { font-size: 14.5px; }

    .auth__fields { gap: 18px; }

    /* 16px menahan iOS memperbesar tampilan saat field difokuskan */
    .auth__input {
        height: 48px;
        font-size: 16px;
    }

    .auth__pw .auth__input { padding-right: 48px; }

    .auth__toggle {
        top: 6px;
        right: 6px;
    }

    .auth__submit {
        height: 50px;
        font-size: 16px;
    }

    .auth__place--stacked {
        display: flex;
        justify-content: center;
        gap: 8px;
        padding-top: 16px;
        border-top: 1px solid #eef1f6;
        font-size: 12px;
        color: var(--auth-ink-3);
    }

    .auth__place--stacked .auth__dot { color: var(--auth-line); }
}
