:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --muted: #6b6b6b;
    --line: #e2e2e2;
    --hover: #f5f5f5;
    --accent: #1a1a1a;
    --error: #b3261e;
    --success: #2e7d32;

    --card-bg: #fafafa;
    --input-bg: #eeeeee;
    --input-bg-focus: #e4e4e4;
    --radius: 10px;
}

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

[hidden] {
    display: none !important;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

main {
    width: 100%;
    max-width: 560px;
}

header {
    margin-bottom: 32px;
    text-align: left;
}

h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

header p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

.retour {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.retour:hover,
.retour:focus-visible {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* ==========================================================================
   FORMULAIRE — carte
   ========================================================================== */

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
}

.champ-ligne {
    display: flex;
    gap: 16px;
}

.champ-ligne .champ {
    flex: 1;
}

.champ {
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

label .optionnel {
    color: var(--muted);
    font-weight: 400;
}

input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
    width: 100%;
    border: 1px solid transparent;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 12px 14px;
    border-radius: var(--radius);
    outline: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
}

input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input[type="text"]:hover,
input[type="tel"]:hover,
input[type="email"]:hover,
textarea:hover {
    background-color: var(--input-bg-focus);
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
textarea:focus {
    background-color: var(--input-bg-focus);
    border-color: var(--text);
}

/* ==========================================================================
   CASES À COCHER / RADIOS — style personnalisé
   ========================================================================== */

.raison-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.raison-options label,
.entreprise-case {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}

.case {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.case input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.case-visuel {
    position: absolute;
    inset: 0;
    background: var(--input-bg);
    border: 1.5px solid var(--line);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.case-checkbox .case-visuel {
    border-radius: 6px;
}

.case-checkbox .case-visuel::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.12s ease;
}

.case-checkbox input:checked ~ .case-visuel {
    background: var(--accent);
    border-color: var(--accent);
}

.case-checkbox input:checked ~ .case-visuel::after {
    transform: rotate(45deg) scale(1);
}

.case-radio .case-visuel {
    border-radius: 50%;
}

.case-radio .case-visuel::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--bg);
    transform: scale(0);
    transition: transform 0.12s ease;
}

.case-radio input:checked ~ .case-visuel {
    background: var(--accent);
    border-color: var(--accent);
}

.case-radio input:checked ~ .case-visuel::after {
    transform: scale(1);
}

.case input:focus-visible ~ .case-visuel {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.entreprise-nom,
.autre-precision {
    margin-top: 16px;
}

.champ-erreur {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 8px;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.bouton-envoyer {
    display: inline-block;
    align-self: flex-start;
    margin-top: 4px;
    padding: 13px 26px;
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.bouton-envoyer:hover,
.bouton-envoyer:focus-visible {
    opacity: 0.85;
}

.bouton-envoyer:active {
    transform: scale(0.98);
}

.message-etat {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.message-etat.succes {
    background: var(--hover);
    color: var(--success);
    border: 1px solid var(--success);
}

.message-etat.erreur {
    background: var(--hover);
    color: var(--error);
    border: 1px solid var(--error);
}

.message-etat a {
    color: inherit;
    text-decoration: underline;
}

footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted);
}

footer a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

footer a:hover,
footer a:focus-visible {
    color: var(--text);
    border-bottom-color: var(--text);
}

footer .footer-links {
    display: flex;
    gap: 16px;
}

@media (max-width: 480px) {
    form {
        padding: 20px;
        border-radius: 12px;
    }

    .champ-ligne {
        flex-direction: column;
        gap: 20px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --text: #f0f0f0;
        --muted: #999999;
        --line: #2a2a2a;
        --hover: #1c1c1c;
        --accent: #f0f0f0;

        --card-bg: #171717;
        --input-bg: #232323;
        --input-bg-focus: #2b2b2b;
    }

    .case-checkbox .case-visuel::after {
        border-color: var(--bg);
    }

    .case-radio .case-visuel::after {
        background: var(--bg);
    }
}

/* Réseaux sociaux (pied de page) */
footer {
    flex-wrap: wrap;
    gap: 12px;
}

footer .footer-links {
    align-items: center;
    flex-wrap: wrap;
}

.social-links {
    display: flex;
    gap: 8px;
}

footer .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

footer .social-link:hover,
footer .social-link:focus-visible {
    color: var(--text);
    border-color: var(--text);
    transform: translateY(-2px);
}

.social-icon {
    width: 16px;
    height: 16px;
}
