/* ==================================================================
   Poppins (self-hosted, sous-ensemble latin) - conformite RGPD :
   aucune requete externe, aucune transmission d'IP visiteur a un tiers.
   Seules les graisses utilisees sont chargees : 400, 600, 700, 800.
   ================================================================== */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/poppins-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/poppins-800.woff2') format('woff2');
}

/* ==================================================================
   CALCULATEUR NOUILA - Charte graphique
   ------------------------------------------------------------------
   Palette et typographie exactes relevees sur nouila.com (CSS Overview),
   centralisees en variables. Ambiance : navy tres sombre (#03102b), texte
   blanc, accent cyan #5be4fd (CTA), accent vert menthe #46fdb8 (resultats
   positifs). Police Poppins. Boutons pilule. Mobile first.
   ================================================================== */

:root {
  /* Fonds */
  /* Palette exacte relevee sur nouila.com */
  --c-navy: #03102b;          /* fond principal */
  --c-navy-2: #05112c;        /* fond sections / cartes */
  --c-surface: #05112c;       /* cartes */
  --c-surface-2: #0b1d3e;     /* surfaces internes (champs) - tint plus clair pour le contraste */
  --c-border: rgba(91, 228, 253, 0.16);

  /* Texte */
  --c-text: #ffffff;
  --c-text-muted: #adadad;
  --c-text-dim: #8a8a8a;

  /* Accents */
  --c-cyan: #5be4fd;          /* accent primaire / CTA (fond CTA, texte navy) */
  --c-cyan-strong: #83edff;
  --c-mint: #46fdb8;          /* accent secondaire / positif / chiffre cle */

  /* Rayons */
  --r-pill: 999px;
  --r-card: 20px;
  --r-field: 12px;

  /* Typo : Poppins (Google Fonts), fallback sans-serif systeme */
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Espacements */
  --maxw: 720px;
}

/* -------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--c-text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(91, 228, 253, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(70, 253, 184, 0.08), transparent 55%),
    var(--c-navy);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------- Layout */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.layout { display: grid; gap: 20px; }

/* -------------------------------------------------------------- Overline */
.overline {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-cyan);
}
.overline--accent { color: var(--c-mint); }

/* -------------------------------------------------------------- Hero */
.hero { padding: 12px 4px 24px; }

.hero__title {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 6vw, 2.9rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero__lead {
  margin: 0;
  max-width: 52ch;
  color: var(--c-text-muted);
  font-size: 1.02rem;
}

/* -------------------------------------------------------------- Cartes */
.card {
  background: linear-gradient(180deg, var(--c-surface), var(--c-navy-2));
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 24px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.card__title {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* -------------------------------------------------------------- Formulaire */
.field { margin-bottom: 18px; }

.field label,
.field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--c-text);
}

.field__hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--c-text-dim);
}

input[type="number"],
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-field);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: var(--c-text-dim); }
input:focus {
  outline: none;
  border-color: var(--c-cyan);
  box-shadow: 0 0 0 3px rgba(91, 228, 253, 0.22);
}

/* Segmented control (turnover) */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.segment { position: relative; }
.segment input {
  position: absolute; opacity: 0; inset: 0; cursor: pointer;
}
.segment span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  transition: all 0.15s ease;
}
.segment input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(91, 228, 253, 0.22);
}
.segment input:checked + span {
  color: var(--c-navy);
  background: var(--c-cyan);
  border-color: var(--c-cyan);
}

/* -------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 26px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--block { width: 100%; }
.btn--primary {
  color: var(--c-navy);
  background: var(--c-cyan);
  box-shadow: 0 10px 26px rgba(91, 228, 253, 0.28);
}
.btn--primary:hover { background: var(--c-cyan-strong); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--cta { margin-top: 22px; background: var(--c-mint); box-shadow: 0 10px 26px rgba(70, 253, 184, 0.28); }
.btn--cta:hover { background: #63ffc6; }

/* -------------------------------------------------------------- Resultat */
.result { text-align: center; }

.keyfigure { margin: 6px 0 16px; }
.keyfigure__value {
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--c-mint);
  text-shadow: 0 6px 30px rgba(70, 253, 184, 0.25);
  word-break: break-word;
}
.keyfigure__label {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--c-text-muted);
}

.badge {
  display: inline-block;
  margin-bottom: 22px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-navy);
  background: var(--c-mint);
  border-radius: var(--r-pill);
}

/* Comparaison */
.compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  text-align: center;
  margin-bottom: 8px;
}
.compare__col {
  padding: 18px 12px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-field);
}
.compare__col--nouila { border-color: rgba(70, 253, 184, 0.4); }
.compare__head {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-dim);
}
.compare__amount {
  margin: 0;
  font-size: clamp(1.2rem, 5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.compare__col--nouila .compare__amount { color: var(--c-mint); }
.compare__sub { margin: 6px 0 0; font-size: 0.76rem; color: var(--c-text-dim); }
.compare__vs {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-text-dim);
  text-transform: uppercase;
}

/* Gate email */
.gate {
  margin-top: 22px;
  padding: 20px 16px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-field);
}
.gate__title { margin: 0 0 14px; font-weight: 700; }
.gate__form { display: flex; flex-direction: column; gap: 10px; }
.gate__skip {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--c-text-dim);
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.gate__status { margin: 12px 0 0; font-size: 0.85rem; color: var(--c-mint); min-height: 1em; }

/* Detail */
.detail {
  margin-top: 22px;
  text-align: left;
  border-top: 1px solid var(--c-border);
  padding-top: 8px;
}
.detail summary {
  cursor: pointer;
  padding: 12px 4px;
  font-weight: 700;
  color: var(--c-cyan);
  list-style: none;
}
.detail summary::-webkit-details-marker { display: none; }
.detail summary::after { content: " +"; font-weight: 800; }
.detail[open] summary::after { content: " -"; }
.detail__body { padding: 8px 4px 4px; }
.detail__group { margin-bottom: 18px; }
.detail__title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
}
.detail__title span { color: var(--c-text-dim); font-weight: 600; }

.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 0.9rem;
  color: var(--c-text-muted);
  border-bottom: 1px dashed var(--c-border);
}
.breakdown li span:last-child { font-weight: 700; color: var(--c-text); white-space: nowrap; }
.breakdown__total {
  color: var(--c-text) !important;
  font-weight: 800;
  border-bottom: none !important;
  padding-top: 12px;
}
.breakdown__total span:last-child { color: var(--c-cyan) !important; }

/* Decomposition tranche par tranche */
.detail__note {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--c-text-dim);
}
.breakdown--tranches li { font-size: 0.84rem; padding: 7px 0; }
.breakdown--tranches li span:last-child {
  font-weight: 600;
  color: var(--c-text-muted);
}
.tranches-moyen {
  margin: 10px 0 16px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--c-cyan);
}

.disclaimer {
  margin: 20px 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--c-text-dim);
}

/* -------------------------------------------------------------- Footer */
.footer {
  margin-top: 34px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--c-text-dim);
}
.footer p { margin: 4px 0; }
.footer__link {
  color: var(--c-text-muted);
  text-decoration: underline;
}
.footer__link:hover { color: var(--c-cyan); }

/* -------------------------------------------------------------- Desktop */
@media (min-width: 720px) {
  .page { padding-top: 44px; }
  .form { padding: 30px 28px; }
  .result { padding: 34px 30px; }
  .btn--block { width: auto; min-width: 260px; }
  form .btn--block { width: 100%; }
}

/* Respect des preferences de mouvement reduit */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
