/* ============================================================
 * Onboarding — Split Layout
 * Left: Welcome & Steps | Right: Form
 * ============================================================ */

:root {
    --primary: #14b8a6;
    --primary-dark: #0d9488;
    --primary-light: #5eead4;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    background: #f1f5f9;
    overflow: hidden;
}

/* ===== SPLIT CONTAINER ===== */
.ob-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ===== LEFT PANEL ===== */
.ob-left {
    flex: 0 0 42%;
    max-width: 42%;
    background: linear-gradient(160deg, var(--gradient-start, #0d9486) 0%, var(--gradient-mid, #14b8a6) 40%, var(--gradient-end, #0ea5e9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.ob-left::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('/assets/admin/images/batik-pkk.svg');
    background-size: 300px;
    background-repeat: repeat;
    opacity: 0.06;
    pointer-events: none;
}

.ob-left-content {
    position: relative;
    z-index: 1;
    max-width: 380px;
    width: 100%;
    animation: slideLeft 0.6s ease;
}

@keyframes slideLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Logo */
.ob-logo {
    margin-bottom: 2rem;
}

.ob-logo img {
    width: 56px;
    height: 56px;
    filter: brightness(0) invert(1) drop-shadow(0 4px 20px rgba(0,0,0,0.2));
}

/* Welcome */
.ob-welcome {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ob-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Steps */
.ob-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.ob-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.ob-step:hover {
    background: rgba(255,255,255,0.15);
}

.ob-step--done {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.3);
}

.ob-step-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.ob-step--done .ob-step-num {
    background: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.ob-step-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ob-step-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.ob-step-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

/* Tips */
.ob-tips {
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.ob-tips-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.ob-tips-title i {
    margin-right: 0.25rem;
}

.ob-tips p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.6;
}

.ob-tips strong {
    color: rgba(255,255,255,0.95);
}

/* Left Footer */
.ob-left-footer {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

/* ===== RIGHT PANEL ===== */
.ob-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    overflow-y: auto;
    background: #fff;
}

.ob-right-content {
    max-width: 460px;
    width: 100%;
    animation: slideRight 0.6s ease;
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Progress Header */
.ob-progress-header {
    margin-bottom: 2rem;
}

.ob-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ob-progress-text h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
}

.ob-progress-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(20, 184, 166, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.ob-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.ob-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Alerts */
.ob-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.6;
    animation: slideRight 0.4s ease;
}

.ob-alert i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.ob-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.ob-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.ob-alert ul {
    margin-top: 0.25rem;
    padding-left: 1.2rem;
}

/* ===== FORM ===== */
.ob-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Avatar Section */
.ob-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.ob-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: var(--border);
    flex-shrink: 0;
    border: 3px solid #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.ob-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ob-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gradient-start, var(--primary)), var(--gradient-mid, var(--primary-light)));
    color: #fff;
    font-size: 1.5rem;
}

.ob-avatar-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ob-avatar-btn:hover {
    background: rgba(0,0,0,0.75);
}

.ob-file-input {
    display: none;
}

.ob-avatar-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ob-avatar-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.ob-avatar-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Field */
.ob-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ob-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.ob-field-label i {
    color: var(--primary);
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
}

/* Badges */
.ob-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-left: auto;
}

.ob-badge--done {
    background: #dcfce7;
    color: #166534;
}

.ob-badge--done i {
    color: #166534;
    font-size: 0.6rem;
    width: auto;
    margin-right: 0.15rem;
}

.ob-badge--needed {
    background: #fef3c7;
    color: #92400e;
}

/* Inputs */
.ob-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    background: #fff;
}

.ob-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

.ob-input-prefix {
    padding: 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--surface-hover);
    border-right: 1px solid var(--border);
    height: 48px;
    display: flex;
    align-items: center;
    user-select: none;
}

.ob-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fff;
    transition: all 0.2s;
    height: 48px;
}

.ob-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

.ob-input::placeholder {
    color: #94a3b8;
}

/* For phone with prefix */
.ob-input-wrap .ob-input {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.ob-input-wrap .ob-input:focus {
    border: none;
    box-shadow: none;
}

.ob-field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-left: 0.25rem;
}

/* Filled field (already has value) */
.ob-field-filled {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #166534;
    font-weight: 500;
}

.ob-field-filled i {
    color: #22c55e;
}

/* ===== ACTIONS ===== */
.ob-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.ob-btn-primary {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.3);
}

.ob-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(20, 184, 166, 0.4);
}

.ob-btn-primary:active {
    transform: translateY(0);
}

.ob-btn-skip {
    display: block;
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem;
    transition: color 0.2s;
}

.ob-btn-skip:hover {
    color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ob-split {
        flex-direction: column;
    }

    .ob-left {
        flex: none;
        max-width: 100%;
        padding: 2rem 1.5rem;
    }

    .ob-left-content {
        max-width: 100%;
        text-align: center;
    }

    .ob-steps {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .ob-step {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }

    .ob-right {
        flex: none;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .ob-welcome {
        font-size: 1.5rem;
    }

    .ob-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .ob-step {
        min-width: 100%;
    }
}

/* ============================================================
 * DARK MODE — tema 3-mode (system/light/dark)
 * Panel kiri tetap gradasi warna sistem; panel kanan mengikuti tema.
 * ============================================================ */

/* === Dark theme === */
html.dark-mode body { background: #0f172a; }
html.dark-mode .ob-right { background: #1e293b; }
html.dark-mode .ob-progress-text h2 { color: #f1f5f9; }
html.dark-mode .ob-progress-bar { background: #334155; }
html.dark-mode .ob-alert--success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}
html.dark-mode .ob-alert--error {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
html.dark-mode .ob-avatar-section {
    background: #0f172a;
    border-color: #334155;
}
html.dark-mode .ob-avatar-preview { border-color: #334155; }
html.dark-mode .ob-avatar-label,
html.dark-mode .ob-field-label { color: #e2e8f0; }
html.dark-mode .ob-avatar-hint,
html.dark-mode .ob-field-hint { color: #94a3b8; }
html.dark-mode .ob-badge--done { background: rgba(34, 197, 94, 0.15); color: #86efac; }
html.dark-mode .ob-badge--done i { color: #86efac; }
html.dark-mode .ob-badge--needed { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
html.dark-mode .ob-input-wrap {
    background: #0f172a;
    border-color: #334155;
}
html.dark-mode .ob-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
html.dark-mode .ob-input::placeholder { color: #64748b; }
html.dark-mode .ob-input:focus { border-color: var(--primary-light); }
html.dark-mode .ob-input-wrap:focus-within { border-color: var(--primary-light); }
html.dark-mode .ob-input-prefix {
    background: #16213a;
    border-right-color: #334155;
    color: #94a3b8;
}
html.dark-mode .ob-field-filled {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}
html.dark-mode .ob-field-filled i { color: #4ade80; }
html.dark-mode .ob-btn-skip { color: #94a3b8; }
html.dark-mode .ob-btn-skip:hover { color: var(--primary-light); }

/* ============================================================
 * DARK MODE — elemen yang dipakai halaman Lupa Password (unified
 * admin & SIDONGAN). Dipisah dari blok utama agar jelas cakupannya.
 * ============================================================ */
html.dark-mode .ob-step {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

html.dark-mode .ob-tips {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .ob-alert--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

html.dark-mode .ob-alert--warning i,
html.dark-mode .ob-alert--warning svg { color: #fcd34d; }

html.dark-mode .ob-field-hint { color: #94a3b8; }

html.dark-mode .ob-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

html.dark-mode .ob-input::placeholder { color: #64748b; }

html.dark-mode .ob-btn-skip svg { color: #94a3b8; }

/* Kartu "login langsung ke" di halaman unified forgot — inline style di
   view memakai CSS vars dengan fallback terang, jadi dark override di sini
   dengan !important (inline style menang atas selector biasa). */
html.dark-mode .ob-login-chip {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html.dark-mode .ob-login-chip:hover {
    border-color: var(--primary-light) !important;
}

html.dark-mode .ob-login-divider > p {
    color: #94a3b8 !important;
}

/* ============================================================
   Validasi realtime (auth-form-validation.js) — error state field
   ============================================================ */
.ob-input--error {
    border-color: #ef4444 !important;
}

.ob-input--error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.ob-field-error {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #dc2626;
}

.ob-field-error svg {
    margin-top: 0.15rem;
}

html.dark-mode .ob-field-error {
    color: #f87171;
}
