/* apply.coach — wizard start.php */

.wizard {
    padding: 60px 0 100px;
    min-height: calc(100vh - 70px);
}

.wizard-inner {
    max-width: 720px;
    transition: max-width 0.3s ease;
}
/* Step 3 plus large pour accueillir contexte + cv-match côte à côte + 4 cards/ligne */
.wizard-inner:has(.wiz-step.is-active[data-step="3"]) {
    max-width: 1080px;
}

.wiz-progress {
    margin-bottom: 36px;
}

.wiz-progress-bar {
    height: 4px;
    background: var(--surface);
    border-radius: 999px;
    overflow: hidden;
}

.wiz-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    transition: width 0.35s ease;
    width: 33%;
}

.wiz-step-label {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: right;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wiz-step {
    display: none;
    animation: wiz-fade 0.25s ease;
}

.wiz-step.is-active { display: block; }

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

.wiz-step h1 {
    font-size: clamp(28px, 4vw, 36px);
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    font-weight: 700;
}

.wiz-lead {
    color: var(--text-muted);
    font-size: 16.5px;
    margin: 0 0 36px;
    max-width: 580px;
}

/* ─── Form ──────────────────────────────────────────────────────────────── */
.wiz-form { width: 100%; }

.wiz-field {
    display: block;
    margin-bottom: 22px;
}

.wiz-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.wiz-label small {
    display: inline;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 6px;
}

.wiz-form input[type="text"],
.wiz-form input[type="email"],
.wiz-form input[type="url"],
.wiz-form textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 15.5px;
    padding: 13px 15px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.wiz-form input:focus,
.wiz-form textarea:focus {
    border-color: var(--accent);
    background: var(--surface);
}

.wiz-form textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.5;
}

.wiz-hint {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

.btn-block { width: 100%; }

.wiz-sep {
    text-align: center;
    margin: 22px 0;
    position: relative;
    color: var(--text-muted);
    font-size: 13px;
}

.wiz-sep::before,
.wiz-sep::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background: var(--border);
}
.wiz-sep::before { left: 0; }
.wiz-sep::after  { right: 0; }

.wiz-sep span {
    background: var(--bg);
    padding: 0 12px;
    position: relative;
}

#btn-google {
    margin-top: 0;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────── */
.wiz-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    width: fit-content;
}

.wiz-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.wiz-tab:hover:not(.is-active) { color: var(--text); }
.wiz-tab.is-active {
    background: var(--bg);
    color: var(--text);
}

.wiz-tab-panel { display: none; }
.wiz-tab-panel.is-active { display: block; }

/* ─── Actions row ───────────────────────────────────────────────────────── */
.wiz-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
}

.wiz-actions-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 560px) {
    .wiz-actions-3 {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .wiz-actions-3 .wiz-actions-right {
        flex-direction: column-reverse;
    }
    .wiz-actions-3 .wiz-actions-right .btn {
        width: 100%;
    }
}

/* ─── Modale de confirmation ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 18, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    animation: modalFadeIn 160ms ease-out;
}
.modal-overlay[hidden] { display: none; }

.modal-dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px 28px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    animation: modalPopIn 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text);
}

.modal-lead {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0 0 28px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.modal-actions .btn { min-width: 140px; }

@media (max-width: 480px) {
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
}

@keyframes modalFadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes modalPopIn   { from { opacity: 0; transform: translateY(8px) scale(0.97) } to { opacity: 1; transform: none } }

/* ─── Avertissement "Pas de CV" (Step 1) ────────────────────────────────── */
.wiz-cv-warning {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(251, 146, 60, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin: 24px 0 16px;
}
.wiz-cv-warning-icon { font-size: 28px; line-height: 1; }
.wiz-cv-warning-body strong {
    display: block;
    color: var(--text);
    font-size: 15.5px;
    margin-bottom: 6px;
}
.wiz-cv-warning-body p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
}
.wiz-cv-warning-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.wiz-cv-warning-dismiss {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    line-height: 1.4;
    text-decoration: none;
    border-radius: 6px;
}
.wiz-cv-warning-dismiss:hover {
    color: var(--text);
    background: var(--tint-strong);
}

/* ─── Inline error banner (Step 2) ──────────────────────────────────────── */
.wiz-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 8px 0 18px;
    font-size: 14px;
    line-height: 1.5;
}

/* ─── Spinner inside the submit button ──────────────────────────────────── */
.s2-submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    animation: spin 0.7s linear infinite;
}

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

.btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* ─── Recap panel (Step 3, on top of personas) ──────────────────────────── */
/* Row 2 colonnes : récap contexte (gauche) + carte cv-match (droite). */
.wiz-context-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}
@media (max-width: 800px) {
    .wiz-context-row { grid-template-columns: 1fr; }
}

.wiz-recap {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    /* margin-bottom retiré : géré par .wiz-context-row */
}

.wiz-recap-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.wiz-recap-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.wiz-recap-redo {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    text-align: right;
    padding: 0;
    line-height: 1.4;
}
.wiz-recap-redo:hover { color: var(--text); }
.wiz-recap-redo strong {
    display: block;
    color: var(--accent);
    font-weight: 600;
}
.wiz-recap-redo:hover strong { color: var(--accent-hover); }

.wiz-recap-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
}

.wiz-recap-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
}
.wiz-recap-row:first-child { border-top: none; padding-top: 0; }

.wiz-recap-row dt {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.wiz-recap-row dd {
    color: var(--text);
    font-size: 14.5px;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .wiz-recap-row { grid-template-columns: 1fr; gap: 4px; }
    .wiz-recap-header { flex-direction: column; }
}

/* ─── Persona pick (Step 3) ─────────────────────────────────────────────── */
/* 8 cartes (1 random + 7 personas) → 4 par ligne sur desktop = 2 lignes pile poil. */
.wiz-personas {
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) {
    .wiz-personas { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .wiz-personas { grid-template-columns: 1fr; }
}

/* Carte "Coach surprise" : différenciée visuellement */
.persona-pick-random {
    background: linear-gradient(135deg, rgba(91, 140, 255, 0.10), rgba(139, 92, 246, 0.10));
    border: 1px dashed rgba(91, 140, 255, 0.45) !important;
}
.persona-pick-random .persona-emoji {
    animation: random-dice 4s ease-in-out infinite;
}
@keyframes random-dice {
    0%, 100% { transform: rotate(0deg); }
    20%      { transform: rotate(-15deg); }
    40%      { transform: rotate(20deg); }
    60%      { transform: rotate(-10deg); }
    80%      { transform: rotate(8deg); }
}
.difficulty-random {
    background: linear-gradient(135deg, rgba(91, 140, 255, 0.20), rgba(139, 92, 246, 0.20));
    color: var(--accent-hover) !important;
}

/* ─── Carte preview CV match (Step 3, au-dessus des personas) ───────────── */
.cvm-preview {
    --cvm-color: var(--text-muted);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    min-height: 84px;
    display: flex;
    align-items: center;
}
.cvm-preview .cvm-loading,
.cvm-preview .cvm-ready,
.cvm-preview .cvm-empty {
    display: none;
    width: 100%;
}
.cvm-preview.is-loading .cvm-loading { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 14.5px; }
.cvm-preview.is-ready   .cvm-ready   { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; width: 100%; }
.cvm-preview.is-empty   .cvm-empty   { display: flex; align-items: center; gap: 14px; width: 100%; }
.cvm-preview.is-ready   { border-color: var(--cvm-color); }

.cvm-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    border-radius: 12px;
    border: 2px solid var(--cvm-color);
    color: var(--cvm-color);
}
.cvm-num { font-size: 26px; font-weight: 800; line-height: 1; }
.cvm-max { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.75; margin-top: 2px; }
.cvm-body h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--text); }
.cvm-summary { margin: 0 0 10px; color: var(--text); font-size: 14px; line-height: 1.55; }
.cvm-bar {
    height: 6px; background: var(--surface); border-radius: 999px; overflow: hidden;
}
.cvm-bar > span {
    display: block; height: 100%; border-radius: 999px;
    background: var(--cvm-color); transition: width 0.5s ease;
    width: 0;
}
.cvm-empty-icon { font-size: 28px; }
.cvm-empty-msg  { flex: 1; margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }

.persona-pick {
    position: relative;
    cursor: pointer;
    display: block;
}

.persona-pick input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.persona-pick:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.persona-pick .persona-name,
.persona-pick .persona-desc {
    display: block;
}
