@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Inter.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Outfit.woff2') format('woff2');
}

:root {
    --bg: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --secondary: #0ea5e9;
    --secondary-glow: rgba(14, 165, 233, 0.15);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 16px 48px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 460px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 36px 28px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255,255,255,0.6);
    position: relative;
    overflow: hidden;
    margin-top: 16px;
}
.container::before {
    content: '';
    position: absolute;
    top: -60%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(79,70,229,0.04) 0%, transparent 55%);
    pointer-events: none;
}

/* ── Language Switcher ── */
.lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 24px;
    position: relative;
    z-index: 10;
}
.lang-btn {
    background: #f1f5f9;
    border: 1px solid var(--card-border);
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}
.lang-btn:hover {
    background: #e2e8f0;
    color: var(--text);
}
.lang-btn.active {
    background: linear-gradient(135deg, var(--primary), #3730a3);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ── Progress bar ── */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
    padding: 0 6px;
}
.progress-track {
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 2px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 1;
}
.progress-fill {
    position: absolute;
    top: 50%; left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: translateY(-50%);
    z-index: 2;
    transition: width 0.45s cubic-bezier(.4,0,.2,1);
}
.dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #f8fafc;
    border: 2px solid var(--card-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: var(--muted);
    z-index: 3;
    transition: all .4s ease;
    position: relative;
}
.dot.active  { background: #e0e7ff; border-color: var(--primary); color: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
.dot.done    { background: #d1fae5; border-color: var(--success); color: var(--success); box-shadow: 0 0 12px var(--success-glow); }

/* ── Step views ── */
.step { display: none; flex-direction: column; align-items: center; text-align: center; animation: fadeUp .35s ease forwards; }
.step.active { display: flex; }
@keyframes fadeUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px; font-weight: 700;
    letter-spacing: -.4px;
    margin-bottom: 10px;
    color: #1e1b4b;
}
.desc { font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 22px; }

/* ── Buttons ── */
.btn {
    width: 100%; padding: 15px 20px;
    border-radius: 14px; border: none; outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    display: flex; align-items: center; justify-content: center; gap: 9px;
    position: relative; overflow: hidden;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3730a3);
    color: #fff;
    box-shadow: 0 4px 18px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 26px rgba(79,70,229,.4); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-secondary {
    background: #f8fafc;
    color: var(--muted);
    border: 1px solid var(--card-border);
    margin-top: 11px;
}
.btn-secondary:hover { background: #e2e8f0; color: var(--text); }

/* ── Phone input step ── */
.phone-input-wrapper {
    width: 100%; position: relative; margin-bottom: 18px;
}
.phone-prefix {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 15px; font-weight: 600; color: var(--primary);
    pointer-events: none; z-index: 2;
}
.phone-input {
    width: 100%; padding: 15px 16px 15px 68px;
    background: #f8fafc;
    border: 1.5px solid var(--card-border);
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 22px; font-weight: 600;
    color: var(--text); letter-spacing: 2px;
    outline: none;
    transition: border-color .25s;
}
.phone-input::placeholder { color: #cbd5e1; letter-spacing: 1px; font-size: 18px; }
.phone-input:focus { border-color: var(--primary); }
.phone-input.error { border-color: var(--danger); }

/* ── Already verified card ── */
.verified-card {
    width: 100%;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    padding: 24px 20px;
    margin-bottom: 20px;
}
.verified-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: #dcfce7;
    border: 2px solid var(--success);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 0 22px var(--success-glow);
    animation: popIn .5s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes popIn { from { transform: scale(.5); opacity:0; } to { transform: scale(1); opacity:1; } }
.verified-icon svg { width: 34px; height: 34px; stroke: var(--success); fill: none; stroke-width: 2.5; }
.verified-number { font-size: 19px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.verified-sub { font-size: 13px; color: var(--muted); }

/* ── Doc type cards ── */
.doc-type-grid { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-bottom: 20px; }
.doc-card {
    background: #f5f3ff;
    border: 2px solid #ddd6fe;
    border-radius: 15px;
    padding: 17px 20px;
    cursor: pointer; text-align: left;
    display: flex; align-items: center; gap: 15px;
    transition: all .22s;
}
.doc-card:hover { border-color: var(--primary); background: #ede9fe; }
.doc-card.selected { border-color: var(--secondary); background: #e0f2fe; }
.doc-card .emoji { font-size: 2rem; }
.doc-card .doc-title { font-weight: 700; font-size: .95rem; margin-bottom: 3px; }
.doc-card .doc-sub { font-size: .78rem; color: var(--muted); }

/* ── Camera / capture frame ── */
.capture-frame {
    width: 100%;
    aspect-ratio: 1.586;
    align-self: stretch;
    flex-shrink: 0;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: border-color .25s, background .25s;
}
.capture-frame.selfie-mode {
    aspect-ratio: 1;
    border-radius: 50%;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
    align-self: center;
}
.capture-frame:hover { border-color: var(--primary); background: #ede9fe; }
.capture-frame.has-image { border-style: solid; border-color: var(--secondary); }

.scan-overlay {
    position: absolute; inset: 12px;
    border: 1.5px solid rgba(14,165,233,.35);
    border-radius: 10px;
    pointer-events: none; z-index: 2;
}
.capture-frame.selfie-mode .scan-overlay { border-radius: 50%; inset: 6px; border-color: rgba(79,70,229,.4); }

.laser {
    position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    box-shadow: 0 0 8px var(--secondary);
    animation: laserScan 2.5s linear infinite;
    z-index: 3; pointer-events: none;
}
.capture-frame.selfie-mode .laser {
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 8px var(--primary);
    animation: laserScanSmall 2.5s ease-in-out infinite;
}
@keyframes laserScan { 0%,100% { top:0%; } 50% { top:100%; } }
@keyframes laserScanSmall { 0%,100% { top:10%; } 50% { top:90%; } }

.frame-preview {
    position: absolute; inset: 0;
    object-fit: cover; display: none; z-index: 5;
    width: 100%; height: 100%;
}
.capture-frame.selfie-mode .frame-preview { border-radius: 50%; }

.frame-prompt { z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); }
.frame-prompt svg { width: 44px; height: 44px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.frame-prompt span { font-size: 13px; font-weight: 500; }
.capture-frame:hover .frame-prompt { color: var(--text); }

input[type="file"] { display: none; }

/* ── Processing ── */
.processing-box {
    width: 100%; padding: 24px 0;
    display: flex; flex-direction: column; align-items: center;
}
.spinner {
    width: 72px; height: 72px;
    border: 3px solid #f1f5f9;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 26px;
    box-shadow: 0 0 18px var(--primary-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-txt { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 22px; height: 20px; }
.progress-track-bar {
    width: 100%; height: 5px;
    background: #e2e8f0;
    border-radius: 8px; overflow: hidden; margin-bottom: 8px;
}
.progress-bar-fill {
    width: 0%; height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 8px;
    box-shadow: 0 0 8px var(--secondary);
    transition: width .15s ease-out;
}
.progress-pct { font-size: 11px; color: var(--muted); }

/* ── Success ── */
.success-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: #dcfce7;
    border: 2px solid var(--success);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 26px;
    box-shadow: 0 0 24px var(--success-glow);
    animation: popIn .5s cubic-bezier(.175,.885,.32,1.275) forwards;
}
.success-icon svg { width: 38px; height: 38px; stroke: var(--success); fill: none; stroke-width: 2.5; }

.result-card {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 18px;
    text-align: left;
    margin-bottom: 26px;
}
.result-row {
    display: flex; justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}
.result-row:last-child { border-bottom: none; padding-bottom: 0; }
.result-label { color: var(--muted); }
.result-val { font-weight: 600; }

/* ── Error banner ── */
.error-banner {
    width: 100%;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px; color: #b91c1c;
    line-height: 1.45;
    display: none;
    margin-bottom: 18px;
    text-align: left;
}
.error-banner.visible { display: block; }

/* ── Alert info ── */
.info-banner {
    width: 100%;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px; color: #b45309;
    line-height: 1.45;
    display: flex; gap: 10px; align-items: flex-start;
    margin-bottom: 22px;
    text-align: left;
}
.info-banner svg { width: 18px; height: 18px; stroke: currentColor; fill: none; flex-shrink: 0; margin-top: 1px; }

/* ── Checking loader ── */
.inline-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle; margin-right: 6px;
}

/* ── Retake Badge overlay ── */
.retake-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
    z-index: 6;
    display: none;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255,255,255,0.15);
}
.capture-frame.has-image .retake-badge {
    display: flex;
}

/* ── Brand Header ── */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    gap: 8px;
}
.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.12);
}
.brand-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

/* ── Footer ── */
.footer {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}
.footer p {
    margin-bottom: 6px;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--primary);
}

/* ── Camera Overlay ── */
.camera-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 1000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.camera-overlay.active {
    display: flex;
}
.camera-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    z-index: 1;
}
#cameraVideo.mirrored {
    transform: scaleX(-1);
}
.camera-guide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 120px;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
.guide-box {
    border: 3px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}
.guide-box.document {
    width: 85%;
    aspect-ratio: 1.586;
    border-radius: 16px;
}
.guide-box.selfie {
    width: 70%;
    aspect-ratio: 0.8;
    border-radius: 50%;
}
.camera-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
    padding: 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.camera-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 56px; height: 56px;
    display: flex; justify-content: center; align-items: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.camera-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.camera-btn:active {
    transform: scale(0.95);
}
.camera-btn svg {
    width: 24px; height: 24px;
    stroke: currentColor;
    fill: none;
}
.btn-shutter {
    width: 76px; height: 76px;
    background: #fff;
    border: 6px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}
.btn-shutter:hover {
    background: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.08);
}
.btn-shutter:active {
    transform: scale(0.92);
}

/* ── Frame Loader Overlay ── */
.frame-loader {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(2px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    gap: 8px;
    z-index: 8;
}
.frame-loader.active {
    display: flex;
}
.frame-loader .inline-spinner {
    width: 24px;
    height: 24px;
    border-width: 2.5px;
}

/* ── Success Checkmark Badge ── */
.success-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px var(--success-glow);
    border: 1.5px solid #fff;
    z-index: 7;
    animation: popIn .35s cubic-bezier(.175,.885,.32,1.275) forwards;
}
.success-badge.active {
    display: flex;
}
.success-badge svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}




