/* ========================================================================
   Relance — Styles
   ======================================================================== */

/* --- Reset & Variables ------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #F5F3EE;
    --surface: #FFFFFF;
    --text: #1C1C1E;
    --text-muted: #71706E;
    --accent: #BF4A30;
    --accent-dark: #9E3A24;
    --accent-light: rgba(191, 74, 48, 0.07);
    --border: #E0DDD6;
    --border-focus: #BF4A30;
    --success: #2D7D46;
    --success-light: rgba(45, 125, 70, 0.08);
    --error: #C0392B;
    --error-light: rgba(192, 57, 43, 0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- French tricolor bar ----------------------------------------------- */
.french-bar {
    height: 3px;
    background: linear-gradient(90deg, #002395 33.33%, #FFFFFF 33.33%, #FFFFFF 66.66%, #ED2939 66.66%);
}

/* --- Layout ------------------------------------------------------------ */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container.narrow {
    max-width: 680px;
}

/* --- Header ------------------------------------------------------------ */
header {
    padding: 1.25rem 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: 'Bitter', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

/* --- Hero -------------------------------------------------------------- */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero h1 {
    font-family: 'Bitter', Georgia, serif;
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.btn-hero {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    font-size: 1.05rem;
}

/* --- Steps ------------------------------------------------------------- */
.steps {
    padding: 0 0 4rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.step {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-align: center;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--accent-light);
    color: var(--accent);
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.step h3 {
    font-family: 'Bitter', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* --- Form Section ------------------------------------------------------ */
.form-section {
    padding: 0 0 5rem;
}

.form-section h2 {
    font-family: 'Bitter', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}

form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

/* --- Fieldset ---------------------------------------------------------- */
fieldset {
    border: none;
    padding: 0;
    margin: 0 0 2rem;
}

legend {
    font-family: 'Bitter', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
    width: 100%;
    display: block;
}

/* --- Fields ------------------------------------------------------------ */
.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.required {
    color: var(--accent);
}

.optional {
    font-weight: 300;
    color: var(--text-muted);
    font-size: 0.85rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 4rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}

input::placeholder,
textarea::placeholder {
    color: #B5B3AE;
    font-weight: 300;
}

/* --- Radio Cards ------------------------------------------------------- */
.radio-cards {
    display: grid;
    gap: 0.75rem;
}

.radio-cards.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.radio-cards.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.radio-card {
    position: relative;
}

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

.radio-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 4rem;
    margin-bottom: 0;
}

.radio-card label strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.radio-card label span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 300;
}

.radio-card label:hover {
    border-color: #C5C2BB;
    background: rgba(0,0,0,0.01);
}

.radio-card input[type="radio"]:checked + label {
    border-color: var(--accent);
    background: var(--accent-light);
}

.radio-card input[type="radio"]:checked + label strong,
.radio-card input[type="radio"]:checked + label span {
    color: var(--accent-dark);
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease, transform 0.1s ease;
    line-height: 1.4;
}

.btn:hover {
    background: var(--accent-dark);
}

.btn:active {
    transform: scale(0.98);
}

.btn-submit {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.btn:disabled,
.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* --- Form errors ------------------------------------------------------- */
.form-errors {
    display: none;
    background: var(--error-light);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.form-errors.visible {
    display: block;
}

.form-errors p {
    font-size: 0.9rem;
    color: var(--error);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.form-errors p:last-child {
    margin-bottom: 0;
}

/* --- Result Section (success / cancel / expired) ----------------------- */
.result-section {
    padding: 5rem 0;
    min-height: 60vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.result-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    text-align: center;
}

.result-card h1 {
    font-family: 'Bitter', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.result-card p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 300;
    line-height: 1.7;
}

.result-card .btn {
    margin-top: 1.5rem;
    display: inline-block;
}

.result-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    background: var(--success-light);
    color: var(--success);
}

.error-icon {
    background: var(--error-light);
    color: var(--error);
}

.result-card.success {
    border-top: 3px solid var(--success);
}

.result-card.error-card {
    border-top: 3px solid var(--error);
}

.note {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    margin-top: 1rem;
}

/* --- Spinner ----------------------------------------------------------- */
.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

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

/* --- Footer ------------------------------------------------------------ */
footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* --- Legal pages ------------------------------------------------------- */
.legal-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.legal-page h1 {
    font-family: 'Bitter', serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.legal-page h2 {
    font-family: 'Bitter', serif;
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--text);
}

.legal-page p,
.legal-page li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.legal-page ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .radio-cards.three-cols {
        grid-template-columns: 1fr;
    }

    .radio-cards.two-cols {
        grid-template-columns: 1fr;
    }

    form {
        padding: 1.5rem;
    }

    .hero {
        padding: 3rem 0 2.5rem;
    }

    .result-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    form {
        padding: 1.25rem;
    }
}
