:root {
    --auth-navy: #16324F;
    --auth-blue: #2878B5;
    --auth-teal: #2A9D8F;
    --auth-gold: #F4B942;
    --auth-ink: #263238;
    --auth-muted: #627383;
    --auth-line: rgba(22, 50, 79, 0.13);
}

.auth-page,
.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    padding: 34px 20px;
    display: grid;
    place-items: center;
    color: var(--auth-ink);
    font-family: "Trebuchet MS", sans-serif;
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.84), rgba(220, 238, 248, 0.77)),
        url("images/surabaya.jpg") center / cover fixed no-repeat;
}

.global-back-wrap {
    width: min(100%, 1180px);
    margin: 0 auto 18px;
    display: flex;
    justify-content: flex-start;
}

.global-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(22, 50, 79, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--auth-navy);
    font: inherit;
    font-weight: 800;
    padding: 10px 16px;
    box-shadow: 0 8px 18px rgba(22, 50, 79, 0.12);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    cursor: pointer;
}

.global-back-button:hover {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 22px rgba(22, 50, 79, 0.16);
    transform: translateY(-1px);
}

.global-back-button:active {
    transform: translateY(0);
}

.global-back-button:disabled,
.global-back-button.is-disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.global-back-button-icon {
    display: inline-flex;
    transition: transform 180ms ease;
}

.global-back-button:hover .global-back-button-icon {
    transform: translateX(-2px);
}

.auth-shell {
    width: min(100%, 1080px);
    animation: auth-enter 420ms ease both;
}

.auth-brand {
    margin: 0;
    color: var(--auth-navy);
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.08;
    font-weight: 900;
}

.auth-brand span { color: var(--auth-teal); }

.auth-tagline {
    margin: 10px 0 0;
    color: #43596a;
    font-size: 1.05rem;
}

.auth-heading {
    margin-bottom: 28px;
    text-align: center;
}

.auth-heading .auth-brand { letter-spacing: 0.015em; }

.auth-role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.auth-role-card {
    --role-color: var(--auth-blue);
    min-width: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-top: 4px solid var(--role-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 12px 30px rgba(22, 50, 79, 0.12);
    backdrop-filter: blur(8px);
    transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

.auth-role-card--user { --role-color: var(--auth-blue); }
.auth-role-card--member { --role-color: var(--auth-teal); }
.auth-role-card--admin { --role-color: var(--auth-navy); }

.auth-role-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 36px rgba(22, 50, 79, 0.18);
}

.auth-role-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--role-color);
    border-radius: 14px;
    background: color-mix(in srgb, var(--role-color) 11%, white);
    transition: transform 240ms ease;
}

.auth-role-card:hover .auth-role-icon { transform: translateY(-2px) scale(1.04); }
.auth-role-icon svg { width: 25px; height: 25px; stroke: currentColor; }

.auth-role-card h2 {
    margin: 18px 0 7px;
    color: var(--auth-navy);
    font-size: 1.25rem;
}

.auth-role-card p {
    flex: 1;
    margin: 0 0 22px;
    color: var(--auth-muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

.auth-button {
    min-height: 44px;
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--role-color, var(--auth-blue));
    border-radius: 9px;
    background: var(--role-color, var(--auth-blue));
    color: white;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 200ms ease, filter 200ms ease, box-shadow 200ms ease;
}

.auth-button:hover { filter: brightness(1.06); box-shadow: 0 5px 14px rgba(22, 50, 79, 0.17); }
.auth-button:active { transform: translateY(1px); }
.auth-button:focus-visible, .auth-link:focus-visible, .password-toggle:focus-visible, .auth-input:focus-visible {
    outline: 3px solid rgba(244, 185, 66, 0.85);
    outline-offset: 3px;
}

.auth-role-card--user .auth-button { --role-color: var(--auth-blue); }
.auth-role-card--member .auth-button { --role-color: var(--auth-teal); }
.auth-role-card--admin .auth-button { --role-color: var(--auth-navy); }

.auth-footer-link {
    margin: 22px 0 0;
    text-align: center;
    color: #43596a;
}

.auth-link { color: #145e91; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.auth-form-shell {
    width: min(100%, 480px);
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-top: 4px solid var(--role-color, var(--auth-blue));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 44px rgba(22, 50, 79, 0.18);
    backdrop-filter: blur(8px);
}

.auth-form-shell--user { --role-color: var(--auth-blue); }
.auth-form-shell--member { --role-color: var(--auth-teal); }
.auth-form-shell--admin { --role-color: var(--auth-navy); }
.auth-form-shell h1 { margin: 0 0 6px; color: var(--auth-navy); font-size: 1.8rem; }
.auth-form-subtitle { margin: 0 0 22px; color: var(--auth-muted); }
.auth-page form,
.auth-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.auth-field { margin: 16px 0; }
.auth-field label { display: block; margin-bottom: 7px; color: var(--auth-navy); font-weight: 800; }
.auth-input {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #cbd8e1;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--auth-ink);
    font: inherit;
}
.auth-input:focus { border-color: var(--auth-blue); }
.auth-password-control {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.auth-password-control .auth-input { padding-right: 52px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #526979;
    cursor: pointer;
}
.password-toggle:hover { background: #edf4f7; color: var(--auth-navy); }
.password-toggle svg { width: 20px; height: 20px; stroke: currentColor; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: block; }

.auth-button--submit { width: 100%; margin-top: 8px; --role-color: var(--auth-blue); }
.auth-form-shell--member .auth-button--submit { --role-color: var(--auth-teal); }
.auth-form-shell--admin .auth-button--submit { --role-color: var(--auth-navy); }
.auth-alert { margin: 0 0 16px; padding: 11px 13px; border: 1px solid #efc3c3; border-radius: 8px; background: #fff2f1; color: #8a2924; }
.auth-alert--success { border-color: #b9e2c5; background: #effaf1; color: #25653a; }
.auth-errors { margin: 0 0 16px; padding-left: 20px; color: #8a2924; }
.auth-form-links { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: #526979; font-size: 0.92rem; }
.auth-back { margin-top: 16px; text-align: center; }

@keyframes auth-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
    .auth-page { padding: 24px 16px; background-attachment: scroll; }
    .auth-role-grid { grid-template-columns: 1fr; gap: 13px; max-width: 520px; margin: 0 auto; }
    .auth-heading { margin-bottom: 22px; }
    .auth-role-card { padding: 19px; display: grid; grid-template-columns: 48px 1fr; column-gap: 15px; }
    .auth-role-icon { grid-row: span 2; }
    .auth-role-card h2 { align-self: end; margin: 0 0 4px; }
    .auth-role-card p { grid-column: 2; margin: 0 0 14px; }
    .auth-role-card .auth-button { grid-column: 2; justify-self: start; }
    .auth-role-card > .auth-footer-link { grid-column: 2; margin: 12px 0 0; }
}

@media (max-width: 420px) {
    .auth-form-shell { padding: 24px 20px; }
    .auth-form-links { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
