/* =========================================================================
   Ycéo Info Trafic — page « Alerte Info Trafic par SMS »
   Contrastes vérifiés (WCAG AA) : texte #1a1a1a / #3a3d3d sur blanc, accent #00717b (5,8:1 avec du blanc),
   bordures de champs #767a7a (4,4:1), erreurs #8c1d18 (9:1). Tailles en rem, cibles >= 44 px.
   ========================================================================= */
.yit-sms {
    --yit-sms-accent: #00717b;
    --yit-sms-accent-dark: #004f57;
    --yit-sms-text: #1a1a1a;
    --yit-sms-muted: #3a3d3d;
    --yit-sms-hint: #5f6363;
    --yit-sms-border: #767a7a;
    --yit-sms-error: #8c1d18;
    --yit-sms-ok: #1b5e2c;

    box-sizing: border-box;
    max-width: 680px;
    margin: 40px auto;
    padding: 0 16px 60px;
    color: var(--yit-sms-text);
    font-size: 1rem;
    line-height: 1.55;
}

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

.yit-sms-card {
    padding: 36px 40px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
}

.yit-sms-title { margin: 0 0 10px; font-size: 1.625rem; font-weight: 700; line-height: 1.25; color: var(--yit-sms-text); }
.yit-sms h2 { margin: 0 0 12px; font-size: 1.25rem; font-weight: 700; color: var(--yit-sms-text); }
.yit-sms h3 { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 700; color: var(--yit-sms-text); }
.yit-sms p { margin: 0 0 12px; }
.yit-sms-lead { color: var(--yit-sms-muted); margin-bottom: 24px !important; }
.yit-sms-hint { margin: 0 0 8px; font-size: 0.875rem; color: var(--yit-sms-hint); line-height: 1.5; }
.yit-sms-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid #c9cccc; }
.yit-sms-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.yit-sms a { color: var(--yit-sms-accent); text-decoration: underline; }
.yit-sms a:hover { color: var(--yit-sms-accent-dark); }
.yit-sms hr { border: 0; border-top: 1px solid #c9cccc; margin: 20px 0; }
.yit-sms-warning { padding: 12px 16px; border: 2px solid var(--yit-sms-error); border-radius: 10px; color: var(--yit-sms-error); font-weight: 600; }
.yit-sms-back { margin-top: 24px; font-size: 0.9375rem; }

/* --- Champs ------------------------------------------------------------- */
.yit-field { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.yit-field label, .yit-field legend { display: block; margin: 0 0 4px; padding: 0; font-size: 0.9375rem; font-weight: 600; color: var(--yit-sms-text); }
.yit-sms input[type="email"],
.yit-sms input[type="tel"],
.yit-sms input[type="text"] {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 2px solid var(--yit-sms-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--yit-sms-text);
    font: inherit;
    font-size: 1rem;
}
.yit-sms input[aria-invalid="true"] { border-color: var(--yit-sms-error); }
.yit-code-input { max-width: 220px; font-size: 1.25rem !important; letter-spacing: 0.2em; }
.yit-field-error { margin: 6px 0 0; font-size: 0.875rem; font-weight: 600; color: var(--yit-sms-error); }

.yit-check { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.yit-check input[type="checkbox"] { flex: 0 0 auto; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--yit-sms-accent); }
.yit-check-sub { margin: 6px 0 0 36px; }

/* Champ piège anti-robot : hors écran, sans être masqué par display:none (les robots le verraient). */
.yit-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Choix des lignes ------------------------------------------------------ */
.yit-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }

/* Une ligne = son logo seul, sans bordure qui le longe. L'état se lit sur la pastille d'angle :
   cercle vide = non suivie, cercle plein avec coche = suivie (jamais la couleur seule). */
.yit-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
    padding: 8px 12px 8px 8px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--yit-sms-text);
    font: inherit;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}
.yit-chip:hover { background: #f3f4f4; }
.yit-chip[aria-pressed="true"] { background: #e3f1f2; }
.yit-chip .yit-badge { box-shadow: none; cursor: inherit; flex: 0 0 auto; margin: 0; height: 44px; }
.yit-chip .yit-badge-logo { width: 44px; }
.yit-chip .yit-chip-check {
    position: absolute;
    top: 2px;
    right: 2px;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    padding: 3px;
    border: 2px solid var(--yit-sms-border);
    border-radius: 50%;
    background: #ffffff;
    color: transparent;
}
.yit-chip[aria-pressed="true"] .yit-chip-check { border-color: #000000; background: #000000; color: #ffffff; }
.yit-chips { gap: 6px; }

.yit-sms-count { margin: 0 0 6px; font-size: 0.875rem; color: var(--yit-sms-muted); }
.yit-sms-status { min-height: 1.6em; margin: 10px 0 14px; font-weight: 600; color: var(--yit-sms-ok); }
.yit-sms-note { padding: 14px 16px; border-radius: 10px; background: #f3f4f4; color: var(--yit-sms-muted); font-size: 0.9375rem; }

/* --- Boutons ----------------------------------------------------------------- */
.yit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 2px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
}
.yit-btn-block { display: flex; width: 100%; min-height: 52px; }
.yit-btn-primary { background: var(--yit-sms-accent); color: #ffffff; }
.yit-btn-primary:hover { background: var(--yit-sms-accent-dark); }
.yit-btn-secondary { background: #ffffff; color: var(--yit-sms-text); border-color: var(--yit-sms-text); }
.yit-btn-secondary:hover { background: #f3f4f4; }
.yit-btn-danger { background: #ffffff; color: var(--yit-sms-error); border-color: var(--yit-sms-error); }
.yit-btn-danger-solid { background: var(--yit-sms-error); color: #ffffff; }
.yit-btn[aria-disabled="true"] { opacity: 0.75; cursor: progress; }
.yit-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- Erreurs, résultats ------------------------------------------------------------ */
.yit-errors {
    margin: 0 0 22px;
    padding: 14px 18px;
    border: 2px solid var(--yit-sms-error);
    border-radius: 10px;
    background: #ffffff;
    color: var(--yit-sms-error);
    font-weight: 600;
}
.yit-errors h3 { margin: 0 0 6px; color: var(--yit-sms-error); }
.yit-errors ul { margin: 0; padding-left: 20px; font-weight: 400; }
.yit-errors a { color: var(--yit-sms-error); }

.yit-sms-result { margin-top: 16px; padding: 18px 20px; border-radius: 10px; background: #f3f4f4; }
.yit-sms-result.is-ok { border: 2px solid var(--yit-sms-ok); background: #ffffff; color: var(--yit-sms-ok); font-weight: 600; }
.yit-sms-result.is-error { border: 2px solid var(--yit-sms-error); background: #ffffff; color: var(--yit-sms-error); font-weight: 600; }

.yit-confirm-box { padding: 18px; border: 2px solid var(--yit-sms-error); border-radius: 10px; }
.yit-confirm-box h3 { color: var(--yit-sms-error); }

/* --- Focus visible : double anneau lisible sur fond clair ET foncé --------------------- */
.yit-sms a:focus-visible,
.yit-sms button:focus-visible,
.yit-sms input:focus-visible,
.yit-sms [tabindex="-1"]:focus-visible,
.yit-sms .yit-errors:focus,
.yit-sms .yit-sms-result:focus {
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px #ffffff;
}

@media (max-width: 600px) {
    .yit-sms { margin: 16px auto; padding: 0 8px 40px; }
    .yit-sms-card { padding: 24px 18px; }
    .yit-btn { width: 100%; }
    .yit-actions .yit-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .yit-sms * { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
    .yit-chip[aria-pressed="true"] { outline: 3px solid Highlight; }
    .yit-btn { border: 2px solid ButtonText; }
}

/* --- Texte réservé aux lecteurs d'écran --------------------------------------------- */
.yit-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* --- Texte réservé aux lecteurs d'écran --------------------------------------------- */
.yit-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* --- Onglets « Je m'inscris » / « Déjà inscrit ? » : commutateur segmenté ---------------- */
.yit-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 28px; padding: 5px; border-radius: 14px; background: #e9ecec; }
.yit-sms .yit-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    margin: 0;
    padding: 8px 12px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--yit-sms-muted);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.yit-sms .yit-tab svg { flex: 0 0 auto; }
.yit-sms .yit-tab:hover { background: rgba(255, 255, 255, .6); color: var(--yit-sms-text); }
.yit-sms .yit-tab[aria-selected="true"] {
    background: #ffffff;
    color: var(--yit-sms-accent-dark);
    font-weight: 700;
    border-color: var(--yit-sms-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.yit-sms .yit-tab:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; box-shadow: 0 0 0 6px #ffffff; }
.yit-tabpanel { margin-top: 0 !important; padding-top: 0 !important; border-top: 0 !important; }
@media (max-width: 600px) { .yit-sms .yit-tab { flex-direction: column; gap: 4px; padding: 8px 6px; font-size: .9375rem; } }
@media (forced-colors: active) { .yit-sms .yit-tab[aria-selected="true"] { border-color: Highlight; outline: 2px solid Highlight; } }

.yit-linkbtn { display: inline; min-height: 44px; padding: 0 6px; margin: 2px 4px 2px 0; border: 0; background: none; color: var(--yit-sms-accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.yit-linkbtn:hover { color: var(--yit-sms-accent-dark); }

.yit-selall { margin: 0 0 4px; }
.yit-selall .yit-linkbtn { margin: 0; padding-left: 0; }

/* Bouton « Tout sélectionner / Tout désélectionner » */
.yit-selall { margin: 4px 0 8px; }
.yit-sms .yit-selall-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
    padding: 0 18px 0 14px;
    border: 2px solid var(--yit-sms-accent-dark);
    border-radius: 999px;
    background: #ffffff;
    color: var(--yit-sms-accent-dark);
    font: inherit;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.yit-sms .yit-selall-btn:hover { background: var(--yit-sms-accent-dark); color: #ffffff; }
.yit-sms .yit-selall-btn[data-state="all"] { background: #e3f1f2; }
.yit-sms .yit-selall-btn[data-state="all"]:hover { background: var(--yit-sms-accent-dark); }
.yit-sms .yit-selall-btn svg { flex: 0 0 auto; }
@media (forced-colors: active) { .yit-sms .yit-selall-btn { border-color: ButtonText; } }
