/* ==========================================================================
   Auth screens (login / register)
   Hand-written CSS: no Tailwind rebuild required.
   ========================================================================== */

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/assets/fonts/plus-jakarta-sans.woff2') format('woff2');
}

:root {
    --auth-blue-50: #eff6ff;
    --auth-blue-200: #bfdbfe;
    --auth-blue-300: #93c5fd;
    --auth-blue-500: #3b82f6;
    --auth-blue-600: #2563eb;
    --auth-blue-700: #1d4ed8;
    --auth-ink: #0f172a;
    --auth-body: #475569;
    --auth-muted: #64748b;
    --auth-faint: #64748b;
    --auth-line: #e2e8f0;
    --auth-line-strong: #cbd5e1;
    --auth-radius: 14px;
}

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

html { -webkit-text-size-adjust: 100%; }

.auth-body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--auth-ink);
    background: linear-gradient(180deg, #f5f7fb 0%, #e9eef7 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-body a { color: inherit; }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    width: 100%;
    max-width: 1180px;
    min-height: min(790px, calc(100dvh - 56px));
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 30px 70px -40px rgba(15, 23, 42, .3),
        0 2px 6px rgba(15, 23, 42, .04);
}

/* ---------------------------------------------------------------- Brand panel */

.auth-brand {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    padding: 46px 46px 40px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(165deg, #12295f 0%, #0d2350 55%, #0a1a3e 100%);
}

/* Garis kertas: satu motif, sewarna, tanpa animasi. */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: repeating-linear-gradient(180deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 36px);
    -webkit-mask-image: linear-gradient(200deg, transparent 30%, #000 88%);
    mask-image: linear-gradient(200deg, transparent 30%, #000 88%);
    opacity: .32;
    pointer-events: none;
}

.auth-brand-paper {
    position: absolute;
    right: -46px;
    bottom: -54px;
    z-index: 0;
    width: min(320px, 42%);
    color: #fff;
    opacity: .09;
    pointer-events: none;
}

.auth-brand-top,
.auth-brand-copy,
.auth-brand-foot { position: relative; z-index: 1; }

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    width: fit-content;
}

.auth-logo-img {
    display: block;
    height: 36px;
    width: auto;
    flex: 0 0 auto;
}

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

.auth-brand-copy { margin-top: 54px; animation: auth-rise .7s ease-out both; }
.auth-panel-inner { animation: auth-rise .6s ease-out both; }

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #a8c7ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    line-height: 1;
}

.auth-eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: #6ea8ff;
    flex: 0 0 auto;
}

.auth-brand-title {
    margin: 24px 0 0;
    font-size: clamp(32px, 2.7vw, 44px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.035em;
    color: #fff;
    max-width: 15ch;
}

.auth-brand-title em {
    position: relative;
    font-style: normal;
    color: #a8cbff;
    white-space: nowrap;
}

.auth-brand-title em::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.08em;
    height: 2px;
    border-radius: 2px;
    background: #60a5fa;
}

.auth-brand-sub {
    margin: 16px 0 0;
    max-width: 36ch;
    font-size: 14.5px;
    line-height: 1.65;
    color: rgba(214, 232, 255, .82);
}

.auth-points {
    list-style: none;
    margin: 38px 0 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.auth-point {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.auth-point-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #a7ccff;
}

.auth-point-icon svg { width: 17px; height: 17px; display: block; }

.auth-point-title {
    margin: 1px 0 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #f1f6ff;
    letter-spacing: -.01em;
}

.auth-point-sub {
    margin: 3px 0 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(191, 219, 254, .62);
}

.auth-brand-foot {
    margin-top: auto;
    padding-top: 26px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(191, 219, 254, .68);
}

.auth-brand-foot svg { width: 15px; height: 15px; color: #7dd3fc; flex: 0 0 auto; }

/* ----------------------------------------------------------------- Form panel */

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px clamp(30px, 4.4vw, 62px) 30px;
    background: #fff;
}

.auth-panel-inner {
    width: 100%;
    max-width: 382px;
    margin: 0 auto;
}

.auth-mobile-top { display: none; }

.auth-head { margin: 0 0 24px; }

.auth-title {
    margin: 0;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.035em;
    color: var(--auth-ink);
}

.auth-sub {
    margin: 9px 0 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--auth-muted);
}

/* Alerts */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid #fecdd3;
    border-radius: 12px;
    background: #fff5f6;
    color: #be123c;
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }

/* Fields */

.auth-form { display: block; }

.auth-field { margin-bottom: 16px; }

.auth-field:last-of-type { margin-bottom: 0; }

.auth-label {
    display: block;
    margin: 0 0 7px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: -.005em;
    color: #334155;
}

.auth-optional {
    font-weight: 500;
    color: var(--auth-faint);
}

.auth-control { position: relative; display: block; }

.auth-input {
    display: block;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 14px 0 42px;
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: #fbfcfe;
    color: var(--auth-ink);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 50px;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input::placeholder { color: #64748b; }

.auth-input:hover { border-color: var(--auth-line-strong); }

.auth-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-blue-600);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-ink);
    -webkit-box-shadow: inset 0 0 0 100px #fff;
    caret-color: var(--auth-ink);
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--auth-faint);
    pointer-events: none;
    transition: color .16s ease;
}

.auth-control:focus-within .auth-input-icon { color: var(--auth-blue-600); }

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

.auth-reveal {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--auth-faint);
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease;
}

.auth-reveal:hover { color: #475569; background: #f1f5f9; }

.auth-reveal:focus-visible {
    outline: 2px solid var(--auth-blue-600);
    outline-offset: 1px;
}

.auth-reveal svg { width: 18px; height: 18px; display: block; }

.auth-reveal .icon-on { display: none; }

.auth-reveal[aria-pressed="true"] .icon-off { display: none; }

.auth-reveal[aria-pressed="true"] .icon-on { display: block; }

.auth-hint {
    margin: 6px 0 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--auth-muted);
}

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-row .auth-field { margin-bottom: 16px; }

.auth-turnstile {
    display: flex;
    justify-content: center;
    margin: 4px 0 2px;
}

.auth-turnstile .cf-turnstile { width: 100%; }

/* Buttons */

.auth-submit,
.auth-google {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 48px;
    padding: 0 18px;
    border-radius: var(--auth-radius);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -.005em;
    text-decoration: none;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}

.auth-submit {
    margin-top: 20px;
    border: 1px solid #1d4ed8;
    color: #fff;
    background: linear-gradient(180deg, #2f6df0 0%, #1d4ed8 100%);
    box-shadow:
        0 10px 24px -12px rgba(37, 99, 235, .85),
        inset 0 1px 0 rgba(255, 255, 255, .22);
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 30px -14px rgba(37, 99, 235, .9),
        inset 0 1px 0 rgba(255, 255, 255, .24);
}

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

.auth-submit:focus-visible,
.auth-google:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

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

.auth-submit-label { display: inline-flex; align-items: center; gap: 8px; }

.auth-submit-label svg { width: 16px; height: 16px; transition: transform .16s ease; }

.auth-submit:hover .auth-submit-label svg { transform: translateX(2px); }

.auth-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .6s linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-submit[data-loading="1"] .auth-submit-label { display: none; }

.auth-submit[data-loading="1"] .auth-spinner { display: block; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #edf1f7;
}

.auth-google {
    border: 1px solid var(--auth-line);
    background: #fff;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.auth-google:hover {
    background: #f8fafc;
    border-color: var(--auth-line-strong);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -12px rgba(15, 23, 42, .4);
}

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

.auth-google svg { width: 18px; height: 18px; flex: 0 0 auto; }

.auth-switch {
    margin: 24px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--auth-muted);
    text-align: center;
}

.auth-switch a {
    color: var(--auth-blue-700);
    font-weight: 700;
    text-decoration: none;
    text-underline-offset: 3px;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-legal {
    margin: 26px 0 0;
    font-size: 11px;
    line-height: 1.7;
    color: var(--auth-muted);
    text-align: center;
}

.auth-legal a {
    color: #475569;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-legal a:hover { color: var(--auth-blue-700); }

/* -------------------------------------------------------------- Admin variant */

.auth-brand--admin { background: #0a1224; }



.auth-logo-badge {
    margin-left: 2px;
    color: #cbd5e1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    line-height: 1;
}

.auth-brand--admin .auth-eyebrow { color: #a9dcf8; }

.auth-brand--admin .auth-brand-title em { color: #a5f3fc; }

.auth-brand--admin .auth-brand-sub { color: rgba(203, 225, 248, .72); }

.auth-brand--admin .auth-point-icon {
    color: #9ad9ff;
    background: rgba(125, 211, 252, .08);
    border-color: rgba(125, 211, 252, .16);
}

.auth-brand--admin .auth-brand-foot { color: rgba(186, 216, 245, .7); }

.auth-brand--admin .auth-brand-foot svg { color: #fbbf24; }

/* Step rail */

.auth-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
}

.auth-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: -.005em;
    color: #64748b;
}

.auth-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 1px solid var(--auth-line);
    background: #f8fafc;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
}

.auth-step.is-active { color: var(--auth-blue-700); }

.auth-step.is-active .auth-step-num {
    border-color: var(--auth-blue-600);
    background: var(--auth-blue-600);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.auth-step.is-done .auth-step-num {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #15803d;
}

.auth-step-line {
    flex: 1;
    height: 1px;
    min-width: 12px;
    background: var(--auth-line);
}

/* Info notice */

.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.5;
}

.auth-notice svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }

/* Signed-in-as chip */

.auth-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 0 0 18px;
    padding: 6px 12px 6px 7px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    background: #f8fafc;
    font-size: 12.5px;
    color: var(--auth-muted);
}

.auth-user-chip strong {
    color: #334155;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-user-chip-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(150deg, #2f6df0, #1d4ed8);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
}

/* One-time-code input */

.auth-input--otp {
    height: 56px;
    padding: 0 14px;
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .42em;
    text-indent: .42em;
    font-variant-numeric: tabular-nums;
    background: #fff;
}

.auth-input--otp::placeholder {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .02em;
    text-indent: 0;
    color: #a8b3c4;
}

/* Quiet back link */

.auth-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 9px;
    border-radius: 10px;
    color: var(--auth-muted);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease;
}

.auth-back:hover { background: #f8fafc; color: #334155; }

.auth-back:focus-visible {
    outline: 2px solid var(--auth-blue-600);
    outline-offset: 2px;
}

.auth-back svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 1120px) {
    .auth-brand { padding: 38px 34px 34px; }
    .auth-brand-title { max-width: 16ch; }
    .auth-panel { padding: 38px 34px 28px; }
}

@media (prefers-reduced-motion: no-preference) {
    .auth-brand-copy {
        animation: auth-rise .62s cubic-bezier(.22, 1, .36, 1) .04s both;
    }

    .auth-panel-inner {
        animation: auth-rise .55s cubic-bezier(.22, 1, .36, 1) both;
    }

    .auth-brand-top,
    .auth-brand-foot {
        animation: auth-fade .7s ease both;
    }
}

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

@keyframes auth-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 900px) {
    .auth-body {
        display: block;
        padding: 0;
        background: #fff;
    }

    .auth-shell {
        display: block;
        min-height: 100dvh;
        max-width: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand { display: none; }

    .auth-panel {
        min-height: 100dvh;
        justify-content: flex-start;
        padding: 22px 22px 34px;
        overflow: visible;
    }

    .auth-panel-inner { max-width: 420px; }

    .auth-mobile-top {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        max-width: 420px;
        margin: 0 auto 30px;
        padding-bottom: 20px;
        border-bottom: 1px solid #f1f5f9;
        width: 100%;
    }

    .auth-mobile-top .auth-logo-img {
        height: 28px;
        width: auto;
    }

    .auth-head { margin-bottom: 22px; }

    .auth-title { font-size: 24px; }

    .auth-sub { font-size: 13px; }

    .auth-legal { margin-top: 22px; }

    .auth-steps { margin-bottom: 18px; }

    .auth-mobile-top .auth-logo-badge {
        color: #64748b;
        border-color: #e2e8f0;
        background: #f8fafc;
    }
}

@media (max-width: 420px) {
    .auth-row { grid-template-columns: 1fr; gap: 0; }

    .auth-panel { padding: 18px 18px 30px; }

    .auth-input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit,
    .auth-google,
    .auth-submit-label svg { transition: none; }
}
