/* ==========================================================================
   ASISTENKU - AUTH PAGES (login, register, lupa kata sandi)
   Semua warna memakai variabel dari css/style.css agar light/dark aman.
   ========================================================================== */

html.auth-html {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    padding: 24px;
    background-image:
        radial-gradient(circle at 12% 10%, var(--accent-soft) 0%, transparent 45%),
        radial-gradient(circle at 88% 90%, rgba(139, 92, 246, 0.14) 0%, transparent 45%);
}

body.auth-page.is-theme-sweeping {
    overflow: hidden;
}

/* ============================ SHELL ============================ */
.auth-shell {
    width: 100%;
    max-width: 1060px;
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--glass-card);
    border: 1px solid var(--border-subtle);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    animation: authRiseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes authRiseIn {
    0%   { opacity: 0; transform: translateY(18px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authFadeUp {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes authModalPop {
    0%   { opacity: 0; transform: translateY(14px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

/* ============================ PANEL BRAND ============================ */
.auth-brand {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 42px 40px;
    color: #ffffff;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.24), transparent 48%),
        linear-gradient(150deg, #6966f5 0%, #8b5cf6 52%, #4c49c9 100%);
}

.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.auth-brand::before {
    width: 320px;
    height: 320px;
    right: -130px;
    top: -110px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 68%);
}

.auth-brand::after {
    width: 380px;
    height: 380px;
    left: -160px;
    bottom: -170px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.24), transparent 66%);
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.3px;
    font-size: 1.05rem;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
}

.brand-copy { max-width: 360px; }

.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    margin-bottom: 18px;
}

.brand-copy h1 {
    font-size: clamp(1.7rem, 2.6vw, 2.15rem);
    line-height: 1.18;
    letter-spacing: -1px;
    font-weight: 800;
    margin: 0 0 12px;
}

.brand-copy h1 span {
    background: linear-gradient(100deg, #ffffff, #d9fff2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-copy p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 26px;
}

.brand-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    margin: 0;
}

.brand-points li {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.93);
}

.brand-points li i {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.26);
}

.brand-foot {
    font-size: 0.76rem;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.62);
}

/* ============================ PANEL FORM ============================ */
.auth-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 46px 46px;
    background: var(--glass-card);
}

.auth-topbar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.theme-switch {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    transition: color 0.2s, transform 0.2s, background 0.2s;
}

.theme-switch:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.theme-switch .icon-sun { display: none; }
body.dark-mode .theme-switch .icon-moon { display: none; }
body.dark-mode .theme-switch .icon-sun { display: inline-flex; }

.auth-card {
    width: 100%;
    max-width: 392px;
    animation: authFadeUp 0.5s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-head {
    text-align: center;
    margin-bottom: 26px;
}

.auth-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    box-shadow: 0 10px 24px rgba(105, 102, 245, 0.34);
    animation: authFloat 5s ease-in-out infinite;
}

.auth-head h2 {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--text-main);
    margin: 0 0 7px;
}

.auth-head p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ============================ FIELD ============================ */
.field { margin-bottom: 16px; }

.field > label,
.label-row label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 7px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.label-row label { margin: 0; }

.link-accent {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.link-accent:hover { opacity: 0.75; text-decoration: underline; }

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap .field-icon {
    position: absolute;
    left: 16px;
    font-size: 13.5px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrap:focus-within .field-icon { color: var(--accent); }

.auth-input {
    width: 100%;
    padding: 14px 16px 14px 43px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input::placeholder { color: var(--text-muted); opacity: 0.8; }

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-wrap.has-eye .auth-input { padding-right: 46px; }

.input-wrap.has-otp-btn .auth-input { padding-right: 98px; }

.otp-request-btn {
    position: absolute;
    right: 6px;
    height: 32px;
    padding: 0 11px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(105, 102, 245, 0.35);
    transition: color 0.2s, background 0.2s, opacity 0.2s;
}

.otp-request-btn:hover:not(:disabled) {
    color: #ffffff;
    background: var(--accent);
    border-color: transparent;
}

.otp-request-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.eye-btn {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    transition: color 0.2s, background 0.2s;
}

.eye-btn:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ============================ BUTTONS ============================ */
.btn-auth {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 18px;
    margin-top: 6px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    box-shadow: 0 8px 20px rgba(105, 102, 245, 0.3);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(105, 102, 245, 0.4);
}

.btn-auth:active:not(:disabled) { transform: translateY(0); }

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-main);
    background: transparent;
    border: 1px solid var(--border-subtle);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-ghost:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-solid {
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    box-shadow: 0 6px 16px rgba(105, 102, 245, 0.28);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-solid:hover:not(:disabled) { transform: translateY(-1px); }
.btn-solid:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.btn-row .btn-solid:only-child { flex: 1; }

/* ============================ ALERT ============================ */
.alert-chip {
    display: none;
    align-items: flex-start;
    gap: 9px;
    margin-top: 16px;
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.45;
    border: 1px solid transparent;
    animation: authFadeUp 0.25s ease both;
}

.alert-chip.show { display: flex; }
.alert-chip i { margin-top: 2px; font-size: 12px; }

.alert-chip.is-error {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.24);
}

.alert-chip.is-success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.24);
}

.alert-chip.is-info {
    color: var(--info);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.24);
}

/* ============================ DIVIDER & LINKS ============================ */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin: 22px 0;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.google-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 44px;
}

.google-wrap > div { max-width: 100%; }

.google-fallback {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.auth-switch {
    margin: 22px 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

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

/* ============================ OTP ============================ */
.otp-panel {
    display: none;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 16px;
    background: var(--accent-soft);
    border: 1px dashed rgba(105, 102, 245, 0.4);
    animation: authFadeUp 0.3s ease both;
}

.otp-panel.show { display: block; }

.otp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.otp-panel-head label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
}

.otp-timer {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.otp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
}

.otp-slot {
    width: 100%;
    height: 50px;
    padding: 0;
    text-align: center;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    background: var(--glass-card);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.otp-slot:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    transform: translateY(-1px);
}

.otp-slot.is-filled { border-color: var(--accent); }

.otp-hint {
    display: block;
    margin-top: 9px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.otp-resend {
    margin-top: 10px;
    text-align: center;
}

.otp-resend button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
}

.otp-resend button:disabled { color: var(--text-muted); cursor: not-allowed; }

/* ============================ PASSWORD METER ============================ */
.pw-meter {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.pw-meter span {
    flex: 1;
    height: 4px;
    border-radius: 99px;
    background: var(--border-subtle);
    transition: background 0.25s;
}

.pw-meter.is-weak span:nth-child(1) { background: var(--danger); }
.pw-meter.is-medium span:nth-child(-n+2) { background: var(--warning); }
.pw-meter.is-strong span { background: var(--success); }

.pw-label {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ============================ MODAL ============================ */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(9, 12, 20, 0.62);
    backdrop-filter: blur(10px);
}

.auth-modal.open { display: flex; }

.auth-modal-card {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 26px;
    background: var(--glass-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--glass-shadow);
    animation: authModalPop 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.modal-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    box-shadow: 0 8px 18px rgba(105, 102, 245, 0.3);
}

.modal-head h3 {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-main);
    margin: 0 0 4px;
}

.modal-head p {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.modal-close {
    margin-left: auto;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }

/* Stepper */
.step-track {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    width: 46px;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.step-dot span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.66rem;
    font-weight: 800;
    color: var(--text-muted);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s;
}

.step-dot.is-active { color: var(--text-main); }
.step-dot.is-active span {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(105, 102, 245, 0.35);
}

.step-dot.is-done span {
    color: var(--success);
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.3);
}

.step-line {
    flex: 1;
    height: 2px;
    border-radius: 99px;
    background: var(--border-subtle);
    transition: background 0.25s;
}

.step-line.is-done { background: rgba(16, 185, 129, 0.45); }

.step-panel { display: none; }
.step-panel.is-active { display: block; animation: authFadeUp 0.28s ease both; }

.modal-footnote {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 460px;
        min-height: 0;
        border-radius: 28px;
    }

    .auth-brand { display: none; }
    .auth-panel { padding: 58px 30px 34px; }
}

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

    .auth-shell { border-radius: 24px; }
    .auth-panel { padding: 56px 20px 28px; }
    .auth-head h2 { font-size: 1.35rem; }
    .auth-input { padding: 13px 14px 13px 41px; font-size: 0.88rem; }
    .otp-grid { gap: 5px; }
    .otp-slot { height: 46px; font-size: 1rem; border-radius: 10px; }
    .auth-modal-card { padding: 20px; border-radius: 22px; }
}

@media (max-width: 360px) {
    .otp-grid { gap: 4px; }
    .otp-slot { height: 42px; font-size: 0.92rem; }
    .step-dot { width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell,
    .auth-card,
    .auth-icon,
    .alert-chip,
    .auth-modal-card,
    .step-panel {
        animation: none !important;
    }
}
