@layer base {
html {
    scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    color-scheme: light;
    font-family: var(--police);
    font-size: var(--t-corps);
    line-height: 1.6;
    color: var(--texte-corps);
    background: var(--fond);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--bleu-200);
    color: var(--texte);
}

h1, h2, h3 {
    font-family: var(--police-titre);
    color: var(--texte);
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 {
    font-size: var(--t-titre-grand);
    font-weight: 800;
}

h2 {
    font-size: var(--t-titre);
    font-weight: 800;
    margin-bottom: var(--e-4);
}

h3 {
    font-size: var(--t-h3);
    font-weight: 700;
    letter-spacing: -0.01em;
}

p {
    color: var(--texte-corps);
    line-height: 1.65;
}

a {
    text-decoration: none;
    color: var(--primaire);
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

p a {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

:focus-visible {
    outline: 3px solid var(--anneau-focus);
    outline-offset: 3px;
}

button {
    border: none;
    background: none;
    font-family: inherit;
}

table {
    font-size: var(--t-petit);
    font-variant-numeric: tabular-nums;
}

th {
    font-weight: 700;
    font-size: var(--t-petit);
    color: var(--texte-discret);
    background: var(--fond-alt);
}

th, td {
    text-align: left;
    padding: var(--e-3) var(--e-4);
    border-bottom: 1px solid var(--bordure);
}

img {
    border-radius: var(--r-md);
}

label {
    display: block;
    font-size: var(--t-petit);
    font-weight: 700;
    color: var(--texte);
    margin-bottom: var(--e-2);
}

input, select, textarea {
    width: 100%;
    min-height: 3rem;
    padding: var(--e-3) var(--e-4);
    border: 1px solid var(--bordure-champ);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--texte);
    transition: border-color var(--duree) ease, box-shadow var(--duree) ease;
}

input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
    min-width: 9.5rem;
}

/* Certains navigateurs (Safari iOS) peuvent peindre un input date/heure natif
   avec une bordure décalée par rapport à sa boîte CSS (largeur correcte, mais
   bordure/coin arrondi qui ne tombe pas au bon endroit). Plutôt que de rogner
   la bordure du champ lui-même (ce qui la coupe), on la rend invisible et on
   dessine la bordure/le fond sur ce cadre à la place : le rendu natif du
   contrôle n'a alors plus rien de visible à mal positionner. */
.champ-cadre {
    display: block;
    overflow: hidden;
    border: 1px solid var(--bordure-champ);
    border-radius: var(--r-md);
    background: var(--surface);
    transition: border-color var(--duree) ease, box-shadow var(--duree) ease;
}

.champ-cadre:hover {
    border-color: var(--neutre-700);
}

.champ-cadre:focus-within {
    border-color: var(--primaire);
    box-shadow: 0 0 0 3px rgba(20, 73, 201, 0.25);
}

.champ-cadre input {
    border: none;
    border-radius: 0;
    background: transparent;
}

.champ-cadre input:focus {
    box-shadow: none;
}

input[type="checkbox"], input[type="radio"] {
    width: auto;
    min-height: 0;
    padding: 0;
    accent-color: var(--primaire);
}

textarea {
    min-height: 7rem;
}

select {
    appearance: none;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355637f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 1.1rem;
    cursor: pointer;
}

input::placeholder, textarea::placeholder {
    color: var(--texte-discret);
}

input:hover, select:hover, textarea:hover {
    border-color: var(--neutre-700);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid transparent;
    border-color: var(--primaire);
    box-shadow: 0 0 0 3px rgba(20, 73, 201, 0.25);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
}
