/* ============================================================================
   alertes.css — page « Mes alertes » (/alertes)
   ----------------------------------------------------------------------------
   La page parlait encore le dialecte sombre historique (aplats #201f1f, champs
   #131313, utilities Tailwind) alors que la chrome et le dossier sont passés au
   thème « mémo d'acte émeraude et ivoire ». On reprend ici EXACTEMENT la
   grammaire du dossier — cf. docs/charte-graphique-dossier.md :

     · feuille encadrée (bordure émeraude + ombre douce) comme le sheet dossier ;
     · en-tête éditorial (eyebrow mono laiton, titre Archivo, double filet) ;
     · cartes autonomes blanches, en-tête intégré (titre vert foncé + pastille) ;
     · labels mono uppercase laiton, chiffres et critères en mono tabulaire ;
     · un seul aplat émeraude par groupe décisionnel : le bouton de validation.

   Aucune couleur en dur : la feuille ne consomme que les tokens publics
   `--c-*` / `--f-*` / `--fs-*` / `--sp-*` posés par dossier_v1.css et remappés
   par dossier_theme_emeraude.css (body.theme-emeraude-app).
   Namespace unique : `.alr-…` (convention maison, cf. `.fav-…`, `.px-…`).
   ============================================================================ */

/* ── Feuille : même cadre que le sheet du dossier ───────────────────────────
   Le formulaire flottait dans le vide au milieu du blanc de .app-main. Le
   cadre lui rend un bord et un fond : c'est une pièce posée sur le bureau,
   pas un widget. Marge 14px = celle du sheet dossier. */
.alr-shell {
  position: relative;
  margin: 14px auto;
  max-width: 860px;
  padding: var(--sp-6) var(--sp-6) var(--sp-8);
  background: var(--c-panel);
  border: 1px solid var(--c-accent-strong);
  box-shadow: var(--shadow-card);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
}

/* ── En-tête éditorial ─────────────────────────────────────────────────────── */
.alr-head { margin: 0; }

/* Eyebrow signature : filet laiton 22×2 px + mono uppercase (recette commune
   au listing, aux favoris et aux panneaux du dossier). */
.alr-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--f-mono);
  font-size: var(--fs-cap);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-meta);
}
.alr-head__eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--c-decor);
  flex: none;
}

.alr-head__titlerow {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: 11px;
}
.alr-head__title {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 30px;          /* calage sur l'en-tête favoris (entre --fs-section et --fs-page) */
  line-height: 1;
  letter-spacing: -0.028em;
  color: var(--c-ink);
}
/* Compteur = laiton mono, comme tous les compteurs de résultats du site. */
.alr-head__count {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-meta);
}
.alr-head__sub {
  margin: 11px 0 0;
  max-width: 64ch;
  font-size: var(--fs-base);
  color: var(--c-muted);
}

/* Double filet signature : émeraude porteur + laiton méta, 3 px d'écart. */
.alr-rule {
  height: 0;
  border: 0;
  border-top: 1px solid var(--c-accent);
  border-bottom: 1px solid var(--c-decor);
  padding-top: 3px;
  margin: var(--sp-5) 0 var(--sp-5);
}

/* ── Liste des alertes en place ─────────────────────────────────────────────
   Une alerte = une ligne de registre : nom en display, critères en jetons mono.
   Les critères étaient auparavant concaténés en une phrase à points médians,
   illisible dès trois filtres. */
.alr-list {
  display: grid;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-6);
}
.alr-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--rad-card);
  box-shadow: var(--shadow-card);
}
.alr-item__body { min-width: 0; }
.alr-item__namerow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.alr-item__name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-title);
  letter-spacing: var(--ls-tight);
  color: var(--c-ink);
}
/* État « en pause » : neutre, jamais rouge — une alerte suspendue n'est pas
   une erreur (charte § recettes, état verrouillé/archivé). */
.alr-item__state {
  font-family: var(--f-mono);
  font-size: var(--fs-cap);
  font-weight: 600;
  letter-spacing: var(--ls-cap);
  text-transform: uppercase;
  color: var(--c-muted);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 2px 9px;
}
.alr-item__crits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.alr-item__chip {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border-soft);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
/* Aucun filtre posé : ce n'est pas un critère, c'est l'absence de critère —
   on le dit en clair plutôt que de laisser une rangée vide. */
.alr-item__chip--all {
  background: transparent;
  color: var(--c-muted);
  border-style: dashed;
}
.alr-item__del {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;            /* ≥32px : cible desktop de la charte */
  border-radius: var(--rad-lg);
  border: 1px solid transparent;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  transition: color .12s, background-color .12s, border-color .12s;
}
.alr-item__del:hover {
  color: var(--c-danger);
  background: var(--c-danger-bg);
  border-color: var(--c-danger-bg);
}
.alr-item__del:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
.alr-item__del:disabled { opacity: .5; cursor: default; }
@media (pointer: coarse) {
  .alr-item__del { width: 44px; height: 44px; }
}

/* État vide : une LIGNE, pas un héros. Le formulaire de création est juste
   dessous et porte déjà l'appel à l'action ; un grand bloc centré n'aurait
   fait que remplir l'écran (CLAUDE.md, corollaire négatif de l'invariant 11). */
.alr-empty {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-6);
  padding: 11px var(--sp-4);
  font-size: var(--fs-base);
  color: var(--c-muted);
  border: 1px dashed var(--c-border);
  border-radius: var(--rad-card);
  background: var(--c-panel);
}
.alr-empty .material-symbols-outlined { font-size: 18px; color: var(--c-decor); flex: none; }

/* ── Carte « Nouvelle alerte » ──────────────────────────────────────────────
   Carte autonome + en-tête intégré blanc (2026-08-23) : ni filet ni trait
   d'accent, seule la typographie distingue la tête du corps. */
.alr-card {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--rad-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.alr-card__h {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  padding: 10px var(--sp-5) 6px;
  color: var(--c-accent-strong);
}
.alr-card__ico {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-size: 14px;
}
.alr-card__t {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-title);
  letter-spacing: var(--ls-tight);
}
.alr-card__intro {
  margin: 0;
  padding: 0 var(--sp-5);
  max-width: 68ch;
  font-size: var(--fs-base);
  color: var(--c-muted);
}
.alr-card__body { padding: var(--sp-4) var(--sp-5) var(--sp-5); }

/* ── Champs ────────────────────────────────────────────────────────────────
   Grille fluide : les colonnes se replient d'elles-mêmes plutôt que de
   dépendre d'un seuil (minmax(0,…), charte § grilles). */
.alr-form { display: grid; gap: var(--sp-4); }
.alr-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
.alr-grid--tight {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}

.alr-field { display: grid; gap: 5px; min-width: 0; }
/* Label = mono uppercase laiton : c'est une méta, pas un titre. */
.alr-field__lab {
  font-family: var(--f-mono);
  font-size: var(--fs-cap);
  font-weight: 600;
  letter-spacing: var(--ls-cap);
  text-transform: uppercase;
  color: var(--c-meta);
}
/* La précision (« vide = tous ») reste attachée au label mais sort de la
   casse mono laiton : elle se lit, elle ne s'annonce pas. */
.alr-field__hint {
  font-family: var(--f-sans);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-muted);
}

.alr-input,
.alr-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 11px;
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  color: var(--c-ink);
  background: var(--c-panel);
  border: 1px solid var(--c-border-strong);
  border-radius: 6px;
  transition: border-color .12s;
}
/* Les saisies chiffrées (prix, surface) passent en mono tabulaire : un montant
   se lit aligné, comme partout ailleurs dans le produit. */
.alr-input--num {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
}
.alr-input::placeholder { color: var(--c-muted-2); }
.alr-input:hover,
.alr-select:hover { border-color: var(--c-accent); }
.alr-input:focus-visible,
.alr-select:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-color: var(--c-accent);
}
.alr-select {
  appearance: none;
  padding-right: 30px;
  /* Chevron dessiné en masque : pas d'image externe, la teinte suit le token. */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--c-ink);
}

/* ── Types de bien : pilules de filtre (999px = statut/filtre, charte) ──── */
.alr-types { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.alr-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  min-height: 32px;
  font-size: var(--fs-sm);
  color: var(--c-ink-2);
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .12s, background-color .12s, color .12s;
}
.alr-type:hover { border-color: var(--c-accent); }
/* État coché : tint émeraude + encre vert foncé. La couleur n'est pas le seul
   signal — la case reste cochée et visible. */
.alr-type:has(:checked) {
  background: var(--c-accent-soft);
  border-color: var(--c-accent);
  color: var(--c-accent-strong);
  font-weight: 600;
}
.alr-type__box { width: 14px; height: 14px; accent-color: var(--c-accent); margin: 0; }
.alr-type:has(:focus-visible) {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
@media (pointer: coarse) { .alr-type { min-height: 44px; } }

/* ── Erreur de validation ──────────────────────────────────────────────────
   `.hidden` (Tailwind) est posé/retiré par alertes.js : on lui rend la main
   avec une spécificité supérieure, sinon le display local l'emporterait. */
.alr-error {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: 10px var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-danger);
  background: var(--c-danger-bg);
  border: 1px solid var(--c-danger-bg);
  border-radius: var(--rad-lg);
}
.alr-error.hidden { display: none; }

/* ── Validation : l'unique aplat émeraude de la page ────────────────────── */
.alr-submit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  min-height: 40px;
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--c-on-accent);
  background: var(--c-accent);
  border: 1px solid var(--c-accent);
  border-radius: var(--rad-lg);
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.alr-submit:hover { background: var(--c-accent-strong); border-color: var(--c-accent-strong); }
.alr-submit:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.alr-submit .material-symbols-outlined { font-size: 18px; }
@media (pointer: coarse) { .alr-submit { min-height: 44px; } }

/* ── Note de pied : à qui part l'email, et quand ────────────────────────── */
.alr-note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin: var(--sp-5) 0 0;
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
.alr-note .material-symbols-outlined { font-size: 16px; color: var(--c-decor); flex: none; }
.alr-note a { color: var(--c-accent); text-decoration: none; font-weight: 600; }
.alr-note a:hover { text-decoration: underline; }

/* ── Confirmation d'adresse : incertitude = ambre, jamais rouge ─────────── */
.alr-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-6);
  background: var(--c-warn-bg);
  border: 1px solid var(--c-warn-border);
  border-radius: var(--rad-card);
}
.alr-confirm__ico {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--rad-lg);
  background: var(--c-panel);
  border: 1px solid var(--c-warn-border);
  color: var(--c-warn);
}
.alr-confirm__ico .material-symbols-outlined { font-size: 24px; }
.alr-confirm__t {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--fs-title);
  color: var(--c-ink);
}
.alr-confirm__p {
  margin: 0;
  max-width: 52ch;
  font-size: var(--fs-base);
  color: var(--c-ink-2);
}

/* ── Compact : la feuille épouse le bord de l'écran (.app-main__inner perd
   sa gouttière sous 720px, cf. app_shell.css). ─────────────────────────── */
@media (max-width: 720px) {
  .alr-shell {
    margin: 0;
    padding: var(--sp-5) var(--sp-4) var(--sp-6);
    border-left: 0;
    border-right: 0;
  }
  .alr-head__title { font-size: 25px; }
  .alr-card__h { padding-inline: var(--sp-4); }
  .alr-card__intro { padding-inline: var(--sp-4); }
  .alr-card__body { padding: var(--sp-4); }
  .alr-submit { width: 100%; justify-content: center; }
}
