/* ═══════════════════════════════════════════════════════════════
   SCANOVA — Module d'Enrôlement Facial — Styles v2
   Mobile-first, optimisé smartphones
   ═══════════════════════════════════════════════════════════════ */

:root {
    --primary: #084c99;
    --primary-light: #1b68a7;
    --primary-mid: #64b5f6;
    --primary-soft: #dbeafe;
    --accent: #059669;
    --accent-light: #10b981;
    --accent-soft: #d1fae5;
    --danger: #dc2626;
    --danger-light: #ef4444;
    --warn: #d97706;
    --warn-bg: #fffbeb;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════
   HEADER COMPACT
   ═══════════════════════════════════════════════ */
.enroll-header {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #90caf9 100%);
    text-align: center;
    padding: 16px 16px 12px;
    position: relative;
    z-index: 50;
}

.enroll-header .logo {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
    padding: 6px;
}

.enroll-header .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.enroll-header h1 {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.enroll-header h1 i {
    margin-right: 6px;
    font-size: 0.95rem;
}

.enroll-header p.subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════
   CARD COMMUNE (index.php)
   ═══════════════════════════════════════════════ */
.enroll-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 440px;
    margin: 16px;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.enroll-card-body {
    padding: 24px 20px;
}

/* ═══════════════════════════════════════════════
   FORMULAIRE
   ═══════════════════════════════════════════════ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary-mid);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: #fff;
    color: var(--text);
}

.form-control:focus {
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ═══════════════════════════════════════════════
   BOUTONS
   ═══════════════════════════════════════════════ */
.btn-enroll {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    min-height: 50px;
}

.btn-primary-enroll {
    background: var(--primary-light);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30,64,175,0.25);
}

.btn-primary-enroll:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(30,64,175,0.35);
}

.btn-primary-enroll:active {
    transform: scale(0.98);
}

.btn-primary-enroll:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-success-enroll {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}

.btn-success-enroll:hover {
    background: #047857;
}

.btn-success-enroll:active {
    transform: scale(0.98);
}

.btn-outline-enroll {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline-enroll:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   ALERTES
   ═══════════════════════════════════════════════ */
.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    display: none;
    align-items: center;
    gap: 8px;
}

.alert-error.show {
    display: flex;
}

.alert-success-msg {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ═══════════════════════════════════════════════
   LOADER
   ═══════════════════════════════════════════════ */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.enroll-footer {
    text-align: center;
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: auto;
}

/* ═══════════════════════════════════════════════════
   PAGE ENRÔLEMENT — WELCOME + PANELS
   ═══════════════════════════════════════════════════ */
.enroll-welcome-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 480px;
    margin: 16px;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #90caf9 100%);
    color: #fff;
    padding: 24px 20px;
    text-align: center;
}

.welcome-banner .avatar {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 24px;
    border: 2px solid rgba(255,255,255,0.3);
}

.welcome-banner h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.welcome-banner .company-badge {
    background: rgba(255,255,255,0.12);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    display: inline-block;
    margin-top: 6px;
    backdrop-filter: blur(4px);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--primary-mid);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
    transform: scale(1.15);
}

.step-dot.completed {
    background: var(--accent);
}

/* Panels */
.panel-container {
    position: relative;
    overflow: hidden;
}

.panel {
    padding: 20px;
    display: none;
    animation: fadeIn 0.35s ease;
}

.panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    font-size: 1.1rem;
    color: var(--primary-mid);
}

.panel-message {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.65;
    margin-bottom: 20px;
}

.panel-message .instruction-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.panel-message .instruction-list li {
    padding: 10px 0 10px 36px;
    position: relative;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.panel-message .instruction-list li:last-child {
    border-bottom: none;
}

.panel-message .instruction-list li::before {
    content: attr(data-step);
    position: absolute;
    left: 0;
    top: 10px;
    width: 24px;
    height: 24px;
    background: var(--primary-mid);
    color: #fff;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-message .note-box,
.note-box {
    background: var(--warn-bg);
    border-left: 3px solid var(--warn);
    padding: 12px 14px;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    margin-top: 14px;
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.5;
}

.panel-message .note-box strong,
.note-box strong {
    color: var(--warn);
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.panel-actions .btn-enroll {
    flex: 1;
    padding: 13px 16px;
    font-size: 0.9rem;
}

/* Direction Arrows */
.direction-icons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.direction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--primary-soft);
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
}

.direction-item i {
    font-size: 1.1rem;
    color: var(--primary-mid);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   SECTION CAPTURE — CAMÉRA + GUIDE + RÉSULTATS
   ═══════════════════════════════════════════════════ */
.enroll-capture-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 480px;
    margin: 16px;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

.capture-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #90caf9 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.capture-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.capture-header h3 i {
    margin-right: 6px;
}

.company-badge-sm {
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.capture-body {
    padding: 16px;
}

.capture-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Caméra ─── */
.capture-camera-col {
    text-align: center;
}

.camera-container {
    position: relative;
    width: 100%;
    max-height: 55vh;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 4/3;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
}

.guide-overlay {
.guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8px;
    pointer-events: none;
    z-index: 2;
}

/* ── Cadre de capture (correspond exactement à la zone JS) ── */
/* cropSize = 65% de la hauteur vidéo, centré, remonté de 5% */
/* En CSS : height = 65% du conteneur (4:3), left/top centrés */
.crop-zone {
    position: absolute;
    /* height = 65% of container height */
    height: 65%;
    aspect-ratio: 1 / 1;
    /* Centre à 45% du haut (= centre de la zone JS) */
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.15s;
}

/* Coins de visée (style viewfinder) */
.cz-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.9);
    border-width: 0;
    transition: border-color 0.2s;
}

.cz-tl { top: 0;    left: 0;  border-top-width: 3px;    border-left-width: 3px;  border-radius: 4px 0 0 0; }
.cz-tr { top: 0;    right: 0; border-top-width: 3px;    border-right-width: 3px; border-radius: 0 4px 0 0; }
.cz-bl { bottom: 0; left: 0;  border-bottom-width: 3px; border-left-width: 3px;  border-radius: 0 0 0 4px; }
.cz-br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }

/* État "capturé" : coins passent au vert */
.crop-zone.captured .cz-corner {
    border-color: #22c55e;
    transition: border-color 0.05s;
}

/* Label "Alignez votre visage" en bas du cadre */
.cz-hint {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Oval du visage — centré dans le crop-zone */
.guide-oval {
    width: 80%;
    aspect-ratio: 3/4;
    border: 3px dashed rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ovalPulse 2.5s ease-in-out infinite;
}

@keyframes ovalPulse {
    0%, 100% { border-color: rgba(255, 255, 255, 0.45); }
    50%       { border-color: rgba(96, 165, 250, 0.85); }
}

.guide-arrow {
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    animation: arrowPulse 0.7s ease-in-out infinite alternate;
    position: absolute;
    filter: drop-shadow(0 0 6px rgba(59,130,246,0.5));
}

.guide-arrow.arrow-left {
    left: -44px;
    top: 50%;
    transform: translateY(-50%);
}

.guide-arrow.arrow-right {
    right: -44px;
    top: 50%;
    transform: translateY(-50%);
}

.guide-arrow.arrow-up {
    top: -38px;
    left: 50%;
    transform: translateX(-50%);
}

.guide-arrow.arrow-down {
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes arrowPulse {
    from { opacity: 0.4; transform: translateY(-50%) scale(0.9); }
    to   { opacity: 1;   transform: translateY(-50%) scale(1.05); }
}

.guide-arrow.arrow-up,
.guide-arrow.arrow-down {
    animation-name: arrowPulseV;
}

@keyframes arrowPulseV {
    from { opacity: 0.4; transform: translateX(-50%) scale(0.9); }
    to   { opacity: 1;   transform: translateX(-50%) scale(1.05); }
}

.step-instruction {
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 8px;
    backdrop-filter: blur(4px);
}

.timer-badge {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(0,0,0,0.35);
    padding: 2px 10px;
    border-radius: var(--radius-xs);
    backdrop-filter: blur(4px);
    line-height: 1.2;
}

.rec-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    margin-right: 6px;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 6px rgba(255,0,0,0.5);
}

@keyframes blink {
    50% { opacity: 0; }
}

.capture-controls {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.capture-controls .btn-enroll {
    width: auto;
    padding: 13px 24px;
    font-size: 0.9rem;
}

.btn-danger-enroll {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}

.btn-danger-enroll:hover {
    background: #b91c1c;
}

.btn-danger-enroll:active {
    transform: scale(0.98);
}

.capture-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 8px;
}

/* ─── Info / Résultats ─── */
.capture-info-col h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.capture-info-col h4 i {
    color: var(--primary-mid);
}

.capture-instructions {
    padding-left: 18px;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.7;
}

.capture-instructions ul {
    padding-left: 16px;
    margin-top: 4px;
}

/* ─── Progress ─── */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-mid) 0%, var(--accent-light) 100%);
    border-radius: 4px;
    color: #fff;
    font-size: 0;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 8px;
}

.progress-pct {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-mid);
    text-align: center;
    margin-top: 10px;
    font-variant-numeric: tabular-nums;
}

/* ─── Résultats ─── */
.result-stats {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.result-stats i {
    margin-right: 5px;
}

.result-stats.result-success {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid #a7f3d0;
}

.result-stats.result-warning {
    background: var(--warn-bg);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
}

.result-thumb {
    position: relative;
    border-radius: var(--radius-xs);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 1;
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-label {
    position: absolute;
    bottom: 2px;
    left: 2px;
    font-size: 0.55rem;
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ─── Preview Actions ─── */
.preview-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1.5px solid var(--border);
}

.preview-question {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    text-align: center;
}

.preview-question i {
    margin-right: 5px;
    color: var(--primary-mid);
}

.preview-buttons {
    display: flex;
    gap: 10px;
}

.preview-buttons .btn-enroll {
    flex: 1;
    padding: 14px 16px;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Tablettes (600px+)
   ═══════════════════════════════════════════════ */
@media (min-width: 600px) {
    .enroll-header {
        padding: 28px 24px 22px;
    }

    .enroll-header .logo {
        width: 62px;
        height: 62px;
    }

    .enroll-header h1 {
        font-size: 1.3rem;
    }

    .enroll-welcome-card,
    .enroll-capture-card {
        max-width: 520px;
        margin: 24px;
    }

    .enroll-card {
        max-width: 480px;
        margin: 24px;
    }

    .enroll-card-body {
        padding: 32px 28px;
    }

    .panel {
        padding: 28px 24px;
    }

    .welcome-banner {
        padding: 30px 24px;
    }

    .welcome-banner h2 {
        font-size: 1.2rem;
    }

    .capture-body {
        padding: 20px;
    }

    .guide-oval {
        max-width: 240px;
    }

    .result-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Desktop (900px+)
   ═══════════════════════════════════════════════ */
@media (min-width: 900px) {
    .enroll-header {
        position: relative;
        padding: 32px 24px 26px;
    }

    .enroll-header .logo {
        width: 68px;
        height: 68px;
    }

    .enroll-header h1 {
        font-size: 1.5rem;
    }

    .enroll-capture-card {
        max-width: 900px;
    }

    .capture-layout {
        flex-direction: row;
        gap: 24px;
    }

    .capture-camera-col {
        flex: 1.2;
        min-width: 0;
    }

    .capture-info-col {
        flex: 1;
        min-width: 0;
    }

    .camera-container {
        max-height: 420px;
    }

    .guide-oval {
        max-width: 260px;
    }

    .result-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Petits smartphones (< 380px)
   ═══════════════════════════════════════════════ */
@media (max-width: 380px) {
    .enroll-header h1 {
        font-size: 0.95rem;
    }

    .enroll-header p.subtitle {
        font-size: 0.75rem;
    }

    .enroll-welcome-card,
    .enroll-capture-card,
    .enroll-card {
        margin: 10px 8px;
        border-radius: 12px;
    }

    .panel {
        padding: 16px 14px;
    }

    .direction-icons {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .panel-actions {
        flex-direction: column;
    }

    .capture-controls .btn-enroll {
        padding: 12px 18px;
        font-size: 0.85rem;
    }

    .preview-buttons {
        flex-direction: column;
    }

    .result-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .welcome-banner h2 {
        font-size: 0.92rem;
    }

    .welcome-banner .company-badge {
        font-size: 0.72rem;
    }
}

/* ═══════════════════════════════════════════════
   UTILITAIRES
   ═══════════════════════════════════════════════ */

/* Safe-area pour iPhone avec encoche */
@supports (padding: env(safe-area-inset-top)) {
    .enroll-header {
        padding-top: calc(20px + env(safe-area-inset-top));
    }
}

/* Scrollbar discrète */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 2px;
}

/* Focus visible pour accessibilité */
.btn-enroll:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary-mid);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════
   CAPTURE PHOTO — bouton, flash, bande de photos
   ═══════════════════════════════════════════════ */

/* Bouton principal de capture */
.btn-capture {
    background: linear-gradient(135deg, #1565c0 0%, #42a5f5 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(21, 101, 192, 0.45);
    min-height: 54px;
    letter-spacing: 0.02em;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-capture:hover {
    box-shadow: 0 6px 24px rgba(21, 101, 192, 0.55);
    transform: translateY(-1px);
}

.btn-capture:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(21, 101, 192, 0.35);
}

.btn-capture:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Flash d'obturateur */
.capture-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    border-radius: inherit;
    transition: opacity 0.25s ease-out;
}

.capture-flash.active {
    opacity: 0.75;
    transition: opacity 0.04s;
}

/* Compteur de photos (ex: Photo 2 / 5) */
.photo-step-counter {
    text-align: center;
    margin-top: 10px;
}

.photo-step-counter span {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 5px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Bande des 5 photos capturées */
.photo-strip {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 4px;
}

.photo-slot {
    flex: 1;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: var(--bg-secondary, #f1f5f9);
    border: 2px dashed var(--border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted, #94a3b8);
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.photo-slot.captured {
    border: 2px solid var(--primary, #1565c0);
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15);
}

/* Labels sous la bande (Face / Gauche / …) */
.photo-step-labels {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.photo-step-labels span {
    flex: 1;
    text-align: center;
    font-size: 0.62rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
