/* ==========================================================================
   Base neutre — reset, accessibilité, formulaires (commun aux deux styles)
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }

img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

address { font-style: normal; }

[hidden] { display: none !important; }

/* ---------- Accessibilité ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: fixed;
    top: 1rem; left: 1rem;
    z-index: 1000;
    padding: .75rem 1.25rem;
    background: #fff;
    color: #111;
    font-weight: 600;
    border-radius: 999px;
    transform: translateY(-200%);
    transition: transform .2s;
}
.skip-link:focus { transform: none; }

:focus-visible {
    outline: 2px solid var(--focus, currentColor);
    outline-offset: 3px;
}

main:focus { outline: none; }

/* ---------- Formulaires (base) ---------- */
.form__hp {
    position: absolute;
    left: -10000px;
    width: 1px; height: 1px;
    overflow: hidden;
}

.form__grid {
    display: grid;
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .form__grid { grid-template-columns: 1fr 1fr; }
    .field--full { grid-column: 1 / -1; }
}

.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-weight: 500; }
.field__optional, .field__hint { font-weight: 400; font-size: .875em; opacity: .75; }

.field input:not([type="checkbox"]),
.field select,
.field textarea {
    width: 100%;
    min-height: 3rem;
    padding: .75rem 1rem;
    line-height: 1.4;
    appearance: none;
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.75rem;
}
.field textarea { resize: vertical; min-height: 9rem; }

.field--check {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .75rem;
}
.field--check input {
    width: 1.25rem; height: 1.25rem;
    margin: .2rem 0 0;
    flex: none;
    accent-color: var(--focus, currentColor);
}
.field--check label { flex: 1; font-weight: 400; font-size: .9375rem; }
.field--check .field__error { flex-basis: 100%; }

.field__error {
    font-size: .875rem;
    font-weight: 500;
    color: var(--error, #B42318);
}
[aria-invalid="true"] { border-color: var(--error, #B42318) !important; }

.form-alert {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--error, #B42318);
}
.form-alert ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.form-alert a { color: inherit; }

.form__required { margin: 1.25rem 0; font-size: .875rem; opacity: .75; }

/* ---------- Lien de changement de style (usage interne) ---------- */
.theme-switch {
    position: fixed;
    right: 1rem; bottom: 1rem;
    z-index: 90;
    padding: .6rem 1rem;
    font: 600 .75rem/1 system-ui, sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    background: #222;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    [data-reveal], [data-hero-in] { opacity: 1 !important; transform: none !important; }
}
