/* ============================================================
   Identity Verification AI – styles.css
   ============================================================ */

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

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --border: #dde3ee;
    --text: #1e2430;
    --text-muted: #6b7588;
    --primary: #4361ee;
    --primary-dark: #3451d1;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --orange: #f97316;
    --purple: #8b5cf6;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,.08);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; box-shadow: var(--shadow); }
.navbar-brand { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.navbar-icon { font-size: 1.4rem; }
.navbar-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.navbar-links a { color: var(--text-muted); text-decoration: none; font-size: .9rem; font-weight: 500; transition: color .15s; }
.navbar-links a:hover { color: var(--primary); }

/* ─── Container ──────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; flex: 1; }

/* ─── Page header ────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.8rem; font-weight: 700; }
.subtitle { color: var(--text-muted); margin-top: .25rem; }

/* ─── Card grid ──────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card-link { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; display: block; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.12); border-color: var(--primary); }
.card-icon { font-size: 2rem; margin-bottom: .75rem; }
.card h2 { font-size: 1.1rem; margin-bottom: .4rem; }
.card p { color: var(--text-muted); font-size: .9rem; line-height: 1.5; margin-bottom: .75rem; }

/* ─── Two-column layout ──────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* ─── Badges ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ─── Status bar ─────────────────────────────────────────── */
.status-bar { padding: .75rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .9rem; }
.status-ok { border-color: var(--success); }
.status-err { border-color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-loading { background: var(--text-muted); animation: pulse 1s infinite; }
.dot-ok { background: var(--success); }
.dot-err { background: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ─── Notice ─────────────────────────────────────────────── */
.notice { padding: .75rem 1rem; border-radius: var(--radius); font-size: .85rem; margin-bottom: 1rem; }
.notice.warning { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }
.notice.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn { display: inline-block; padding: .55rem 1.1rem; border-radius: 6px; font-size: .9rem; font-weight: 600; cursor: pointer; border: none; transition: background .15s, opacity .15s; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }

/* ─── Form groups ────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
input[type="file"] { width: 100%; font-size: .9rem; padding: .4rem; border: 1px dashed var(--border); border-radius: 6px; background: var(--bg); cursor: pointer; }

/* ─── Camera ─────────────────────────────────────────────── */
.camera-controls { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.video-preview { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-top: .5rem; background: #000; }
.image-preview { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-top: .5rem; display: block; }
.image-preview.small { max-height: 200px; object-fit: contain; }

/* ─── Metrics grid ───────────────────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.metric { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .75rem; text-align: center; }
.metric-label { font-size: .75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: .25rem; }
.metric-value { font-size: 1.1rem; font-weight: 700; }

/* ─── JSON viewer ────────────────────────────────────────── */
.json-viewer { background: #1e2430; color: #a8d8b9; padding: 1rem; border-radius: var(--radius); font-size: .8rem; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 350px; overflow-y: auto; }
.raw-text { background: var(--bg); border: 1px solid var(--border); padding: .75rem; border-radius: 6px; font-size: .8rem; white-space: pre-wrap; max-height: 200px; overflow-y: auto; }

/* ─── Error list ─────────────────────────────────────────── */
.error-list { list-style: none; }
.error-list li { background: #fee2e2; color: #991b1b; border-radius: 5px; padding: .35rem .75rem; margin-bottom: .3rem; font-size: .85rem; font-weight: 600; }

/* ─── Data table ─────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 1rem; }
.data-table th { background: var(--bg); text-align: left; padding: .5rem .75rem; font-size: .75rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.data-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--bg); }

/* ─── Verified badge ─────────────────────────────────────── */
.verified-badge { text-align: center; padding: 1.25rem; border-radius: var(--radius); font-size: 1.3rem; font-weight: 700; }
.verified-badge.match { background: #dcfce7; color: #15803d; }
.verified-badge.no-match { background: #fee2e2; color: #991b1b; }

/* ─── Step bar ───────────────────────────────────────────── */
.step-bar { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.step { padding: .4rem .85rem; border-radius: 20px; font-size: .8rem; font-weight: 600; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }
.step.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.done { background: var(--success); color: #fff; border-color: var(--success); }
.step-arrow { color: var(--text-muted); font-size: .8rem; }

/* ─── Flow step ──────────────────────────────────────────── */
.flow-step { margin-bottom: 1rem; }
.flow-step h3 { font-size: 1rem; margin-bottom: .5rem; }
.step-status { margin-top: .5rem; font-size: .85rem; min-height: 1.2em; }

/* ─── Misc ───────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.empty-state { color: var(--text-muted); font-size: .9rem; padding: 2rem; text-align: center; }
.loading-state { color: var(--primary); font-size: .9rem; padding: 2rem; text-align: center; font-weight: 600; }
h3 { font-size: 1rem; margin-bottom: .6rem; margin-top: 1rem; color: var(--text); }

/* ─── Footer ─────────────────────────────────────────────── */
.footer { text-align: center; font-size: .8rem; color: var(--text-muted); padding: 1.25rem; border-top: 1px solid var(--border); background: var(--surface); }
