/* ============================================================
   RQTH Questionnaire Public CSS v2
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --rqth-primary:  #1e3a5f;
    --rqth-logo-size: 300px;
    --rqth-pos:      #16a34a;
    --rqth-neg:      #dc2626;
    --rqth-inc:      #d97706;
    --rqth-border:   #e2e8f0;
    --rqth-radius:   16px;
    --rqth-shadow:   0 8px 32px rgba(0,0,0,.1);
}

body.rqth-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(160deg, #f0f4ff 0%, #f8fafc 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.65;
}

/* Page wrapper */
.rqth-page { display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 32px 16px 80px; }

/* Logo */
.rqth-logo-area { margin-bottom: 24px; text-align: center; }
.rqth-logo { max-height: var(--rqth-logo-size); max-width: var(--rqth-logo-size); object-fit: contain; }

/* Container */
.rqth-container { width: 100%; max-width: 1024px; }

/* Titre principal */
.rqth-main-title {
    font-size: clamp(17px, 3.5vw, 21px); font-weight: 700;
    text-align: center; color: #0f172a; line-height: 1.35; margin-bottom: 28px;
}

/* Messages (expired, error) */
.rqth-message {
    background: #fff; border-radius: var(--rqth-radius); padding: 56px 40px;
    text-align: center; box-shadow: var(--rqth-shadow);
}
.msg-icon   { font-size: 56px; margin-bottom: 16px; line-height: 1; }
.rqth-message h2 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.rqth-message p  { color: #64748b; font-size: 15px; margin-bottom: 8px; }
.msg-date   { font-size: 14px; color: #94a3b8; margin-top: 12px; }

/* ---- STEPS ---- */
.rqth-step {
    display: none; background: #fff; border-radius: var(--rqth-radius);
    box-shadow: var(--rqth-shadow); padding: 40px;
    animation: fadeUp .28s ease forwards;
}
.rqth-step.active { display: block; }

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

/* Welcome */
.step-welcome { text-align: center; }
.welcome-icon { font-size: 52px; margin-bottom: 16px; }
.step-welcome h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.step-welcome p  { color: #64748b; font-size: 15px; margin-bottom: 28px; max-width: 440px; margin-left: auto; margin-right: auto; }

/* Step title */
.step-title { font-size: 18px; font-weight: 700; margin-bottom: 24px; color: #0f172a; }

/* Form fields */
.rqth-field-group { margin-bottom: 18px; }
.rqth-field-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.rqth-field-group input,
.rqth-field-group select {
    width: 100%; padding: 11px 14px; font-size: 15px;
    border: 1.5px solid var(--rqth-border); border-radius: 9px;
    background: #fafafa; outline: none; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.rqth-field-group input:focus,
.rqth-field-group select:focus { border-color: var(--rqth-primary); box-shadow: 0 0 0 3px rgba(30,58,95,.1); background: #fff; }

/* Navigation */
.step-nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 28px; flex-wrap: wrap;
}

/* Boutons */
.rqth-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 13px 28px; font-size: 15px; font-weight: 700;
    background: var(--rqth-primary); color: #fff; border: none;
    border-radius: 10px; cursor: pointer; font-family: inherit;
    transition: filter .15s, transform .1s; box-shadow: 0 4px 14px rgba(30,58,95,.25);
}
.rqth-btn:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.rqth-btn:active { transform: translateY(0); }
.rqth-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.rqth-btn-back {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 12px 18px; font-size: 14px; font-weight: 500;
    background: transparent; color: #64748b; border: 1.5px solid var(--rqth-border);
    border-radius: 10px; cursor: pointer; font-family: inherit; transition: all .15s;
}
.rqth-btn-back:hover { background: #f8fafc; color: #374151; }

/* ---- QUESTIONS ---- */
.q-progress-bar { height: 5px; background: #f1f5f9; border-radius: 4px; margin-bottom: 14px; overflow: hidden; }
.q-progress-fill { height: 100%; background: linear-gradient(90deg, var(--rqth-primary), #60a5fa); border-radius: 4px; transition: width .4s ease; }
.q-counter { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 20px; }

.q-body { text-align: center; }
.q-headline { font-size: 13px; color: #94a3b8; font-weight: 500; margin-bottom: 10px; }
.q-text {
    font-size: clamp(18px, 3.2vw, 24px); font-weight: 700;
    color: #0f172a; line-height: 1.45; margin-bottom: 36px;
    max-width: 100%; margin-left: auto; margin-right: auto;
}
.q-text small { font-size: 15px; font-weight: 400; color: #64748b; display: block; margin-top: 10px; line-height: 1.6; }

/* Radios */
.rqth-radios { display: flex; gap: 24px; justify-content: center; margin-bottom: 8px; }
.rqth-radio  { flex: 0 1 260px; cursor: pointer; }
.rqth-radio input { display: none; }
.rqth-radio span {
    display: block; padding: 20px; text-align: center;
    font-size: 18px; font-weight: 700;
    border: 2px solid var(--rqth-border); border-radius: 12px;
    transition: all .18s; user-select: none;
}
.rqth-radio:hover span { border-color: var(--rqth-primary); background: #eff6ff; color: var(--rqth-primary); }
.rqth-radio input:checked + span {
    background: var(--rqth-primary); border-color: var(--rqth-primary); color: #fff;
    box-shadow: 0 6px 20px rgba(30,58,95,.3);
}

/* ---- RÉSULTATS ---- */
.rqth-result { text-align: center; padding: 16px 0; }
.res-icon    { font-size: 64px; line-height: 1; margin-bottom: 14px; }
.rqth-result h2 { font-size: 24px; font-weight: 800; margin-bottom: 14px; }
.rqth-result p  { font-size: 16px; color: #374151; max-width: 500px; margin: 0 auto; line-height: 1.7; }
.res-positif  h2 { color: var(--rqth-pos); }
.res-negatif  h2 { color: var(--rqth-neg); }
.res-incertain h2 { color: var(--rqth-inc); }

/* Accompagnement */
.rqth-accomp { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--rqth-border); text-align: center; }
.rqth-accomp > p { font-size: 14px; color: #64748b; margin-bottom: 16px; }
.accomp-contacts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.accomp-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; background: #f8fafc; border: 1px solid var(--rqth-border);
    border-radius: 9px; font-size: 13px; font-weight: 500; color: #1e293b;
    text-decoration: none; transition: all .15s;
}
.accomp-item:hover { background: #eff6ff; border-color: var(--rqth-primary); color: var(--rqth-primary); }
.rqth-legal-note {
    margin-top: 20px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    line-height: 1.6;
}

/* Erreur inline */
.rqth-error {
    background: #fee2e2; border: 1px solid #fca5a5; color: #dc2626;
    border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 500;
    margin-bottom: 16px; text-align: center;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
    .rqth-step      { padding: 28px 20px; }
    .rqth-radios    { flex-direction: column; align-items: center; }
    .rqth-radio     { width: 100%; flex: none; }
    .step-nav       { flex-direction: column-reverse; }
    .rqth-btn, .rqth-btn-back { width: 100%; justify-content: center; }
}
