/* ============================================================
   Komzi — Authentication & Onboarding UI Component Layer
   Sprint 6A.2 — single source of truth for auth/onboarding styling.
   Plain CSS (no build step). Dark mode via `.dark` on <html>.
   ============================================================ */

/* ---------- Page shell ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #111827;
}
.dark .auth-page { background: #0f172a; color: #f1f5f9; }

.auth-split {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

.auth-pane {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}
.auth-pane__inner { width: 100%; max-width: 27rem; }

/* ---------- Brand panel (right side) ---------- */
.brand-panel { display: none; }

@media (min-width: 992px) {
    .auth-pane { width: 50%; }
    .brand-panel {
        display: flex;
        width: 50%;
        position: relative;
        overflow: hidden;
        flex-direction: column;
        justify-content: center;
        padding: 3.5rem;
        color: #ffffff;
        background: linear-gradient(135deg, #6B5CFF 0%, #1E1B4B 52%, #0F172A 100%);
    }
    .brand-panel::before {
        content: "";
        position: absolute;
        top: -20%;
        right: -10%;
        width: 60%;
        height: 60%;
        background: radial-gradient(circle, rgba(16, 182, 182, 0.35) 0%, rgba(16, 182, 182, 0) 70%);
        pointer-events: none;
    }
    .brand-panel::after {
        content: "";
        position: absolute;
        bottom: -25%;
        left: -15%;
        width: 70%;
        height: 70%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
        pointer-events: none;
    }
}

.brand-panel__content { position: relative; z-index: 1; max-width: 30rem; }
.brand-panel__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    margin-bottom: 2.5rem;
}
.brand-panel__logo img { width: 2.75rem; height: 2.75rem; }
.brand-panel__logo span { font-size: 1.25rem; letter-spacing: -0.01em; }
.brand-panel__title {
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}
.brand-panel__subtitle {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 2.5rem;
}
.brand-panel__features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.brand-panel__feature { display: flex; align-items: center; gap: 0.75rem; font-size: 0.95rem; color: rgba(255, 255, 255, 0.92); }
.brand-panel__feature svg { flex-shrink: 0; width: 1.25rem; height: 1.25rem; color: #10B6B6; }

/* ---------- Form header ---------- */
.auth-logo { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 2rem; cursor: pointer; }
.auth-logo img { width: 3rem; height: 3rem; }
.auth-logo span { font-size: 2rem; letter-spacing: 0; color: #111827; position: relative; top: 3px; }
.dark .auth-logo span { color: #ffffff; }

/* ---------- Brand wordmark font (Plus Jakarta Sans, theme-aware color) ---------- */
.brand-wordmark {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 600;
}

.auth-heading { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.5rem; color: #111827; }
.dark .auth-heading { color: #ffffff; }
.auth-subheading { font-size: 0.9375rem; color: #6b7280; margin: 0 0 2rem; line-height: 1.5; }
.dark .auth-subheading { color: #9ca3af; }

/* ---------- Step indicator ---------- */
.step-nav { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem; }
.step { display: flex; align-items: center; gap: 0.5rem; }
.step__num {
    width: 1.75rem; height: 1.75rem; border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8125rem; font-weight: 700;
    background: #e5e7eb; color: #6b7280;
    transition: background 0.2s, color 0.2s;
}
.step__label { font-size: 0.8125rem; font-weight: 500; color: #9ca3af; white-space: nowrap; transition: color 0.2s; }
.step--active .step__num, .step--done .step__num { background: #6B5CFF; color: #ffffff; }
.step--active .step__label, .step--done .step__label { color: #6B5CFF; }
.step-line { flex: 1; height: 2px; background: #e5e7eb; min-width: 1.5rem; transition: background 0.2s; }
.step-line--done { background: #6B5CFF; }
.dark .step__num { background: #374151; color: #9ca3af; }
.dark .step-line { background: #374151; }

/* ---------- Fields ---------- */
.auth-field { margin-bottom: 1.25rem; }
.auth-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 600px) { .auth-row { grid-template-columns: 1fr 1fr; } }

.auth-label { display: block; font-size: 0.8125rem; font-weight: 600; color: #374151; margin-bottom: 0.375rem; }
.dark .auth-label { color: #d1d5db; }
.auth-label__optional { font-weight: 400; color: #9ca3af; }

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.auth-input::placeholder { color: #9ca3af; }
.auth-input:focus { outline: none; border-color: #6B5CFF; box-shadow: 0 0 0 3px rgba(107, 92, 255, 0.18); }
.dark .auth-input { background: #1e293b; border-color: #374151; color: #ffffff; }
.dark .auth-input::placeholder { color: #6b7280; }

select.auth-input {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.1rem;
    padding-right: 2.5rem;
}

.auth-input--error { border-color: #dc2626; }
.auth-input--error:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }

.auth-field-error { margin-top: 0.375rem; font-size: 0.8125rem; color: #dc2626; }
.auth-field-error:empty { display: none; margin: 0; }
.dark .auth-field-error { color: #f87171; }
.auth-field-hint { margin-top: 0.375rem; font-size: 0.8125rem; color: #9ca3af; }

/* password reveal */
.auth-input-group { position: relative; }
.auth-input-group .auth-input { padding-right: 2.75rem; }
.auth-reveal {
    position: absolute; top: 50%; right: 0.75rem; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: #9ca3af;
    display: flex; align-items: center; padding: 0.25rem;
}
.auth-reveal:hover { color: #6b7280; }
.dark .auth-reveal:hover { color: #d1d5db; }

/* ---------- Buttons ---------- */
.auth-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: 0.8125rem 1rem;
    font-size: 0.9375rem; font-weight: 600;
    border-radius: 0.625rem; border: 1px solid transparent; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-decoration: none; box-sizing: border-box;
}
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(107, 92, 255, 0.4); }
.auth-btn-primary { background: #6B5CFF; color: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.auth-btn-primary:hover { background: #5747E0; }
.auth-btn-ghost { background: transparent; color: #6b7280; }
.auth-btn-ghost:hover { color: #6B5CFF; }
.dark .auth-btn-ghost { color: #9ca3af; }
.dark .auth-btn-ghost:hover { color: #38bdf8; }

.auth-link { color: #6B5CFF; font-weight: 500; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ---------- Footer / meta ---------- */
.auth-meta { margin-top: 1.5rem; text-align: center; font-size: 0.875rem; color: #6b7280; }
.dark .auth-meta { color: #9ca3af; }
.auth-reassure {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.8125rem; color: #059669; font-weight: 500;
}
.dark .auth-reassure { color: #34d399; }

/* ---------- Non-field error block ---------- */
.auth-alert-error {
    display: flex; gap: 0.75rem; align-items: flex-start;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 0.625rem;
    padding: 0.875rem 1rem; margin-bottom: 1.25rem;
}
.auth-alert-error svg { flex-shrink: 0; width: 1.25rem; height: 1.25rem; color: #ef4444; }
.auth-alert-error p { margin: 0; font-size: 0.875rem; color: #b91c1c; }
.dark .auth-alert-error { background: rgba(127, 29, 29, 0.2); border-color: rgba(239, 68, 68, 0.4); }
.dark .auth-alert-error p { color: #fca5a5; }

/* ---------- Success banner ---------- */
.auth-alert-success {
    display: flex; gap: 0.75rem; align-items: flex-start;
    background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 0.625rem;
    padding: 0.875rem 1rem;
}
.auth-alert-success svg { flex-shrink: 0; width: 1.5rem; height: 1.5rem; color: #059669; }
.dark .auth-alert-success { background: rgba(6, 78, 59, 0.2); border-color: rgba(16, 185, 129, 0.4); }
.dark .auth-alert-success svg { color: #34d399; }

/* ---------- Trust bar ---------- */
.trust-bar { border-top: 1px solid #e5e7eb; background: #f9fafb; padding: 1.5rem; }
.dark .trust-bar { background: #0b1220; border-color: #1f2937; }
.trust-grid {
    max-width: 72rem; margin: 0 auto;
    display: grid; grid-template-columns: 1fr; gap: 1.25rem;
}
@media (min-width: 600px) { .trust-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 992px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; align-items: center; gap: 0.75rem; }
.trust-item__icon { color: #6B5CFF; flex-shrink: 0; width: 1.5rem; height: 1.5rem; }
.trust-item__title { font-size: 0.875rem; font-weight: 600; color: #111827; }
.dark .trust-item__title { color: #ffffff; }
.trust-item__desc { font-size: 0.8125rem; color: #6b7280; }
.dark .trust-item__desc { color: #9ca3af; }

/* ============================================================
   Alert cards (Phase 4) — used in global banners & pages
   ============================================================ */
.alert-card {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1rem 1.25rem; border-radius: 0.75rem;
    border: 1px solid transparent;
}
.alert-card__icon {
    flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
}
.alert-card__icon svg { width: 1.25rem; height: 1.25rem; }
.alert-card__body { flex: 1 1 auto; min-width: 0; }
.alert-card__title { font-size: 0.9375rem; font-weight: 700; margin: 0 0 0.25rem; }
.alert-card__text { font-size: 0.8125rem; line-height: 1.45; margin: 0; }
.alert-card__text strong { font-weight: 600; }
.alert-card__action {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.5rem 0.875rem; font-size: 0.8125rem; font-weight: 600;
    border-radius: 0.5rem; border: 1px solid currentColor; cursor: pointer;
    text-decoration: none; background: transparent; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.alert-card__dismiss {
    flex-shrink: 0; background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.55; padding: 0.25rem; display: flex;
    transition: opacity 0.15s;
}
.alert-card__dismiss:hover { opacity: 1; }
.alert-card__dismiss svg { width: 1.125rem; height: 1.125rem; }

/* warning variant */
.alert-card--warning { background: #fffbeb; border-color: #fde68a; }
.alert-card--warning .alert-card__icon { background: #fef3c7; color: #d97706; }
.alert-card--warning .alert-card__title { color: #92400e; }
.alert-card--warning .alert-card__text { color: #b45309; }
.alert-card--warning .alert-card__action { color: #b45309; }
.alert-card--warning .alert-card__action:hover { background: #d97706; color: #ffffff; border-color: #d97706; }
.dark .alert-card--warning { background: rgba(120, 53, 15, 0.18); border-color: rgba(180, 83, 9, 0.4); }
.dark .alert-card--warning .alert-card__icon { background: rgba(180, 83, 9, 0.3); color: #fbbf24; }
.dark .alert-card--warning .alert-card__title { color: #fcd34d; }
.dark .alert-card--warning .alert-card__text { color: #fde68a; }
.dark .alert-card--warning .alert-card__action { color: #fbbf24; }

/* info variant */
.alert-card--info { background: #eff6ff; border-color: #bfdbfe; }
.alert-card--info .alert-card__icon { background: #dbeafe; color: #2563eb; }
.alert-card--info .alert-card__title { color: #1e40af; }
.alert-card--info .alert-card__text { color: #1d4ed8; }
.alert-card--info .alert-card__action { color: #1d4ed8; }
.alert-card--info .alert-card__action:hover { background: #2563eb; color: #ffffff; border-color: #2563eb; }
.dark .alert-card--info { background: rgba(30, 58, 138, 0.18); border-color: rgba(37, 99, 235, 0.4); }
.dark .alert-card--info .alert-card__icon { background: rgba(37, 99, 235, 0.3); color: #60a5fa; }
.dark .alert-card--info .alert-card__title { color: #93c5fd; }
.dark .alert-card--info .alert-card__text { color: #bfdbfe; }
.dark .alert-card--info .alert-card__action { color: #60a5fa; }

/* success variant */
.alert-card--success { background: #f0fdf4; border-color: #bbf7d0; }
.alert-card--success .alert-card__icon { background: #dcfce7; color: #16a34a; }
.alert-card--success .alert-card__title { color: #166534; }
.alert-card--success .alert-card__text { color: #15803d; }
.dark .alert-card--success { background: rgba(20, 83, 45, 0.18); border-color: rgba(22, 163, 74, 0.4); }
.dark .alert-card--success .alert-card__icon { background: rgba(22, 163, 74, 0.3); color: #4ade80; }
.dark .alert-card--success .alert-card__title { color: #86efac; }
.dark .alert-card--success .alert-card__text { color: #bbf7d0; }

/* stack alert layout on small screens */
@media (max-width: 599.98px) {
    .alert-card { flex-wrap: wrap; }
    .alert-card__action { margin-top: 0.5rem; }
}
