:root {
    --auth-primary: var(--primary, #0b8a8f);
    --auth-primary-dark: var(--primary-dark, #08767b);
    --auth-primary-soft: #eef7f8;
    --auth-text: #083c4a;
    --auth-muted: #637982;
    --auth-border: var(--border, #e9ecef);
}

.auth-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    font-family: "Poppins", sans-serif;
    color: var(--auth-text);
    background: var(--body-bg, #f4f7fb);
}

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

.auth-brand-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: clamp(2.5rem, 5vw, 5rem);
    color: #fff;
    background: linear-gradient(145deg, #076a70 0%, #0b8a8f 55%, #0d999f 100%);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
}

.auth-brand-panel::before {
    right: -15rem;
    bottom: -19rem;
    width: 39rem;
    height: 39rem;
    box-shadow: 0 0 0 5rem rgba(255, 255, 255, .035), 0 0 0 10rem rgba(255, 255, 255, .025);
}

.auth-brand-panel::after {
    top: -11rem;
    left: -10rem;
    width: 25rem;
    height: 25rem;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 650px);
}

.auth-brand,
.auth-mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: .9rem;
    color: inherit;
}

.auth-brand-mark {
    display: inline-grid;
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    border-radius: 1rem;
    font-size: 1.45rem;
    color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 12px 30px rgba(8, 60, 74, .17);
}

.auth-brand strong,
.auth-mobile-brand strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.25;
}

.auth-brand small,
.auth-mobile-brand small {
    display: block;
    font-size: .82rem;
    opacity: .78;
}

.auth-brand-copy {
    margin: auto 0;
    padding: 5rem 0;
}

.auth-eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    padding: .45rem .8rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .08);
}

.auth-brand-copy h1 {
    max-width: 620px;
    margin-bottom: 1.25rem;
    font-size: clamp(2.1rem, 4.2vw, 3.8rem);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.035em;
}

.auth-brand-copy p {
    max-width: 560px;
    margin: 0;
    font-size: clamp(.95rem, 1.4vw, 1.08rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, .79);
}

.auth-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: .86rem;
    color: rgba(255, 255, 255, .84);
}

.auth-benefits span { display: inline-flex; align-items: center; gap: .5rem; }
.auth-benefits i { color: #b8f3f5; font-size: 1rem; }

.auth-form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: clamp(2rem, 5vw, 5rem);
    background: radial-gradient(circle at 90% 5%, #ddf1f2 0, transparent 28%), var(--body-bg, #f4f7fb);
}

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

.auth-card {
    width: min(100%, 460px);
    padding: clamp(1.5rem, 3.5vw, 2.6rem);
    border: 1px solid rgba(233, 236, 239, .9);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 24px 65px rgba(8, 60, 74, .11);
}

.auth-card-heading { margin-bottom: 1.8rem; }
.auth-card-icon {
    display: none;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: .9rem;
    font-size: 1.25rem;
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.auth-card-heading h2 {
    margin: 0 0 .55rem;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-card-heading p { margin: 0; color: var(--auth-muted); font-size: .9rem; line-height: 1.65; }
.auth-form .form-label { margin-bottom: .5rem; font-size: .84rem; font-weight: 600; color: #214f5a; }
.auth-input-group { flex-wrap: nowrap; }

.auth-input-group .input-group-text,
.auth-input-group .form-control,
.auth-password-toggle {
    min-height: 3.25rem;
    border-color: var(--auth-border);
    background: #fbfdfe;
}

.auth-input-group .input-group-text { padding-left: 1rem; border-right: 0; color: #71847c; }
.auth-input-group .form-control { border-left: 0; padding-left: .35rem; font-size: .9rem; box-shadow: none; }
.auth-input-group .form-control::placeholder { color: #a2afa9; }

.auth-input-group:focus-within .input-group-text,
.auth-input-group:focus-within .form-control,
.auth-input-group:focus-within .auth-password-toggle {
    border-color: #55b8bc;
    background: #fff;
}

.auth-input-group:focus-within {
    border-radius: .5rem;
    box-shadow: 0 0 0 .22rem rgba(11, 138, 143, .11);
}

.auth-password-toggle { border-left: 0; color: #71847c; }
.auth-password-toggle:hover,
.auth-password-toggle:focus { color: var(--auth-primary); background: #fff; }
.auth-field-error { margin-top: .4rem; font-size: .78rem; color: #c43d4b; }
.auth-forgot-link { font-size: .78rem; font-weight: 500; color: var(--auth-primary); text-decoration: none; }
.auth-forgot-link:hover { color: var(--auth-primary-dark); text-decoration: underline; }
.auth-reset-note {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: 1rem 0 1.5rem;
    padding: .8rem .9rem;
    border: 1px solid #dcecee;
    border-radius: .7rem;
    color: var(--auth-muted);
    background: var(--auth-primary-soft);
    font-size: .78rem;
    line-height: 1.55;
}
.auth-reset-note i { margin-top: .08rem; color: var(--auth-primary); font-size: .95rem; }
.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--auth-primary);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}
.auth-back-link:hover { color: var(--auth-primary-dark); text-decoration: underline; }
.auth-remember { margin: 1.15rem 0 1.5rem; }
.auth-remember .form-check-label { font-size: .82rem; color: var(--auth-muted); }
.auth-remember .form-check-input:checked { border-color: var(--auth-primary); background-color: var(--auth-primary); }
.auth-remember .form-check-input:focus { border-color: #55b8bc; box-shadow: 0 0 0 .2rem rgba(11, 138, 143, .12); }

.auth-submit-btn {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: #fff;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-border-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.25rem;
    gap: .75rem;
    border: 0;
    border-radius: .65rem;
    font-size: .9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    box-shadow: 0 12px 25px rgba(11, 138, 143, .2);
    transition: transform .2s ease, box-shadow .2s ease;
}

.auth-submit-btn:hover,
.auth-submit-btn:focus,
.auth-submit-btn:focus-visible,
.auth-submit-btn:active,
.auth-submit-btn:disabled,
.auth-submit-btn.disabled {
    color: #fff !important;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark)) !important;
    border-color: transparent !important;
}

.auth-submit-btn:hover,
.auth-submit-btn:focus,
.auth-submit-btn:focus-visible,
.auth-submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 15px 30px rgba(11, 138, 143, .27);
}

.auth-submit-btn:disabled,
.auth-submit-btn.disabled {
    opacity: .78;
    cursor: wait;
    transform: none;
    box-shadow: 0 8px 18px rgba(11, 138, 143, .18);
}

.auth-submit-btn .spinner-border { color: #fff; }

.auth-submit-btn i { transition: transform .2s ease; }
.auth-submit-btn:hover i { transform: translateX(3px); }
.auth-copyright { margin: 1.5rem 0 0; font-size: .75rem; color: #87958f; text-align: center; }
.auth-card .alert { padding: .8rem .95rem; border: 0; border-radius: .7rem; font-size: .8rem; }

@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: minmax(320px, .8fr) minmax(430px, 1.2fr); }
    .auth-brand-panel { padding: 2.5rem; }
    .auth-brand-copy h1 { font-size: 2.35rem; }
    .auth-form-panel { padding: 2.5rem; }
}

@media (max-width: 767.98px) {
    .auth-page { min-width: 0; overflow-x: hidden; }
    .auth-shell { display: block; min-height: 100svh; min-height: 100dvh; }
    .auth-brand-panel { display: none; }
    .auth-form-panel {
        min-height: 100svh;
        min-height: 100dvh;
        justify-content: flex-start;
        padding: 1.25rem;
        background: linear-gradient(180deg, #e1f2f3 0, var(--body-bg, #f4f7fb) 42%);
    }
    .auth-mobile-brand { display: inline-flex; align-self: flex-start; margin: .3rem 0 1.5rem; color: var(--auth-primary-dark); }
    .auth-mobile-brand .auth-brand-mark { width: 2.8rem; height: 2.8rem; border-radius: .8rem; color: #fff; background: var(--auth-primary); }
    .auth-card { margin: auto 0; border-radius: 1.1rem; box-shadow: 0 18px 45px rgba(8, 60, 74, .1); }
    .auth-card-icon { display: grid; }
    .auth-copyright { margin-top: 1.25rem; }

    /* Mencegah browser mobile memperbesar halaman ketika input difokuskan. */
    .auth-input-group .form-control,
    .auth-input-group .input-group-text,
    .auth-password-toggle {
        font-size: 1rem;
    }
}

@media (max-width: 399.98px) {
    .auth-form-panel { padding: 1rem; }
    .auth-card { padding: 1.35rem; }
    .auth-card-heading h2 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit-btn,
    .auth-submit-btn i { transition: none; }
}


/* Presensi: loading submit tanpa mengubah geometri tombol Koperasi. */
.auth-submit-btn:disabled { cursor: wait; opacity: .88; transform: none; }
.auth-submit-label[hidden] { display: none; }
.auth-submit-spinner { display: none; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.38); border-top-color: #fff; border-radius: 50%; }
.auth-submit-btn.is-loading .auth-submit-spinner { display: block; animation: auth-login-spin .7s linear infinite; }
@keyframes auth-login-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-submit-spinner { animation-duration: 1.5s; } }

