/* ==================================================================
   Halaman autentikasi berdiri sendiri - tema UI/UX
   Dipakai oleh: login_mfa_uiux, login_otp_challenge_uiux,
   users/forgot_password/reset_uiux (reset password dari link email),
   layouts/partials/uiux_auth_password (reset password 2 bulanan,
   internal & vendor). Dimuat hanya saat application_theme = 'uiux'.
   Internal = teal (default), vendor = hijau (body.ua-vendor).
   ================================================================== */
:root {
    --ua-accent: #14b8a6;
    --ua-accent-dark: #0f766e;
    --ua-soft: #f0fdfa;
    --ua-ring: rgba(20, 184, 166, .22);
    --ua-overlay: linear-gradient(135deg, rgba(8, 47, 42, .88) 0%, rgba(15, 118, 110, .72) 55%, rgba(20, 184, 166, .55) 100%);
}
body.ua-vendor {
    --ua-accent: #16a34a;
    --ua-accent-dark: #15803d;
    --ua-soft: #f0fdf4;
    --ua-ring: rgba(22, 163, 74, .22);
    --ua-overlay: linear-gradient(135deg, rgba(20, 50, 15, .88) 0%, rgba(77, 138, 42, .72) 55%, rgba(140, 193, 82, .55) 100%);
}

html, body { min-height: 100%; }
body.ua-body {
    margin: 0;
    background: #0f3d36;
    color: #334155;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.ua-body.ua-vendor { background: #1b5e20; }

/* Latar */
.ua-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-position: center;
    background-size: cover;
}
.ua-bg:after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--ua-overlay);
}

/* Wadah */
.ua-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
}
.ua-card {
    width: 100%;
    max-width: 440px;
    padding: 32px 32px 26px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 60px rgba(2, 20, 18, .35);
    animation: ua-rise .45s ease both;
}
.ua-card.ua-card-wide { max-width: 500px; }
@keyframes ua-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

/* Brand */
.ua-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef2f5;
}
.ua-brand img { width: 38px; height: 38px; object-fit: contain; }
.ua-brand span { color: #0f172a; font-size: 14px; font-weight: 700; line-height: 1.25; }

/* Langkah login */
.ua-steps {
    display: flex;
    align-items: center;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}
.ua-steps li {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.ua-steps li + li:before {
    content: "";
    flex: 1 1 auto;
    min-width: 10px;
    height: 2px;
    margin-right: 4px;
    border-radius: 2px;
    background: #e2e8f0;
}
.ua-steps .ua-step-dot {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 11px;
    line-height: 24px;
    text-align: center;
}
.ua-steps li.is-done { color: var(--ua-accent-dark); }
.ua-steps li.is-done .ua-step-dot { background: var(--ua-soft); color: var(--ua-accent-dark); }
.ua-steps li.is-done + li:before,
.ua-steps li.is-active:before { background: var(--ua-accent); }
.ua-steps li.is-active { color: #0f172a; }
.ua-steps li.is-active .ua-step-dot { background: var(--ua-accent); color: #fff; box-shadow: 0 0 0 4px var(--ua-ring); }

/* Judul */
.ua-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--ua-soft);
    color: var(--ua-accent-dark);
    font-size: 28px;
}
.ua-icon:before {
    content: "";
    position: absolute;
    inset: -6px;
    border: 2px solid var(--ua-ring);
    border-radius: 50%;
    animation: ua-pulse 2.4s ease-out infinite;
}
@keyframes ua-pulse {
    0% { opacity: 1; transform: scale(.9); }
    100% { opacity: 0; transform: scale(1.25); }
}
.ua-title { margin: 0 0 6px; color: #0f172a; font-size: 22px; font-weight: 700; text-align: center; }
.ua-sub { margin: 0 0 22px; color: #64748b; font-size: 14px; line-height: 1.55; text-align: center; }
.ua-sub b { color: #0f172a; }

/* Kotak kode OTP */
.ua-otp {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.ua-otp input {
    width: 52px;
    height: 60px;
    padding: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    caret-color: var(--ua-accent);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.ua-otp input:focus {
    outline: none;
    border-color: var(--ua-accent);
    background: #fff;
    box-shadow: 0 0 0 4px var(--ua-ring);
}
.ua-otp input.is-filled { border-color: var(--ua-accent); background: #fff; }
.ua-otp.is-error input { border-color: #ef4444; background: #fef2f2; }
.ua-otp.is-error { animation: ua-shake .35s ease; }
.ua-otp.is-success input { border-color: #10b981; background: #ecfdf5; }
@keyframes ua-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.ua-otp-gap { flex: 0 0 4px; }

.ua-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    margin-bottom: 18px;
    color: #64748b;
    font-size: 13px;
}
.ua-meta.is-warn { color: #b45309; }
.ua-meta.is-expired { color: #b91c1c; }

/* Pesan inline */
.ua-alert {
    display: none;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
}
.ua-alert.is-show { display: flex; }
.ua-alert.is-error { background: #fef2f2; color: #991b1b; }
.ua-alert.is-success { background: #ecfdf5; color: #065f46; }
.ua-alert .fa, .ua-alert .fas { margin-top: 2px; }

/* Flash message bawaan (layouts/partials/message) */
.ua-card .alert {
    margin-bottom: 16px;
    padding: 10px 36px 10px 14px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
}
.ua-card .alert h4 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; }
.ua-card .alert .close { top: 0; right: 0; padding: 8px 12px; }

/* Tombol */
.ua-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 14px;
    background: var(--ua-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 18px var(--ua-ring);
    transition: background .15s, transform .15s;
}
.ua-btn:hover, .ua-btn:focus { background: var(--ua-accent-dark); color: #fff; outline: none; }
.ua-btn:active { transform: translateY(1px); }
.ua-btn:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }
.ua-btn-ghost {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #334155;
    box-shadow: none;
    height: 44px;
    font-size: 14px;
}
.ua-btn-ghost:hover, .ua-btn-ghost:focus { background: #f8fafc; color: #0f172a; }
.ua-link {
    border: none;
    background: none;
    padding: 0;
    color: var(--ua-accent-dark);
    font-weight: 700;
    cursor: pointer;
}
.ua-link:hover, .ua-link:focus { color: var(--ua-accent-dark); text-decoration: underline; outline: none; }
.ua-link:disabled { color: #94a3b8; text-decoration: none; cursor: default; }

.ua-help { margin-top: 16px; color: #64748b; font-size: 13px; text-align: center; }

/* Blok sekunder (kode pemulihan) */
.ua-collapse {
    display: none;
    margin-top: 14px;
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    text-align: left;
}
.ua-collapse.is-open { display: block; animation: ua-rise .25s ease both; }
.ua-collapse p { margin: 0 0 10px; font-size: 12px; color: #64748b; }

/* Field */
.ua-field { margin-bottom: 16px; }
.ua-field > label { display: block; margin-bottom: 6px; color: #334155; font-size: 13px; font-weight: 600; }
.ua-input { position: relative; }
.ua-input > .fa, .ua-input > .fas {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.ua-input .form-control {
    height: 48px;
    padding-left: 42px;
    padding-right: 48px;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    box-shadow: none;
    font-size: 15px;
}
.ua-input .form-control:focus { border-color: var(--ua-accent); background: #fff; box-shadow: 0 0 0 4px var(--ua-ring); }
.ua-input .form-control.ua-mono { font-family: Consolas, Monaco, monospace; letter-spacing: .12em; text-transform: uppercase; }
.ua-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
}
.ua-eye:hover, .ua-eye:focus { background: #f1f5f9; color: #0f172a; outline: none; }

/* Kekuatan password (kelas diisi check_pass()) */
.ua-card #password-strength-status { position: relative; margin-top: 10px; padding: 12px 0 0; color: #64748b; font-size: 12px; font-weight: 700; }
.ua-card #password-strength-status:empty { display: none; }
.ua-card #password-strength-status:before,
.ua-card #password-strength-status:after { content: ""; position: absolute; top: 0; left: 0; height: 6px; border-radius: 999px; }
.ua-card #password-strength-status:before { right: 0; background: #e2e8f0; }
.ua-card #password-strength-status:after { width: 0; transition: width .25s ease, background .25s ease; }
.ua-card #password-strength-status.weak-password { color: #b91c1c; }
.ua-card #password-strength-status.weak-password:after { width: 25%; background: #ef4444; }
.ua-card #password-strength-status.okay-password { color: #c2410c; }
.ua-card #password-strength-status.okay-password:after { width: 50%; background: #f97316; }
.ua-card #password-strength-status.good-password { color: #a16207; }
.ua-card #password-strength-status.good-password:after { width: 75%; background: #eab308; }
.ua-card #password-strength-status.strong-password { color: #047857; }
.ua-card #password-strength-status.strong-password:after { width: 100%; background: #10b981; }

.ua-match { margin-top: 6px; font-size: 12px; font-weight: 700; }
.ua-match:empty { display: none; }
.ua-match.is-ok { color: #047857; }
.ua-match.is-no { color: #b91c1c; }

.ua-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin: 4px 0 20px;
    padding: 12px 14px;
    list-style: none;
    border-radius: 12px;
    background: #f8fafc;
}
.ua-rules li { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 12px; }
.ua-rules li .fa { width: 14px; color: #cbd5e1; text-align: center; }
.ua-rules li.is-ok { color: #0f172a; }
.ua-rules li.is-ok .fa { color: #10b981; }

.ua-notice {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}
.ua-notice .fa { margin-top: 2px; font-size: 16px; }
.ua-notice b { color: #78350f; }

/* Reset password dari link email: akun yang di-reset + status link */
.ua-account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}
.ua-account-avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ua-soft);
    color: var(--ua-accent-dark);
}
.ua-account-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ua-account-text small { color: #64748b; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ua-account-text b { overflow: hidden; color: #0f172a; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.ua-tips { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--ua-soft); list-style: none; }
.ua-tips li { display: flex; gap: 10px; color: #475569; font-size: 12.5px; line-height: 1.5; }
.ua-tips li + li { margin-top: 8px; }
.ua-tips li .fa, .ua-tips li .far, .ua-tips li .fas { flex: 0 0 14px; margin-top: 3px; color: var(--ua-accent-dark); text-align: center; }
.ua-tips b { color: #0f172a; }
.ua-icon.is-danger { background: #fef2f2; color: #b91c1c; }
.ua-icon.is-danger:before { border-color: rgba(220, 38, 38, .22); }
a.ua-btn, a.ua-btn:hover, a.ua-btn:focus { text-decoration: none; }

/* Konfirmasi keluar */
.ua-logout { margin-top: 12px; text-align: center; }
.ua-logout-confirm {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}
.ua-logout.is-confirm .ua-logout-trigger { display: none; }
.ua-logout.is-confirm .ua-logout-confirm { display: flex; }
.ua-logout-confirm a {
    padding: 6px 12px;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.ua-logout-confirm a:hover { background: #b91c1c; color: #fff; text-decoration: none; }
.ua-logout-confirm .ua-link { color: #64748b; font-weight: 600; }

.ua-foot { margin-top: 20px; color: rgba(255, 255, 255, .75); font-size: 12px; text-align: center; }

@media (max-width: 420px) {
    .ua-card { padding: 26px 20px 22px; border-radius: 20px; }
    .ua-otp { gap: 6px; }
    .ua-otp input { width: 42px; height: 52px; border-radius: 12px; font-size: 20px; }
    .ua-otp-gap { flex-basis: 0; }
    .ua-rules { grid-template-columns: 1fr; }
    .ua-steps li { font-size: 0; gap: 0; }
    .ua-steps li + li:before { margin-right: 0; }
}
