/**
 * Nama file: auth.css
 *
 * Fungsi:
 * Menata halaman login dan halaman autentikasi sementara.
 *
 * Digunakan oleh:
 * login.php dan authenticated.php.
 */

:root {
    --auth-primary: #0252cd;
    --auth-primary-dark: #073b8f;
    --auth-primary-darker: #062d6f;
    --auth-surface: #ffffff;
    --auth-background: #f3f6fb;
    --auth-border: #dce4f0;
    --auth-text: #172033;
    --auth-muted: #667085;
    --auth-success: #157347;
    --auth-success-background: #eaf7f0;
    --auth-danger: #b42318;
    --auth-danger-background: #fff0ee;
    --auth-shadow: 0 24px 60px rgba(7, 59, 143, 0.16);
    --auth-radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--auth-text);
    background: var(--auth-background);
}

body {
    min-height: 100vh;
    margin: 0;
}

button,
input {
    font: inherit;
}

.auth-page {
    background:
        radial-gradient(
            circle at top right,
            rgba(2, 82, 205, 0.12),
            transparent 35%
        ),
        var(--auth-background);
}

.auth-shell {
    display: grid;
    grid-template-columns:
        minmax(320px, 0.95fr)
        minmax(420px, 1.05fr);
    min-height: 100vh;
}

.auth-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    padding: 64px;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            var(--auth-primary-darker),
            var(--auth-primary) 72%,
            #2785ff
        );
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    position: absolute;
    display: block;
    border-radius: 999px;
    content: "";
}

.auth-brand-panel::before {
    top: -120px;
    right: -160px;
    width: 420px;
    height: 420px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-brand-panel::after {
    bottom: -180px;
    left: -140px;
    width: 480px;
    height: 480px;
    border: 70px solid rgba(255, 255, 255, 0.07);
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    margin-inline: auto;
}

.auth-logo {
    display: grid;
    width: 72px;
    height: 72px;
    margin-bottom: 40px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 22px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
}

.auth-eyebrow {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.78);
}

.auth-eyebrow-dark {
    color: var(--auth-primary);
}

.auth-brand-panel h1 {
    max-width: 500px;
    margin: 0;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.auth-brand-description {
    max-width: 510px;
    margin: 28px 0 38px;
    font-size: 17px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.82);
}

.auth-feature-list {
    display: grid;
    gap: 14px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-feature-item span {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    color: var(--auth-primary-dark);
    background: #ffffff;
}

.auth-feature-item p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.auth-form-panel {
    display: grid;
    padding: 48px;
    place-items: center;
}

.auth-card {
    width: min(100%, 510px);
    padding: 44px;
    border: 1px solid rgba(220, 228, 240, 0.8);
    border-radius: var(--auth-radius);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--auth-shadow);
}

.auth-card-header h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    letter-spacing: -0.04em;
}

.auth-card-header > p:last-child {
    margin: 14px 0 0;
    line-height: 1.7;
    color: var(--auth-muted);
}

.auth-alert {
    margin-top: 24px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
}

.auth-alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.auth-alert-success {
    border-color: #b7e3c9;
    color: var(--auth-success);
    background: var(--auth-success-background);
}

.auth-alert-danger {
    border-color: #f1c0bb;
    color: var(--auth-danger);
    background: var(--auth-danger-background);
}

.auth-form {
    display: grid;
    gap: 22px;
    margin-top: 30px;
}

.auth-field {
    display: grid;
    gap: 9px;
}

.auth-field label {
    font-size: 14px;
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    outline: 0;
    color: var(--auth-text);
    background: #ffffff;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.auth-field input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(2, 82, 205, 0.11);
}

.auth-field input::placeholder {
    color: #98a2b3;
}

.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper input {
    padding-right: 76px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-width: 60px;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--auth-primary);
    background: #edf4ff;
}

.auth-submit,
.auth-logout {
    min-height: 54px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--auth-primary-dark),
            var(--auth-primary)
        );
    box-shadow: 0 12px 26px rgba(2, 82, 205, 0.24);
    transition:
        transform 160ms ease,
        opacity 160ms ease;
}

.auth-submit:hover,
.auth-logout:hover {
    transform: translateY(-1px);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.auth-submit-loading {
    display: none;
}

.auth-submit.is-loading .auth-submit-label {
    display: none;
}

.auth-submit.is-loading .auth-submit-loading {
    display: inline;
}

.auth-card-footer {
    padding-top: 26px;
    text-align: center;
}

.auth-card-footer p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--auth-muted);
}

.authenticated-page {
    display: grid;
    min-height: 100vh;
    padding: 28px;
    place-items: center;
    background:
        radial-gradient(
            circle at top left,
            rgba(2, 82, 205, 0.16),
            transparent 38%
        ),
        var(--auth-background);
}

.authenticated-shell {
    width: min(100%, 720px);
}

.authenticated-card {
    padding: 48px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    text-align: center;
    background: #ffffff;
    box-shadow: var(--auth-shadow);
}

.authenticated-icon {
    display: grid;
    width: 76px;
    height: 76px;
    margin: 0 auto 28px;
    place-items: center;
    border-radius: 50%;
    font-size: 34px;
    font-weight: 800;
    color: #ffffff;
    background: var(--auth-success);
}

.authenticated-card h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 46px);
    letter-spacing: -0.045em;
}

.authenticated-description {
    max-width: 560px;
    margin: 18px auto 30px;
    line-height: 1.7;
    color: var(--auth-muted);
}

.authenticated-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 0 0 28px;
    text-align: left;
}

.authenticated-details div {
    padding: 18px;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    background: #f9fbfe;
}

.authenticated-details dt {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--auth-muted);
}

.authenticated-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 750;
}

.auth-logout {
    width: 100%;
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: auto;
        padding: 42px 28px;
    }

    .auth-brand-content {
        width: 100%;
    }

    .auth-logo {
        width: 58px;
        height: 58px;
        margin-bottom: 24px;
        border-radius: 18px;
        font-size: 20px;
    }

    .auth-brand-panel h1 {
        font-size: clamp(38px, 10vw, 56px);
    }

    .auth-brand-description {
        margin-bottom: 0;
    }

    .auth-feature-list {
        display: none;
    }

    .auth-form-panel {
        padding: 32px 20px 48px;
    }
}

@media (max-width: 560px) {
    .auth-brand-panel {
        padding: 32px 20px;
    }

    .auth-form-panel {
        padding: 20px 14px 36px;
    }

    .auth-card,
    .authenticated-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .authenticated-page {
        padding: 14px;
    }

    .authenticated-details {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
/* STAGE 10D-1 LOGIN RESPONSIVE POLISH START */
.auth-password-wrapper {
    display: block;
    min-width: 0;
}

.auth-password-wrapper input {
    padding-right: 86px;
}

.auth-password-toggle {
    top: 50%;
    right: 8px;
    bottom: auto;
    display: inline-flex;
    min-width: 62px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(-50%);
}

.auth-card,
.auth-field input,
.auth-submit {
    line-height: 1.45;
}

.auth-field {
    gap: 10px;
}

@media (max-width: 900px) {
    .auth-shell {
        min-height: 100dvh;
    }

    .auth-form-panel {
        align-items: start;
    }
}

@media (max-width: 560px) {
    .auth-card {
        width: 100%;
    }

    .auth-field input {
        min-height: 50px;
        padding-left: 14px;
    }

    .auth-password-wrapper input {
        padding-right: 82px;
    }

    .auth-password-toggle {
        right: 7px;
        min-width: 60px;
        min-height: 36px;
        padding: 0 9px;
        font-size: 12px;
    }
}
/* STAGE 10D-1 LOGIN RESPONSIVE POLISH END */

