/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:    #1a1a2e;
    --navy2:   #16162a;
    --accent:  #e74c3c;
    --green:   #27ae60;
    --green2:  #219a52;
    --text:    #2c2c3a;
    --sub:     #6b6b7b;
    --border:  #e4e4ec;
    --bg:      #f3f3f7;
    --card-bg: #ffffff;
    --shadow:  0 8px 40px rgba(26,26,46,0.09);
    --radius:  16px;
    --font:    'DM Sans', system-ui, sans-serif;
    --font-d:  'Playfair Display', Georgia, serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 0;
}

/* Screen-reader only */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ─── HEADER ─── */
.header { background: var(--card-bg); border-bottom: 1px solid var(--border); padding: 14px 24px; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.logo { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); display: flex; align-items: center; justify-content: center; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; }
.logo-accent { color: var(--accent); }

/* Step nav */
.step-nav { display: flex; align-items: center; gap: 0; }
.step-dot {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
    background: var(--card-bg); color: var(--sub); font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.step-dot.active { border-color: var(--navy); color: var(--navy); }
.step-dot.done { background: var(--navy); border-color: var(--navy); color: #fff; }
.step-line { width: 32px; height: 3px; border-radius: 2px; background: var(--border); transition: background 0.25s; }
.step-line.done { background: var(--navy); }

/* ─── MAIN ─── */
.main { max-width: 540px; margin: 0 auto; padding: 28px 16px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 28px 40px;
}

/* Step block */
.step-block { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.step-icon-wrap {
    width: 64px; height: 64px; border-radius: 16px; background: #f0f0f8;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.step-title { font-family: var(--font-d); font-size: 24px; font-weight: 800; color: var(--navy); text-align: center; margin-bottom: 4px; }
.step-sub { font-size: 14px; color: var(--sub); text-align: center; margin-bottom: 24px; }

/* Info / Tip boxes */
.info-box {
    display: flex; gap: 14px; align-items: flex-start;
    background: #f0f0f8; border: 1px solid #dddde8; border-radius: 12px;
    padding: 16px 18px; margin-bottom: 24px;
}
.info-box svg { flex-shrink: 0; margin-top: 2px; }
.info-box strong { font-size: 14px; color: var(--navy); display: block; margin-bottom: 3px; }
.info-box p { font-size: 13px; color: var(--sub); margin: 0; }

.tip-box {
    display: flex; gap: 10px; align-items: flex-start;
    background: #fffbeb; border: 1px solid #f0dfa0; border-radius: 10px;
    padding: 12px 16px; margin-bottom: 20px; font-size: 13px; color: #7d6608;
}
.tip-box svg { flex-shrink: 0; margin-top: 1px; }

/* ─── CARD GRIDS (documents / countries / payments) ─── */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 28px; }

.doc-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    border: 2px solid var(--border); border-radius: 14px;
    padding: 20px 12px 16px; cursor: pointer; background: var(--card-bg);
    transition: all 0.2s ease; position: relative; overflow: hidden;
}
.doc-card:hover { border-color: #c0c0d0; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.doc-card input:checked + .doc-card-icon ~ .doc-card-check { opacity: 1; }
.doc-card input:checked + .doc-card-icon { color: var(--navy); }
/* We use JS to toggle .selected for styling since label+input radio checked styling is complex */
.doc-card.selected { border-color: var(--navy); background: #f4f4fb; box-shadow: 0 4px 16px rgba(26,26,46,0.12); }
.doc-card.selected .doc-card-check { opacity: 1; }

.doc-card-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--sub); margin-bottom: 10px; transition: color 0.2s; }
.doc-card.selected .doc-card-icon { color: var(--navy); }
.doc-card-label { font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.3; }
.doc-card-specs { font-size: 11px; color: var(--sub); margin-top: 3px; }
.doc-card-check {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px; border-radius: 50%; background: var(--navy);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}

/* Country grid */
.country-grid { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.country-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    border: 2px solid var(--border); border-radius: 14px;
    padding: 20px 32px 16px; cursor: pointer; background: var(--card-bg);
    transition: all 0.2s; position: relative; min-width: 140px;
}
.country-card:hover { border-color: #c0c0d0; }
.country-card.selected { border-color: var(--navy); background: #f4f4fb; box-shadow: 0 4px 16px rgba(26,26,46,0.12); }
.country-card.selected .country-check { opacity: 1; }
.country-flag { margin-bottom: 10px; }
.country-name { font-size: 15px; font-weight: 600; color: var(--navy); }
.country-check {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px; border-radius: 50%; background: var(--navy);
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s;
}

/* Payment grid */
.payment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 28px; }
.payment-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    border: 2px solid var(--border); border-radius: 14px;
    padding: 20px 10px 16px; cursor: pointer; background: var(--card-bg);
    transition: all 0.2s; position: relative;
}
.payment-card:hover { border-color: #c0c0d0; }
.payment-card.selected { border-color: var(--navy); background: #f4f4fb; box-shadow: 0 4px 16px rgba(26,26,46,0.12); }
.payment-card.selected .payment-check { opacity: 1; }
.payment-icon { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; color: var(--sub); margin-bottom: 8px; }
.payment-card.selected .payment-icon { color: var(--navy); }
.payment-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.payment-detail { font-size: 11px; color: var(--sub); margin-top: 2px; }
.payment-check {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px; border-radius: 50%; background: var(--navy);
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s;
}

/* Price badge */
.price-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--navy); color: #fff; padding: 10px 28px;
    border-radius: 30px; font-size: 22px; font-weight: 700;
    margin: 0 auto 28px; width: fit-content; left: 50%; position: relative; transform: translateX(-50%);
}

/* ─── CAMERA ─── */
.camera-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.camera-box {
    width: 300px; height: 300px; border-radius: 20px; overflow: hidden;
    background: #111; position: relative; box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}
.camera-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-box .captured-preview { width: 100%; height: 100%; object-fit: cover; position: absolute; top:0; left:0; }
.face-guide {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 130px; height: 170px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    border: 2.5px dashed rgba(255,255,255,0.45); pointer-events: none;
    animation: guidePulse 2.5s ease infinite;
}
@keyframes guidePulse { 0%,100%{ opacity:.45; } 50%{ opacity:.8; } }
.camera-placeholder {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: #666; gap: 10px; font-size: 14px;
}

/* ─── PREVIEW (step 3) ─── */
.preview-row { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-bottom: 24px; }
.preview-item { display: flex; flex-direction: column; align-items: center; }
.preview-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--sub);
    font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 5px;
}
.preview-single {
    width: 105px; height: 135px; border-radius: 8px; overflow: hidden;
    border: 2px solid var(--border); background: #fff;
}
.preview-single img { width: 100%; height: 100%; object-fit: cover; }

.preview-planche {
    width: 180px; height: 215px; background: #fff; border: 2px solid var(--border);
    border-radius: 8px; padding: 10px; display: grid;
    grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 5px;
}
.planche-cell { border-radius: 3px; overflow: hidden; background: #f0f0f0; }
.planche-cell img { width: 100%; height: 100%; object-fit: cover; }

/* Receive box */
.receive-box {
    background: #f8f9fc; border: 1px solid var(--border); border-radius: 12px;
    padding: 18px 20px; margin-bottom: 24px;
}
.receive-title {
    font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.receive-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.receive-item:last-child { margin-bottom: 0; }
.receive-item svg { flex-shrink: 0; margin-top: 1px; }
.receive-item span { font-size: 13px; color: #444; line-height: 1.45; }

/* Form group */
.form-group { margin-bottom: 8px; }
.form-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px;
}
.form-group input[type="email"] {
    width: 100%; padding: 13px 16px; border-radius: 10px;
    border: 2px solid var(--border); font-size: 15px; font-family: var(--font);
    outline: none; transition: border-color 0.2s; background: var(--card-bg); color: var(--text);
}
.form-group input[type="email"]:focus { border-color: var(--navy); }
.form-group input[type="email"]::placeholder { color: #aaa; }

/* ─── BUTTONS ─── */
.btn-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
    border-radius: 10px; font-size: 14px; font-weight: 600; font-family: var(--font);
    cursor: pointer; border: none; text-decoration: none; transition: all 0.2s;
    white-space: nowrap;
}
.btn-ghost { background: #f0f0f4; color: var(--navy); }
.btn-ghost:hover { background: #e6e6ec; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy2); box-shadow: 0 4px 14px rgba(26,26,46,0.25); }

.btn-capture {
    background: var(--accent); color: #fff; padding: 14px 32px; font-size: 15px;
    box-shadow: 0 4px 14px rgba(231,76,60,0.3);
}
.btn-capture:hover { background: #c0392b; box-shadow: 0 4px 18px rgba(231,76,60,0.4); }

.btn-pay {
    background: var(--green); color: #fff; padding: 14px 28px; font-size: 15px; font-weight: 700;
    box-shadow: 0 4px 14px rgba(39,174,96,0.3);
}
.btn-pay:hover { background: var(--green2); box-shadow: 0 4px 18px rgba(39,174,96,0.4); }

/* ─── CONFIRMATION ─── */
.confirmation { text-align: center; padding: 20px 0; }
.confirm-icon { margin: 0 auto 20px; }
.confirm-title { margin-bottom: 8px; }
.confirm-sub { max-width: 380px; margin: 0 auto 24px; color: var(--sub); font-size: 14px; line-height: 1.5; }
.secure-note {
    display: flex; align-items: flex-start; gap: 12px;
    background: #eafaf2; border: 1px solid #c8ecd6; border-radius: 10px;
    padding: 16px 18px; max-width: 400px; margin: 0 auto; text-align: left;
}
.secure-note svg { flex-shrink: 0; margin-top: 2px; }
.secure-note span { font-size: 13px; color: #1e8449; line-height: 1.45; }

/* ─── FOOTER ─── */
.footer {
    max-width: 540px; margin: 0 auto; padding: 20px 16px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: #aaa;
}
.footer-flag { display: flex; align-items: center; gap: 6px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .card { padding: 28px 18px 32px; border-radius: 12px; }
    .doc-grid { grid-template-columns: repeat(2, 1fr); }
    .payment-grid { grid-template-columns: 1fr; }
    .camera-box { width: 280px; height: 280px; }
    .preview-row { gap: 16px; }
}
