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

/* Sans ça, les display: flex/block des composants l'emportent sur l'attribut hidden */
[hidden] {
    display: none !important;
}

:root {
    --primary: #39CFF6;
    --primary-dark: #22b4da;
    --primary-light: rgba(57, 207, 246, 0.1);
    --accent: #F39659;
    --gold: #D9B47E;
    --on-primary: #0d0d0d; /* texte sur fond cyan : blanc = contraste 1.9:1, insuffisant */
    --bg: #0d0d0d;
    --surface: #161616;
    --border: #2a2a2a;
    --text: #f0f0f0;
    --text-muted: #9a9a9a;
    --error: #FF8A80;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
    --gradient: linear-gradient(135deg, #39CFF6 0%, #D9B47E 100%);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 660px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

/* Header */
.app-header {
    text-align: center;
    padding: 18px;
    margin-bottom: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: padding 0.3s ease;
}

.brand-logo {
    height: 108px;
    width: auto;
    display: inline-block;
    transition: height 0.3s ease;
}

.app-header.compact {
    padding: 8px 14px;
    margin-bottom: 20px;
}

.app-header.compact .brand-logo {
    height: 60px;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.gradient-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--primary);
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-emoji {
    display: block;
    font-size: 48px;
    margin-bottom: 14px;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 22px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: wait;
}

.btn-block {
    width: 100%;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
    font-weight: 600;
}

.btn-ghost:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-link {
    display: block;
    margin: 20px auto 0;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.btn-link:hover {
    color: var(--primary);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

[tabindex="-1"]:focus {
    outline: none;
}

/* Landing */
.landing {
    text-align: center;
    padding: 8px 0;
}

.landing-title {
    font-size: 28px;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.landing-sub {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 22px;
}

.landing-perks {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.landing-perks li {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Progress */
.progress-wrap {
    margin-bottom: 28px;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label,
.progress-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.progress-bar {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--gradient);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question */
.q-title {
    font-size: 21px;
    margin-bottom: 22px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 22px;
}

.option {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 14px 15px;
    font-family: inherit;
    text-align: left;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.opt-letter {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(57, 207, 246, 0.25);
    transition: background 0.15s, color 0.15s;
}

.option.selected .opt-letter {
    background: var(--primary);
    color: var(--on-primary);
}

.opt-text {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.opt-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.option.selected .opt-check,
.cta-card[aria-pressed="true"] .opt-check {
    background: var(--primary);
    border-color: var(--primary);
}

.option.selected .opt-check::after,
.cta-card[aria-pressed="true"] .opt-check::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--on-primary);
}

.nav {
    display: flex;
    gap: 10px;
}

/* Results */
.results-header {
    text-align: center;
    margin-bottom: 26px;
}

.results-kicker {
    display: inline-block;
    padding: 4px 12px;
    margin-bottom: 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: var(--primary-light);
}

.results-title {
    font-size: 26px;
    margin-bottom: 10px;
}

.results-sub {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

.section-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 14px;
}

.section-sep::before,
.section-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.section-sep span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.result-formations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.formation-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    font-family: inherit;
    text-align: left;
    color: var(--text);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(57, 207, 246, 0.05) 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.formation-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.formation-card.selected {
    border-color: var(--primary);
}

.fc-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, rgba(57, 207, 246, 0.15) 0%, rgba(217, 180, 126, 0.08) 100%);
    border: 1px solid rgba(57, 207, 246, 0.2);
}

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

.fc-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}

.fc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.badge {
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
}

.badge-time {
    color: var(--primary);
    background: var(--primary-light);
    border-color: rgba(57, 207, 246, 0.25);
}

.badge-rncp {
    color: var(--gold);
    background: rgba(217, 180, 126, 0.1);
    border-color: rgba(217, 180, 126, 0.3);
}

.fc-pick {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

/* CTA choice */
.cta-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cta-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    font-family: inherit;
    text-align: left;
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.cta-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.cta-card[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--primary-light);
}

.cta-icon {
    flex-shrink: 0;
    font-size: 24px;
}

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

.cta-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.cta-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Form */
.lead-form {
    margin-top: 18px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

.form-intro {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: -6px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lead-form input,
.lead-form select {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background-color: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s;
}

.lead-form select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2339CFF6' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    text-overflow: ellipsis;
}

.lead-form select option,
.lead-form select optgroup {
    background: var(--surface);
    color: var(--text);
}

.lead-form input::placeholder {
    color: #5c5c5c;
}

.lead-form input:hover,
.lead-form select:hover {
    border-color: #3d3d3d;
}

.lead-form input:focus,
.lead-form select:focus {
    border-color: var(--primary);
}

.lead-form [aria-invalid="true"] {
    border-color: var(--error);
}

.form-error {
    color: var(--error);
    font-size: 14px;
    font-weight: 600;
}

.legal-notice {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.legal-notice a {
    color: var(--primary);
}

/* Success / meeting */
.next-step-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(57, 207, 246, 0.08) 0%, rgba(217, 180, 126, 0.05) 100%);
    border: 1px solid rgba(57, 207, 246, 0.3);
    border-radius: var(--radius);
}

.nsb-icon {
    flex-shrink: 0;
    font-size: 28px;
}

.nsb-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.nsb-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.nsb-desc b {
    color: var(--text);
}

.meeting-section {
    margin-top: 18px;
    text-align: center;
}

.meeting-section .form-intro {
    margin: 6px 0 14px;
}

.meetings-iframe-container {
    width: 100%;
}

/* Repli si le script HubSpot ne charge pas (il gère sinon la hauteur lui-même) */
.meeting-iframe {
    width: 100%;
    min-height: 700px;
    border: none;
}

@media (max-width: 520px) {
    .app { padding: 16px 16px 32px; }
    .landing-title { font-size: 23px; }
    .q-title { font-size: 18px; }
    .results-title { font-size: 22px; }
    .cta-choice,
    .field-grid { grid-template-columns: 1fr; }
    .lead-form { padding: 18px 16px; }
    .formation-card { flex-wrap: wrap; }
    .fc-pick { width: 100%; padding-left: 60px; }
}
