/* ============================================
   KYC Verification — Dynamoney
   App-Shell Mobile-First Design
   ============================================ */

/* ── CSS Variables ───────────────────────────────────────────────────────── */

:root {
    --primary:        #5D40FF;
    --primary-dark:   #4A30E0;
    --primary-light:  #7B68FF;
    --primary-alpha:  rgba(93, 64, 255, 0.12);

    --success:        #22c55e;
    --success-dark:   #16a34a;
    --success-alpha:  rgba(34, 197, 94, 0.12);

    --warning:        #f59e0b;
    --warning-alpha:  rgba(245, 158, 11, 0.12);

    --error:          #ef4444;
    --error-alpha:    rgba(239, 68, 68, 0.12);

    --info:           #3b82f6;
    --info-alpha:     rgba(59, 130, 246, 0.12);

    --bg:             #f8fafc;
    --surface:        #ffffff;
    --border:         #e2e8f0;
    --border-focus:   var(--primary);

    --text-1:         #1e293b;
    --text-2:         #64748b;
    --text-3:         #94a3b8;

    --radius-sm:      0.375rem;
    --radius:         0.625rem;
    --radius-lg:      1rem;

    --shadow-sm:      0 1px 2px rgba(0,0,0,0.06);
    --shadow:         0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.10);

    --top-bar-h:      56px;
    --progress-h:     4px;
    --bottom-bar-h:   auto;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */

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

/* ── Base ────────────────────────────────────────────────────────────────── */

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-1);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── App Shell ───────────────────────────────────────────────────────────── */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────── */

.top-bar {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    height: var(--top-bar-h);
    padding: 0 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
}

.top-bar-back {
    display: flex;
    align-items: center;
}

.top-bar-back a,
.top-bar-back button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-2);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.top-bar-back a:hover,
.top-bar-back button:hover {
    background: var(--bg);
    color: var(--text-1);
}

.top-bar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.01em;
}

.brand-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.top-bar-title {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ── Progress Rail ───────────────────────────────────────────────────────── */

.progress-rail {
    height: var(--progress-h);
    background: var(--border);
    flex-shrink: 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Content Area ────────────────────────────────────────────────────────── */

.content-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.content-area.no-pad {
    padding: 0;
}

.content-pad {
    padding: 1.25rem 1rem;
}

/* ── Bottom Bar ──────────────────────────────────────────────────────────── */

.bottom-bar {
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bottom-bar-empty {
    display: none;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

h1 { font-size: 1.5rem;  font-weight: 700; color: var(--text-1); line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 700; color: var(--text-1); line-height: 1.25; }
h3 { font-size: 1.05rem; font-weight: 600; color: var(--text-1); line-height: 1.3; }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-1); }
h5 { font-size: 0.875rem; font-weight: 600; color: var(--text-1); }

p {
    color: var(--text-2);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    height: 48px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(93, 64, 255, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(93, 64, 255, 0.32);
    color: #fff;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-success {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(93, 64, 255, 0.25);
}

.btn-success:hover:not(:disabled) {
    background: var(--primary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    color: var(--text-1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: none;
    height: 40px;
    font-size: 0.875rem;
}

.btn-ghost:hover {
    color: var(--text-1);
    background: var(--bg);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    color: #fff;
}

.btn-outline-danger {
    background: transparent;
    color: var(--error);
    border: 1.5px solid var(--error);
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--error-alpha);
    color: var(--error);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary-alpha);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    height: 52px;
    font-size: 1rem;
    padding: 0 1.5rem;
}

.btn-sm {
    height: 36px;
    font-size: 0.8125rem;
    padding: 0 0.875rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    height: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    font-family: inherit;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ── Close Button ────────────────────────────────────────────────────────── */

.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
}

.btn-close::before {
    content: '\00D7';
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-1);
}

.btn-close:hover {
    opacity: 1;
    background: var(--bg);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-body {
    padding: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header i {
    color: var(--primary);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-1);
}

.form-label .optional {
    font-weight: 400;
    color: var(--text-3);
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.form-control,
.form-select {
    width: 100%;
    height: 48px;
    padding: 0 0.875rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-1);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.form-control::placeholder {
    color: var(--text-3);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--error);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--error-alpha);
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-3);
}

.form-section {
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--primary);
}

/* ── Alerts / Banners ────────────────────────────────────────────────────── */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert i {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 1rem;
}

.alert-info    { background: var(--info-alpha);    color: #1e40af; border-left: 3px solid var(--info); }
.alert-success { background: var(--success-alpha); color: #166534; border-left: 3px solid var(--success); }
.alert-warning { background: var(--warning-alpha); color: #92400e; border-left: 3px solid var(--warning); }
.alert-danger  { background: var(--error-alpha);   color: #991b1b; border-left: 3px solid var(--error); }

/* ── Badges / Chips ──────────────────────────────────────────────────────── */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.625rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.chip-primary  { background: var(--primary-alpha); color: var(--primary); }
.chip-success  { background: var(--success-alpha); color: var(--success-dark); }
.chip-warning  { background: var(--warning-alpha); color: #92400e; }
.chip-error    { background: var(--error-alpha);   color: var(--error); }
.chip-muted    { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge.bg-danger   { background: var(--error);   color: #fff; }
.badge.bg-success  { background: var(--success);  color: #fff; }
.badge.bg-secondary { background: var(--text-3);  color: #fff; }
.badge.bg-primary  { background: var(--primary);  color: #fff; }

/* ── Welcome / Start Screen ──────────────────────────────────────────────── */

.welcome-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 20px rgba(93, 64, 255, 0.3);
}

.welcome-icon i {
    font-size: 2rem;
    color: #fff;
}

.welcome-heading {
    text-align: center;
    margin-bottom: 1.5rem;
}

.welcome-heading h1 {
    margin-bottom: 0.25rem;
}

.welcome-heading p {
    font-size: 0.9rem;
}

.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9rem;
    color: var(--text-2);
}

.checklist li i {
    color: var(--success);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Document Row Cards (Select Documents) ───────────────────────────────── */

.doc-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
    width: 100%;
    margin-bottom: 0.625rem;
    -webkit-tap-highlight-color: transparent;
}

.doc-row:last-child {
    margin-bottom: 0;
}

.doc-row:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.doc-row.selected {
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.doc-row.captured {
    border-color: var(--success);
    background: var(--success-alpha);
}

.doc-row-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-row-icon i {
    font-size: 1.375rem;
    color: var(--primary);
}

.doc-row.captured .doc-row-icon i {
    color: var(--success);
}

.doc-row-body {
    flex: 1;
    min-width: 0;
}

.doc-row-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 0.15rem;
}

.doc-row-sub {
    font-size: 0.78rem;
    color: var(--text-3);
}

.doc-row-end {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.doc-row-end i {
    color: var(--text-3);
    font-size: 1rem;
}

.doc-row.captured .doc-row-end i {
    color: var(--success);
}

/* ── Section Heading ─────────────────────────────────────────────────────── */

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-3);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-label .badge {
    text-transform: uppercase;
}

/* ── Points Progress ─────────────────────────────────────────────────────── */

.points-bar-wrap {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.points-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.points-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.points-target {
    font-size: 0.8rem;
    color: var(--text-3);
}

.points-progress {
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.points-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* ── Points Progress — legacy class aliases used by document-selector.js ─── */

.points-progress-container { margin-bottom: 1rem; }
.points-display { font-size: 1rem; font-weight: 700; color: var(--primary); }

/* ── Camera / Capture Area ───────────────────────────────────────────────── */

.camera-stage {
    position: relative;
    width: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.camera-stage.active-camera {
    background: #0a0a0a;
}

/* Fill the content-area when used as full-bleed */
.camera-stage.full-bleed {
    height: 100%;
    border-radius: 0;
}

.camera-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Document capture frame overlay */
.doc-frame-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.doc-frame {
    width: 85%;
    max-width: 360px;
    aspect-ratio: 1.586;
    border: 2.5px solid var(--primary);
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* Initial (no camera) state */
.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-3);
    text-align: center;
    background: var(--surface);
    width: 100%;
    height: 100%;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.camera-placeholder:hover {
    border-color: var(--primary);
    background: rgba(93, 64, 255, 0.03);
}

.camera-placeholder:hover i {
    color: var(--primary);
}

.camera-placeholder i {
    font-size: 3.5rem;
    color: var(--text-3);
    transition: color 0.15s;
}

.camera-placeholder p {
    font-size: 0.875rem;
    color: var(--text-3);
}

/* Camera status overlay (bottom gradient) */
.camera-status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.625rem 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.8125rem;
    text-align: center;
}

/* ── Capture Info Strip ───────────────────────────────────────────────────── */

.capture-info-strip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-2);
    flex-shrink: 0;
}

.capture-info-strip strong {
    color: var(--text-1);
}

/* Side Indicator (Front / Back) */
.side-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.side-step {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-3);
    font-weight: 500;
}

.side-step.active  { color: var(--primary); font-weight: 700; }
.side-step.completed { color: var(--success); }

.side-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.side-step.active .side-dot    { background: var(--primary); color: #fff; border-color: var(--primary); }
.side-step.completed .side-dot { background: var(--success); color: #fff; border-color: var(--success); }

.side-connector {
    width: 24px;
    height: 1.5px;
    background: var(--border);
}

.side-connector.completed { background: var(--success); }

/* ── Front Thumbnail Strip ────────────────────────────────────────────────── */

.front-thumbnail-strip {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    background: var(--success-alpha);
    border-bottom: 1px solid rgba(34, 197, 94, 0.3);
    flex-shrink: 0;
}

.front-thumb-image {
    width: 56px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(34, 197, 94, 0.4);
    flex-shrink: 0;
}

.front-thumb-info {
    font-size: 0.8rem;
    color: var(--text-2);
}

.front-thumb-info strong {
    display: block;
    color: var(--success-dark);
    font-size: 0.8125rem;
}

/* ── Quality Tips (collapsible) ──────────────────────────────────────────── */

.tips-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    color: var(--text-3);
    cursor: pointer;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.tips-toggle i.bi-info-circle {
    color: var(--info);
}

.tips-panel {
    padding: 0.75rem 1rem;
    background: var(--bg);
    font-size: 0.8125rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}

.tips-panel ul {
    margin: 0.375rem 0 0;
    padding-left: 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ── Review — Document Thumbnails ────────────────────────────────────────── */

.doc-thumb-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.doc-thumb-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.doc-thumb-img {
    width: 72px;
    height: 46px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.doc-thumb-body {
    flex: 1;
    min-width: 0;
}

.doc-thumb-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 0.125rem;
}

.doc-thumb-meta {
    font-size: 0.75rem;
    color: var(--text-3);
}

.doc-thumb-actions {
    flex-shrink: 0;
}

/* ── Face Scan ───────────────────────────────────────────────────────────── */

.face-scan-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.face-camera-area {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    overflow: hidden;
}

.face-camera-area video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.face-oval {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52%;
    aspect-ratio: 0.75;
    border: 2.5px dashed rgba(255,255,255,0.65);
    border-radius: 50%;
    pointer-events: none;
}

.face-hint {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-2);
    background: var(--bg);
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

/* Stub placeholder */
.face-stub-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    height: 100%;
    color: #555;
}

.face-stub-placeholder i {
    font-size: 3.5rem;
}

/* Progress ring */
.progress-ring-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0,0,0,0.7);
}

.progress-ring-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.15);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-light);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.3s ease;
}

.progress-ring-fill.passed { stroke: var(--success); }

.progress-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

/* Status card */
.face-status-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0 1rem 0.75rem;
}

.face-status-card.pending    { background: var(--info-alpha);    color: #1e40af;  border: 1px solid rgba(59,130,246,0.25); }
.face-status-card.processing { background: var(--warning-alpha); color: #92400e;  border: 1px solid rgba(245,158,11,0.3); }
.face-status-card.passed     { background: var(--success-alpha); color: var(--success-dark); border: 1px solid rgba(34,197,94,0.3); }
.face-status-card.failed     { background: var(--error-alpha);   color: var(--error); border: 1px solid rgba(239,68,68,0.3); }

.face-status-card i { flex-shrink: 0; font-size: 1.1rem; }

/* Stub badge */
.stub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--warning-alpha);
    border: 1px solid rgba(245,158,11,0.4);
    color: #92400e;
    border-radius: 99px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 1rem;
}

/* Scan instructions (compact) */
.scan-instructions {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.scan-instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.8125rem;
    color: var(--text-2);
}

.scan-instruction-item i {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.875rem;
}

/* ── Success Screen ───────────────────────────────────────────────────────── */

.success-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon-wrap i {
    font-size: 2.25rem;
    color: #fff;
}

@keyframes pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.timeline {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    text-align: left;
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.timeline-dot.done    { background: var(--success-alpha); }
.timeline-dot.pending { background: var(--info-alpha); }
.timeline-dot.notify  { background: var(--primary-alpha); }
.timeline-dot.secure  { background: var(--success-alpha); }

.timeline-dot i {
    font-size: 0.9rem;
}

.timeline-dot.done i    { color: var(--success); }
.timeline-dot.pending i { color: var(--info); }
.timeline-dot.notify i  { color: var(--primary); }
.timeline-dot.secure i  { color: var(--success); }

.timeline-body {
    flex: 1;
}

.timeline-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 0.1rem;
}

.timeline-desc {
    font-size: 0.8rem;
    color: var(--text-3);
}

/* ── Loading / Spinners ──────────────────────────────────────────────────── */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-box {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    text-align: center;
    min-width: 180px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-border {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner-border.text-primary { border-top-color: var(--primary); }

/* ── Toast ───────────────────────────────────────────────────────────────── */

#toastContainer {
    position: fixed;
    top: calc(var(--top-bar-h) + 0.75rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: calc(100% - 2rem);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--text-1);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: slideDown 0.2s ease;
}

.toast.toast-success { background: var(--success-dark); }
.toast.toast-error   { background: var(--error); }
.toast.toast-warning { background: var(--warning); color: var(--text-1); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Modals ──────────────────────────────────────────────────────────────── */

/* Bootstrap is loaded JS-only; provide complete modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1055;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: block;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.5);
}

.modal-backdrop.fade { opacity: 0; transition: opacity 0.15s linear; }
.modal-backdrop.show { opacity: 1; }

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    max-width: 460px;
    pointer-events: none;
}

@media (min-width: 576px) {
    .modal-dialog {
        margin: 1.75rem auto;
    }
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

@media (min-width: 576px) {
    .modal-dialog-centered {
        min-height: calc(100% - 3.5rem);
    }
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.modal-header .modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0;
}

.modal-body {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    gap: 0.5rem;
}

/* ── Skeleton ────────────────────────────────────────────────────────────── */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Drag and Drop ───────────────────────────────────────────────────────── */

.camera-stage.drag-over .camera-placeholder,
.camera-placeholder.drag-over {
    border-color: var(--primary);
    border-style: solid;
    background: rgba(93, 64, 255, 0.06);
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.text-muted   { color: var(--text-3) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--error) !important; }
.text-center  { text-align: center; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.d-none      { display: none !important; }
.d-flex      { display: flex; }
.d-grid      { display: grid; }
.d-block     { display: block; }
.gap-2       { gap: 0.5rem; }
.gap-3       { gap: 0.75rem; }
.mt-1        { margin-top: 0.25rem; }
.mt-2        { margin-top: 0.5rem; }
.mt-3        { margin-top: 0.75rem; }
.mb-0        { margin-bottom: 0; }
.mb-1        { margin-bottom: 0.25rem; }
.mb-2        { margin-bottom: 0.5rem; }
.mb-3        { margin-bottom: 0.75rem; }
.mb-4        { margin-bottom: 1rem; }
.ms-2        { margin-left: 0.5rem; }
.me-2        { margin-right: 0.5rem; }
.fw-semibold { font-weight: 600; }
.fw-bold     { font-weight: 700; }
.small       { font-size: 0.8125rem; }
.fs-5        { font-size: 1.125rem; }
.w-100       { width: 100%; }

/* Progress bar (Bootstrap compat) */
.progress {
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* ── Desktop panel — always hidden ───────────────────────────────────────── */

.desktop-panel {
    display: none;
}

/* ── CaptureDocument: modeSelection is an internal JS mechanism only ─────── */
/* The real visible buttons are in #initialBtns (bottom bar / web action bar) */
#modeSelection {
    display: none !important;
}

/* ── Web Navbar & Progress Bar — hidden on mobile ────────────────────────── */

.web-navbar {
    display: none;
}

.web-progress-bar {
    display: none;
}

.web-action-bar {
    display: none;
}

/* ── Web Layout (769px+) — full-width, real web experience ───────────────── */

@media (min-width: 769px) {

    /* Body: normal document flow, no flex centering */
    body {
        display: block;
        background: var(--bg);
        min-height: 100vh;
        padding: 0;
    }

    /* Collapse wrappers so they don't affect layout */
    .desktop-layout,
    .desktop-shell-wrap {
        display: contents;
    }

    .desktop-panel {
        display: none;
    }

    /* ── Web Navbar ── */
    .web-navbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 100;
        width: 100%;
        height: 64px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
        flex-shrink: 0;
    }

    .web-navbar-inner {
        display: flex;
        align-items: center;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 2rem;
        gap: 1rem;
    }

    .web-navbar-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 1rem;
        font-weight: 800;
        color: var(--text-1);
        letter-spacing: -0.02em;
        flex-shrink: 0;
    }

    .web-navbar-brand .brand-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--primary);
        flex-shrink: 0;
    }

    .web-navbar-divider {
        width: 1px;
        height: 20px;
        background: var(--border);
        flex-shrink: 0;
    }

    .web-navbar-step {
        flex: 1;
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--text-2);
    }

    .web-navbar-back {
        flex-shrink: 0;
    }

    /* Style the back link inside the navbar on desktop */
    .web-navbar-back a,
    .web-navbar-back button {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-2);
        text-decoration: none;
        padding: 0.375rem 0.75rem;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--surface);
        cursor: pointer;
        transition: all 0.15s;
    }

    .web-navbar-back a:hover,
    .web-navbar-back button:hover {
        background: var(--bg);
        color: var(--text-1);
    }

    /* ── Progress Rail ── */
    .web-progress-bar {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--border);
        position: sticky;
        top: 64px;
        z-index: 99;
    }

    .web-progress-bar .progress-fill {
        height: 100%;
        background: var(--primary);
        transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* ── App Shell — loses phone appearance ── */
    .app-shell {
        display: block;
        max-width: none;
        width: 100%;
        height: auto;
        min-height: calc(100vh - 67px);
        border-radius: 0;
        box-shadow: none;
        background: var(--bg);
        overflow: visible;
    }

    /* Hide mobile-only chrome inside the shell */
    .top-bar {
        display: none;
    }

    .progress-rail {
        display: none;
    }

    .bottom-bar {
        display: none;
    }

    /* ── Content Area — full-width, normal scroll ── */
    .content-area {
        overflow: visible;
        padding: 3rem 2rem;
        flex: none;
        height: auto;
        -webkit-overflow-scrolling: auto;
    }

    /* Inner content capped at 720px, centred */
    .content-pad {
        max-width: 720px;
        margin: 0 auto;
    }

    /* Camera pages set #mainContent to flex — override for web */
    #mainContent {
        display: block !important;
        height: auto !important;
    }

    /* ── Inline Action Bar (replaces pinned bottom-bar) ── */
    .web-action-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        max-width: 720px;
        margin: 2rem auto 4rem;
        padding: 0;
        flex-wrap: wrap;
    }

    /* Buttons are auto-width on desktop, not full-width */
    .web-action-bar .btn-full {
        width: auto;
        min-width: 180px;
    }

    .web-action-bar .btn-ghost {
        width: auto;
    }

    /* Desktop button sizing */
    .web-action-bar .btn {
        height: 48px;
        padding: 0 1.75rem;
    }

    /* ── Toast repositioned for desktop ── */
    #toastContainer {
        top: 80px;
        right: 1.5rem;
        left: auto;
        transform: none;
        width: auto;
        max-width: 380px;
    }

    /* ── Camera capture: constrained width on desktop ── */
    .camera-stage.full-bleed {
        max-height: 60vh;
        border-radius: var(--radius);
        max-width: 720px;
        margin: 0 auto;
        background: transparent;
    }

    .camera-placeholder {
        min-height: 280px;
        border-radius: var(--radius);
    }

    /* Face scan wrap: constrained on desktop */
    .face-scan-wrap {
        max-width: 720px;
        margin: 0 auto;
        height: auto;
        min-height: 560px;
    }

    .face-camera-area {
        min-height: 420px;
        border-radius: var(--radius);
    }

    /* Tips + extras panels: constrained */
    #capturePageExtras {
        max-width: 720px;
        margin: 0 auto;
    }

    /* capture-info strips */
    .capture-info-strip,
    .orientation-tip {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Front-captured banner: hidden on desktop — the side-indicator shows completed state */
    .front-thumbnail-strip {
        display: none !important;
    }
}

/* Orientation tip */
.orientation-tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--warning-alpha);
    border-bottom: 1px solid rgba(245,158,11,0.3);
    font-size: 0.8rem;
    color: #92400e;
    flex-shrink: 0;
}

/* Legacy Bootstrap compat classes used by JS */
.flex-shrink-0 { flex-shrink: 0; }
.d-flex        { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.text-white    { color: #fff; }
.bg-success    { background: var(--success) !important; }
.bg-secondary  { background: var(--text-3) !important; }
.bg-warning    { background: var(--warning) !important; }
.bg-danger     { background: var(--error) !important; }
.text-dark     { color: var(--text-1) !important; }
.fw-bold       { font-weight: 700; }
.w-100         { width: 100%; }

/* ── Bootstrap grid compat (used by verification.js Review page) ─────────── */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.g-3 {
    gap: 0.75rem;
}

.row.g-3 {
    margin-left: 0;
    margin-right: 0;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
        padding: 0;
    }
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 calc(33.333% - 0.75rem);
        max-width: calc(33.333% - 0.75rem);
        padding: 0;
    }
}
