/* Le site du lien de paiement, avec les jetons des apps (core/designsystem : AfreeColors, AfreeSpacing), comme le portail.
   Une colonne étroite, lisible à 320 px ; clair par défaut, sombre avec les jetons sombres. Pas de framework, pas de script. */

@font-face {
    font-family: "Manrope";
    src: url("fonts/manrope.ttf") format("truetype");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --header-blue: #002455;
    --accent-blue: #0D47A1;
    --success-green: #17A566;
    --failure-red: #C62828;
    --bg: #F8F9FA;
    --fg: #333333;
    --fg-muted: #616161;
    --line: #DDDDDD;
    /* Le bord d'un champ se voit : 3:1 au moins sur le panneau (WCAG 1.4.11), ce que --line ne fait pas. */
    --field-line: #8C8C8C;
    --panel: #FFFFFF;
    --link: var(--accent-blue);
    --error-bg: #FDECEA;
    --radius: 12px;
    --gap: 16px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0E1621;
        --fg: #E8EAED;
        --fg-muted: #A5ABB3;
        --line: #2A3442;
        --field-line: #6B7888;
        --panel: #16202D;
        --link: #8AB4F8;
        --error-bg: #3B1717;
        --failure-red: #FF8A80;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

.topbar { display: flex; flex-wrap: wrap; gap: 0 var(--gap); align-items: center; justify-content: space-between; padding: 4px var(--gap); background: var(--header-blue); color: #FFFFFF; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.brand img { width: 28px; height: 28px; }
.langs { display: flex; gap: 4px; font-size: 14px; }
/* Une cible de 44 px de haut pour le doigt, sans grossir le texte. */
.langs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: #FFFFFFB3; text-decoration: none; }
.langs a[aria-current="true"] { color: #FFFFFF; font-weight: 700; text-decoration: underline; }

.page { max-width: 480px; margin: 0 auto; padding: var(--gap); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px var(--gap); }
h1 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; overflow-wrap: anywhere; }
h2 { font-size: 18px; margin: 16px 0 8px; }
.kicker { margin: 0 0 4px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); overflow-wrap: anywhere; }
.muted, .hint { color: var(--fg-muted); }
.hint { font-size: 14px; margin: 4px 0 12px; }
.bound { display: block; }

.form { margin-top: 16px; }
.row { display: flex; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 600; }
.field span { font-size: 14px; }
input, select { font: inherit; font-weight: 500; color: var(--fg); background: var(--bg); border: 1px solid var(--field-line); border-radius: 8px; padding: 12px; min-height: 48px; width: 100%; }
/* Le champ fautif : bord rouge plus épais, et son message juste dessous (pas seulement la couleur). */
[aria-invalid="true"] { border: 2px solid var(--failure-red); }
.field-error { margin: -8px 0 12px; font-size: 14px; font-weight: 600; color: var(--failure-red); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 24px; border: 2px solid var(--link); color: var(--link); background: transparent; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn-primary { width: 100%; background: var(--accent-blue); border-color: var(--accent-blue); color: #FFFFFF; letter-spacing: .04em; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }

.problem { background: var(--error-bg); color: var(--failure-red); border-radius: 8px; padding: 12px; font-weight: 600; }
.amount { font-size: 32px; font-weight: 800; margin: 8px 0 12px; }
.state { font-size: 40px; font-weight: 800; margin: 0; }
.state-ok { color: var(--success-green); }
/* Un lien déjà payé : le titre le dit, la coche le montre ; l'état n'est pas une erreur. */
.state + h1 { margin-top: 4px; }
.state-ko { color: var(--failure-red); }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 12px; margin: 0; }
.facts dt { color: var(--fg-muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: break-word; }
.mono { font-variant-numeric: tabular-nums; }
.spinner { width: 32px; height: 32px; border: 4px solid var(--line); border-top-color: var(--accent-blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.logo { display: block; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; border: 1px solid var(--line); }
.reason { font-size: 18px; font-weight: 600; margin: 4px 0 12px; overflow-wrap: anywhere; }
.facts dd.strong { font-size: 18px; font-weight: 800; }
.facts + .problem, .facts + .muted { margin-top: 16px; }
.center { text-align: center; margin: 0; }
.facts ~ .form { margin-top: 20px; }
.facts + .hint { margin: 12px 0 0; }
.report { text-align: center; font-size: 14px; margin: 4px 0 0; }
.report a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
.done { font-weight: 600; }
textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--field-line); border-radius: 8px; padding: 12px; width: 100%; resize: vertical; }
.foot { text-align: center; color: var(--fg-muted); font-size: 13px; padding: 8px var(--gap) 24px; }
