/* Dewan Jamu authentication pages */

:root {
    --auth-navy: #102c3e;
    --auth-navy-strong: #0b2231;
    --auth-accent: #167887;
    --auth-accent-hover: #116470;
    --auth-accent-soft: #e8f4f5;
    --auth-bg: #edf2f4;
    --auth-surface: #ffffff;
    --auth-surface-soft: #f6f8f9;
    --auth-border: #d8e1e5;
    --auth-border-strong: #b9c8cf;
    --auth-text: #132c3d;
    --auth-muted: #667b88;
    --auth-danger: #c9363e;
    --auth-danger-soft: #fff1f2;
    --auth-success: #157347;
    --auth-success-soft: #edf8f2;
    --auth-warning: #a45d0a;
    --auth-warning-soft: #fff7e8;
    --auth-shadow: 0 22px 60px rgba(20, 45, 60, 0.13);
    --auth-radius: 8px;
}

body.auth-page,
body.auth-register-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    padding: clamp(18px, 4vw, 48px);
    color: var(--auth-text);
    background: var(--auth-bg);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

body.auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
}

body.auth-register-page {
    display: block;
}

body.auth-page::before,
body.auth-page::after,
body.auth-register-page::before,
body.auth-register-page::after {
    content: none !important;
}

body.auth-page *,
body.auth-page *::before,
body.auth-page *::after,
body.auth-register-page *,
body.auth-register-page *::before,
body.auth-register-page *::after {
    box-sizing: border-box;
    letter-spacing: 0;
}

.auth-shell,
body.auth-page .login-container,
body.auth-page .login-wrapper,
body.auth-page .forgot-wrapper {
    width: 100%;
    max-width: 980px;
    min-height: 590px;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(300px, 0.86fr) minmax(420px, 1.14fr);
    position: relative;
    justify-self: center;
    z-index: 1;
    overflow: hidden;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
}

.auth-brand-panel {
    min-width: 0;
    padding: 42px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 42px;
    color: #ffffff;
    background: var(--auth-navy);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-logo {
    width: 210px;
    height: 82px;
    padding: 10px 14px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--auth-radius);
}

.auth-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-brand-copy {
    display: grid;
    gap: 12px;
}

.auth-eyebrow,
.auth-form-kicker {
    display: block;
    color: #77ced5;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
}

.auth-brand-copy h2 {
    max-width: 320px;
    margin: 0;
    color: #ffffff;
    font-size: 29px;
    font-weight: 700;
    line-height: 1.2;
}

.auth-brand-copy p {
    max-width: 310px;
    margin: 0;
    color: #bdd0d9;
    font-size: 14px;
    line-height: 1.7;
}

.auth-brand-meta {
    padding-top: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #adc4ce;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    font-weight: 600;
}

.auth-brand-meta i {
    color: #77ced5;
    font-size: 15px;
}

body.auth-page .login-card,
body.auth-page .forgot-card {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: visible;
    background: var(--auth-surface);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

body.auth-page .login-card:hover,
body.auth-page .forgot-card:hover {
    box-shadow: none;
    transform: none;
}

body.auth-page .login-header,
body.auth-page .forgot-header {
    padding: 46px 46px 18px;
    text-align: left;
    background: transparent;
    border: 0;
}

body.auth-page .login-header::before,
body.auth-page .login-header::after,
body.auth-page .forgot-header::before,
body.auth-page .forgot-header::after {
    content: none;
}

body.auth-page .shield-icon,
body.auth-page .logo-icon,
body.auth-page .forgot-icon {
    width: 46px;
    height: 46px;
    margin: 0 0 18px;
    display: grid;
    place-items: center;
    color: var(--auth-accent);
    background: var(--auth-accent-soft);
    border: 1px solid #c9e5e8;
    border-radius: var(--auth-radius);
    box-shadow: none;
    transform: none;
}

body.auth-page .shield-icon:hover,
body.auth-page .logo-icon:hover,
body.auth-page .forgot-icon:hover {
    transform: none;
}

body.auth-page .shield-icon i,
body.auth-page .logo-icon i,
body.auth-page .forgot-icon i {
    color: inherit;
    font-size: 21px;
}

body.auth-page .login-header h1,
body.auth-page .forgot-header h1 {
    margin: 6px 0 7px;
    color: var(--auth-text);
    font-size: 27px;
    font-weight: 700;
    line-height: 1.25;
}

body.auth-page .login-header p,
body.auth-page .forgot-header p {
    max-width: 430px;
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.65;
}

body.auth-page .login-body,
body.auth-page .forgot-body {
    padding: 12px 46px 46px;
}

body.auth-page .form-group {
    margin-bottom: 19px;
}

body.auth-page .form-label,
body.auth-register-page .form-group > label {
    margin-bottom: 7px;
    display: block;
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 650;
}

body.auth-page .form-label i {
    margin-right: 5px;
    color: var(--auth-muted);
}

body.auth-page .input-group {
    width: 100%;
    display: flex;
    position: relative;
    flex-wrap: nowrap;
}

body.auth-page .input-icon {
    left: 15px;
    top: 50%;
    z-index: 4;
    color: var(--auth-muted) !important;
    transform: translateY(-50%);
}

body.auth-page .input-group:focus-within .input-icon {
    color: var(--auth-accent) !important;
}

body.auth-page .form-control,
body.auth-register-page .form-control {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--auth-text);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border-strong);
    border-radius: var(--auth-radius) !important;
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

body.auth-page .input-group .input-icon + .form-control {
    padding-left: 43px;
}

body.auth-page .input-group .form-control,
body.auth-page .input-group > .form-control:not(:last-child) {
    border-radius: var(--auth-radius) !important;
}

body.auth-page .form-control::placeholder,
body.auth-register-page .form-control::placeholder {
    color: #93a2aa;
    opacity: 1;
}

body.auth-page .form-control:focus,
body.auth-register-page .form-control:focus {
    color: var(--auth-text);
    background: #ffffff;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(22, 120, 135, 0.12);
    outline: 0;
}

body.auth-page .password-toggle,
body.auth-page #togglePassword.btn-outline-secondary {
    width: 46px;
    min-height: 46px;
    margin: 1px;
    padding: 0;
    display: grid;
    place-items: center;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    color: var(--auth-muted);
    background: transparent;
    border: 0;
    border-radius: 7px !important;
}

body.auth-page .password-toggle:hover,
body.auth-page #togglePassword.btn-outline-secondary:hover {
    color: var(--auth-accent);
    background: var(--auth-accent-soft);
}

body.auth-page .input-group:has(.password-toggle) .form-control,
body.auth-page .input-group:has(#togglePassword) .form-control {
    padding-right: 50px;
}

body.auth-page .btn-login,
body.auth-page .btn-submit,
body.auth-register-page .btn-primary {
    width: 100%;
    min-height: 48px;
    padding: 11px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ffffff;
    background: var(--auth-accent);
    border: 1px solid var(--auth-accent);
    border-radius: var(--auth-radius);
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

body.auth-page .btn-login:hover,
body.auth-page .btn-submit:hover,
body.auth-register-page .btn-primary:hover {
    color: #ffffff;
    background: var(--auth-accent-hover);
    border-color: var(--auth-accent-hover);
    box-shadow: none;
    transform: none;
}

body.auth-page .btn-login:active,
body.auth-page .btn-submit:active,
body.auth-register-page .btn-primary:active {
    transform: translateY(1px);
}

body.auth-page .alert,
body.auth-register-page .alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--auth-danger);
    background: var(--auth-danger-soft);
    border: 1px solid #f2c6c9;
    border-radius: var(--auth-radius);
    font-size: 13px;
    line-height: 1.5;
}

body.auth-page .alert-success,
body.auth-register-page .alert-success {
    color: var(--auth-success);
    background: var(--auth-success-soft);
    border-color: #bfe2ce;
}

body.auth-page .alert-info {
    color: var(--auth-accent-hover);
    background: var(--auth-accent-soft);
    border-color: #c9e5e8;
}

body.auth-page .info-box {
    margin: 0 0 20px;
    padding: 12px 14px;
    color: var(--auth-muted);
    background: var(--auth-surface-soft);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    font-size: 13px;
}

body.auth-page .info-box p {
    margin: 0;
    color: inherit;
}

body.auth-page .info-box i {
    margin-right: 7px;
    color: var(--auth-accent);
}

body.auth-page .branch-badge {
    width: fit-content;
    margin: 13px 0 0;
    padding: 6px 9px;
    color: var(--auth-accent-hover);
    background: var(--auth-accent-soft);
    border: 1px solid #c9e5e8;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

body.auth-page .back-link,
body.auth-page .forgot-password-link,
body.auth-page .link-section {
    margin: 18px 0 0;
    padding: 0;
    text-align: center;
    background: transparent;
    border: 0;
}

body.auth-page .link-section {
    padding-top: 17px;
    border-top: 1px solid var(--auth-border);
}

body.auth-page .link-section p {
    margin: 0 0 6px;
    color: var(--auth-muted);
    font-size: 12px;
}

body.auth-page .back-link a,
body.auth-page .forgot-password-link a,
body.auth-page .link-section a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-accent-hover) !important;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

body.auth-page .back-link a:hover,
body.auth-page .forgot-password-link a:hover,
body.auth-page .link-section a:hover {
    color: var(--auth-accent) !important;
}

/* Registration */
body.auth-register-page .register-wrapper {
    width: min(100%, 1120px);
    max-width: 1120px;
    margin: 0 auto;
}

body.auth-register-page .register-container {
    overflow: hidden;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    backdrop-filter: none;
}

.register-topbar {
    min-height: 50px;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: var(--auth-surface-soft);
    border-bottom: 1px solid var(--auth-border);
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.auth-back-link:hover {
    color: var(--auth-accent);
}

body.auth-register-page .register-header {
    padding: 30px 38px 28px;
    display: grid;
    justify-items: center;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid var(--auth-border);
}

body.auth-register-page .register-header::after {
    content: none;
}

body.auth-register-page .register-logo {
    width: 210px;
    height: 78px;
    margin: 0 0 15px;
    padding: 7px 10px;
    display: grid;
    place-items: center;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    transform: none;
}

body.auth-register-page .register-logo:hover {
    transform: none;
}

body.auth-register-page .register-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.auth-register-page .register-header h1 {
    margin: 5px 0 6px;
    color: var(--auth-text);
    font-size: 27px;
    font-weight: 700;
    line-height: 1.3;
}

.register-subtitle {
    max-width: 620px;
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
}

body.auth-register-page .register-body {
    padding: 34px 38px 38px;
}

.register-section-heading {
    margin: 4px 0 20px;
    padding-top: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--auth-border);
}

.register-section-heading:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.register-section-icon {
    width: 40px;
    height: 40px;
    display: grid;
    flex: 0 0 40px;
    place-items: center;
    color: var(--auth-accent);
    background: var(--auth-accent-soft);
    border: 1px solid #c9e5e8;
    border-radius: var(--auth-radius);
    font-size: 16px;
}

.register-section-heading h2 {
    margin: 0 0 2px;
    color: var(--auth-text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.register-section-heading p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 12px;
}

body.auth-register-page .form-divider {
    display: none;
}

body.auth-register-page .form-grid {
    margin: 0 !important;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

body.auth-register-page .form-group {
    min-width: 0;
    margin: 0;
}

body.auth-register-page .form-group.full-width {
    grid-column: 1 / -1;
}

body.auth-register-page textarea.form-control {
    min-height: 105px;
    resize: vertical;
}

body.auth-register-page select.form-control {
    cursor: pointer;
}

body.auth-register-page select.form-control:disabled {
    color: #8d9aa1;
    background: #f1f4f5;
    cursor: not-allowed;
}

body.auth-register-page .checkbox-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

body.auth-register-page .checkbox-item {
    min-height: 44px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--auth-surface-soft);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
}

body.auth-register-page .checkbox-item label {
    margin: 0;
    color: var(--auth-text);
    font-size: 13px;
    cursor: pointer;
}

body.auth-register-page .checkbox-item input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-accent);
}

body.auth-register-page .password-strength {
    height: 4px;
    margin-top: 8px;
    overflow: hidden;
    background: #e5ebee;
    border-radius: 4px;
}

body.auth-register-page .password-requirements {
    margin: 9px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    list-style: none;
}

body.auth-register-page .password-requirements li {
    color: var(--auth-muted);
    font-size: 11px;
}

body.auth-register-page .password-requirements li.valid {
    color: var(--auth-success);
}

body.auth-register-page .password-requirements li.invalid {
    color: var(--auth-danger);
}

.captcha-section {
    margin-top: 0;
}

.captcha-row {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.captcha-row img {
    width: 210px;
    height: 70px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid var(--auth-border-strong) !important;
    border-radius: var(--auth-radius) !important;
    cursor: pointer;
}

body.auth-register-page .captcha-refresh-btn {
    min-height: 42px;
    padding: 9px 13px !important;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--auth-accent-hover) !important;
    background: var(--auth-accent-soft) !important;
    border: 1px solid #c9e5e8 !important;
    border-radius: var(--auth-radius) !important;
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.captcha-help {
    margin-top: 6px;
    display: block;
    color: var(--auth-muted);
    font-size: 12px;
}

.register-submit {
    margin-top: 28px;
}

body.auth-register-page .login-link {
    margin-top: 24px;
    padding-top: 20px;
    color: var(--auth-muted);
    border-top: 1px solid var(--auth-border);
    font-size: 13px;
    text-align: center;
}

body.auth-register-page .login-link a {
    color: var(--auth-accent-hover);
    font-weight: 700;
    text-decoration: none;
}

body.auth-register-page .error-message {
    margin-top: 5px;
    color: var(--auth-danger);
    font-size: 11px;
}

@media (max-width: 820px) {
    body.auth-page {
        align-items: start;
    }

    .auth-shell,
    body.auth-page .login-container,
    body.auth-page .login-wrapper,
    body.auth-page .forgot-wrapper {
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-content: start;
    }

    .auth-brand-panel {
        min-height: 0;
        padding: 24px 28px;
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        align-self: start;
        justify-content: start;
        gap: 20px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .auth-brand-logo {
        width: 150px;
        height: 64px;
    }

    .auth-brand-copy {
        gap: 4px;
    }

    .auth-brand-copy h2 {
        font-size: 20px;
    }

    .auth-brand-copy p,
    .auth-brand-meta,
    .auth-eyebrow {
        display: none;
    }

    body.auth-page .login-header,
    body.auth-page .forgot-header {
        padding: 32px 34px 16px;
    }

    body.auth-page .login-body,
    body.auth-page .forgot-body {
        padding: 10px 34px 36px;
    }

    body.auth-register-page .checkbox-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.auth-register-page {
        padding: 12px;
    }

    .register-topbar {
        padding: 9px 16px;
    }

    body.auth-register-page .register-header {
        padding: 24px 20px 22px;
    }

    body.auth-register-page .register-header h1 {
        font-size: 22px;
    }

    body.auth-register-page .register-body {
        padding: 25px 20px 28px;
    }

    body.auth-register-page .form-grid,
    body.auth-register-page .password-requirements {
        grid-template-columns: 1fr;
    }

    body.auth-register-page .form-group.full-width {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    body.auth-page {
        padding: 0;
        background: var(--auth-surface);
    }

    .auth-shell,
    body.auth-page .login-container,
    body.auth-page .login-wrapper,
    body.auth-page .forgot-wrapper {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand-panel {
        padding: 18px 20px;
        grid-template-columns: 118px 1fr;
        gap: 14px;
    }

    .auth-brand-logo {
        width: 118px;
        height: 52px;
        padding: 6px 8px;
    }

    .auth-brand-copy h2 {
        font-size: 17px;
    }

    body.auth-page .login-header,
    body.auth-page .forgot-header {
        padding: 28px 20px 14px;
    }

    body.auth-page .login-body,
    body.auth-page .forgot-body {
        padding: 9px 20px 30px;
    }

    body.auth-page .login-header h1,
    body.auth-page .forgot-header h1 {
        font-size: 23px;
    }

    body.auth-register-page .checkbox-group {
        grid-template-columns: 1fr;
    }

    .captcha-row img {
        width: 100%;
    }

    body.auth-register-page .captcha-refresh-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.auth-page *,
    body.auth-register-page * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
