/* mutuelle.demoisell.es
 *
 * Direction hybride : la palette, les formes et la typographie viennent de
 * l'univers demoisell.es ; la mise en page des montants emprunte au relevé
 * bancaire, où l'on doit pouvoir lire une somme sans hésiter.
 */

:root {
  --creme: #FFF9F2;
  --papier: #FFFDFA;
  --anthracite: #303030;
  --encre-douce: #6A625C;

  --rose: #F6B6C8;
  --bleu: #8FD3FF;
  --jaune: #FFD95A;
  --sauge: #BFD8B8;
  --bleu-gris: #D9E7F5;
  --lavande: #DCCEF7;
  --peche: #FFD7B5;

  --trait: #EDE3D8;
  --ombre: 0 2px 10px rgba(48, 48, 48, .05);
  --ombre-portee: 0 6px 24px rgba(48, 48, 48, .08);

  --rayon: 24px;
  --rayon-petit: 16px;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --creme: #241F1C;
    --papier: #2E2825;
    --anthracite: #F5EDE4;
    --encre-douce: #B9AFA6;
    --trait: #3E3733;
    --ombre: 0 2px 10px rgba(0, 0, 0, .2);
    --ombre-portee: 0 6px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--creme);
  color: var(--anthracite);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ------------------------------------------------------------- typographie */

h1 {
  font: 600 clamp(32px, 6vw, 46px)/1.15 var(--serif);
  letter-spacing: .01em;
  margin: 0 0 12px;
}

h2 {
  font: 600 26px/1.25 var(--serif);
  margin: 0 0 20px;
}

h3 {
  font: 600 15px/1.4 var(--sans);
  letter-spacing: .02em;
  margin: 0 0 12px;
}

.sous-titre {
  color: var(--encre-douce);
  font-size: 17px;
  margin: 0 0 40px;
}

.enseigne {
  font: 500 13px/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--encre-douce);
  margin-bottom: 28px;
}

/* ------------------------------------------------------------------ écrans */

.ecran { animation: apparait .3s ease-in-out; }
.ecran[hidden] { display: none !important; }

@keyframes apparait {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

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

/* --------------------------------------------------------------- catégories */

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.carte-categorie {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 20px;
  min-height: 124px;
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  font: 500 16px/1.3 var(--sans);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .25s ease-in-out, box-shadow .25s ease-in-out;
}

.carte-categorie:hover,
.carte-categorie:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--ombre-portee);
}

.pastille {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  flex: none;
}

.pastille svg { width: 22px; height: 22px; stroke: var(--anthracite); }

.accent-rose    { background: var(--rose); }
.accent-bleu    { background: var(--bleu); }
.accent-jaune   { background: var(--jaune); }
.accent-sauge   { background: var(--sauge); }
.accent-lavande { background: var(--lavande); }
.accent-peche   { background: var(--peche); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pastille svg { stroke: #241F1C; }
}

/* ---------------------------------------------------------------- formulaire */

.champ { margin-bottom: 26px; }

.champ > label,
.champ > .intitule {
  display: block;
  font: 500 15px/1.4 var(--sans);
  margin-bottom: 8px;
}

.aide {
  display: block;
  color: var(--encre-douce);
  font-size: 13.5px;
  line-height: 1.5;
  margin: -2px 0 10px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 13px 16px;
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: var(--rayon-petit);
  font: 400 16px var(--sans);
  color: inherit;
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--bleu);
  outline-offset: 2px;
}

.avec-unite { position: relative; }
.avec-unite input { padding-right: 42px; }
.avec-unite::after {
  content: '€';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--encre-douce);
  pointer-events: none;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option {
  padding: 10px 18px;
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: 999px;
  font: 400 15px var(--sans);
  color: inherit;
  cursor: pointer;
  transition: background .2s ease-in-out, border-color .2s ease-in-out;
}

.option[aria-pressed="true"] {
  background: var(--bleu-gris);
  border-color: var(--bleu);
  font-weight: 500;
}

/* -------------------------------------------------------------------- boutons */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 30px;
  border: none;
  border-radius: 999px;
  background: var(--jaune);
  color: var(--anthracite);
  font: 500 16px var(--sans);
  cursor: pointer;
  transition: transform .2s ease-in-out, filter .2s ease-in-out;
}

.bouton:hover { transform: translateY(-2px); filter: brightness(1.03); }
.bouton.pleine-largeur { width: 100%; }

.lien-retour {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 26px;
  color: var(--encre-douce);
  font: 400 15px var(--sans);
  cursor: pointer;
}

.lien-retour:hover { color: var(--anthracite); }

.lien-discret {
  background: none;
  border: none;
  padding: 0;
  color: var(--encre-douce);
  font: 400 15px var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.lien-discret:hover { color: var(--anthracite); }

/* -------------------------------------------------------------------- résultat */

.carte {
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 28px;
  margin-bottom: 20px;
}

.entete-resultat {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--trait);
}

.entete-resultat .acte { font: 500 17px var(--sans); }
.entete-resultat .prix { color: var(--encre-douce); font-size: 15px; }

/* Les lignes de la cascade se lisent comme un relevé : libellé à gauche,
   montant aligné à droite, chiffres tabulaires pour que les colonnes tombent. */
.ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--trait);
}

.ligne:last-of-type { border-bottom: none; }
.ligne .organisme { font-size: 15.5px; }
.ligne .note { display: block; color: var(--encre-douce); font-size: 13px; }

.montant {
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
}

.montant.nul { color: var(--encre-douce); font-weight: 400; }

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 20px 24px;
  border-radius: var(--rayon-petit);
}

.total .intitule { font: 500 15px var(--sans); }
.total .montant { font-size: 26px; font-weight: 600; }
.total.rembourse { background: var(--sauge); }
.total.reste { background: var(--bleu-gris); }
.total.reste-eleve { background: var(--rose); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .total { color: #241F1C; }
}

.avertissement {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  margin-top: 16px;
  border-radius: var(--rayon-petit);
  background: var(--peche);
  font-size: 14.5px;
  line-height: 1.55;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avertissement { color: #241F1C; }
}

.impossible {
  padding: 24px 26px;
  border-radius: var(--rayon);
  background: var(--rose);
  font-size: 15.5px;
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .impossible { color: #241F1C; }
}

/* ------------------------------------------------------------------ détail */

.detail {
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--papier);
  overflow: hidden;
}

.detail summary {
  padding: 18px 24px;
  font: 500 15px var(--sans);
  cursor: pointer;
  list-style: none;
}

.detail summary::-webkit-details-marker { display: none; }
.detail summary::after { content: ' ›'; color: var(--encre-douce); }
.detail[open] summary::after { content: ' ⌄'; }

.detail .corps {
  padding: 4px 24px 24px;
  border-top: 1px solid var(--trait);
}

.bloc-calcul { margin-top: 18px; }
.bloc-calcul .titre { font: 500 14px var(--sans); margin-bottom: 6px; }
.bloc-calcul p {
  margin: 0 0 6px;
  color: var(--encre-douce);
  font-size: 14px;
  line-height: 1.6;
}

.reference {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--trait);
  color: var(--encre-douce);
  font-size: 13px;
  line-height: 1.6;
}

.reference .millesime { margin-top: 10px; }

/* Aucun style en ligne dans le JavaScript : la politique de sécurité du site
   les bloque, et une marge posée en attribut disparaîtrait silencieusement. */
.impossible .motif { margin: 10px 0 0; }

/* -------------------------------------------------------------- pied de page */

.pied {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--trait);
  color: var(--encre-douce);
  font-size: 13px;
  line-height: 1.7;
}

.pied a { color: inherit; }

@media (max-width: 480px) {
  .page { padding: 32px 18px 72px; }
  .carte { padding: 22px 20px; }
  .total { padding: 18px 20px; }
}
