/* Calculator pages — premium layer, loaded last on every calculator page (calcul-*) (after
   calculator-official.css / outilcalcul-design-system.css / page CSS). Visual only: no text, image,
   field id, route or calculation is touched. Same language as the home, account, forum and utility
   pages: deep-green hero with drifting light, glass example card, refined fields, a signature result
   block that pulses when the value changes, premium sections, motion via assets/calculator-luxe.js.
   Everything is scoped to html body[class*="calc-page-"]:not(#cx) and collapses to static under reduced motion. */

html body[class*="calc-page-"]:not(#cx) {
  --cx-brand: #286153;
  --cx-brand-deep: #1d4c41;
  --cx-ink: #182423;
  --cx-gold: #c6ae78;
  --cx-gold-soft: #e8d9ad;
  --cx-mint: #acd5c4;
  --cx-border: #dce6dd;
  --cx-bg: #f7f8f4;
  --cx-bg-2: #eef3eb;
  --cx-text: #1c302a;
  --cx-text-2: #42584e;
  --cx-muted: #5b7065;
  --cx-spring: cubic-bezier(.2, .95, .25, 1.15);
  --cx-ease: cubic-bezier(.65, 0, .25, 1);
  --cx-heading: "Lexend", "Source Sans 3", system-ui, sans-serif;
  background:
    radial-gradient(900px 480px at 88% -160px, rgba(198, 174, 120, .16), transparent 70%),
    radial-gradient(800px 520px at -10% 0%, rgba(40, 97, 83, .08), transparent 65%),
    var(--cx-bg);
}

/* ---------- Reading progress ---------- */
.cx-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #c6ae78, #acd5c4, #286153);
  transform: scaleX(var(--cx-p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* ---------- Hero ---------- */
html body[class*="calc-page-"]:not(#cx) .hero-large.calc-hero-shell {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: clamp(24px, 4vw, 48px);
  margin: 6px 0 34px;
  padding: clamp(34px, 5vw, 64px) clamp(24px, 4.5vw, 60px);
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(760px 420px at var(--cx-mx, 88%) var(--cx-my, 0%), rgba(198, 174, 120, .3), transparent 60%),
    linear-gradient(135deg, #182423 0%, #1f3833 48%, #286153 100%);
  box-shadow: 0 40px 80px -48px rgba(24, 36, 35, .9);
}
html body[class*="calc-page-"]:not(#cx) .hero-large.calc-hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 70% 80% at 75% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 75% 30%, #000 20%, transparent 75%);
}
html body[class*="calc-page-"]:not(#cx) .hero-large.calc-hero-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  right: 6%;
  bottom: -260px;
  border-radius: 50%;
  background: rgba(198, 174, 120, .55);
  filter: blur(60px);
  opacity: .55;
  pointer-events: none;
  animation: cx-drift 20s ease-in-out infinite alternate;
}
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-content { padding: 0; }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell :is(.hero-kicker, .hero-badge) {
  margin-bottom: 18px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px rgba(232, 217, 173, .32);
  color: var(--cx-gold-soft);
}
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell :is(.hero-kicker, .hero-badge)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7fd1a8;
  animation: cx-pulse 2.4s ease-out infinite;
}
html body[class*="calc-page-"]:not(#cx) .hero-large.calc-hero-shell h1 {
  color: #fff;
  font-family: var(--cx-heading);
  font-weight: 700;
  letter-spacing: -.03em;
  text-wrap: balance;
}
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-subtitle { color: rgba(255, 255, 255, .85); }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-reassurance { color: rgba(255, 255, 255, .7); }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-cta {
  position: relative;
  overflow: hidden;
  min-height: 52px;
  padding-inline: 24px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #f5ebd2, #e2eddb);
  color: var(--cx-ink);
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .65);
  transition: transform 300ms var(--cx-spring), box-shadow 300ms ease;
}
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: cx-sweep 5s var(--cx-ease) 1.6s infinite;
  pointer-events: none;
}
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-cta:hover { transform: translateY(-2px); }

/* Example card ("Vos données, vos hypothèses") as a glass panel */
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example {
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 24px 44px -28px rgba(0, 0, 0, .7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  overflow: hidden;
  animation: cx-float 7s ease-in-out infinite;
}
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example > summary { color: #fff; background: transparent; }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example > summary * { color: inherit; }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example .hero-visual,
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example .calc-demo { background: transparent; border: 0; box-shadow: none; color: #fff; }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example .calc-demo * { color: rgba(255, 255, 255, .9); }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example .calc-demo a { color: var(--cx-gold-soft); font-weight: 800; }
html body[class*="calc-page-"]:not(#cx) .calc-hero-shell .product-example .calc-demo__kicker { color: var(--cx-gold-soft); }

/* ---------- Section headings ---------- */
html body[class*="calc-page-"]:not(#cx) main :is(.section-head h2, .seo-inline-card > h2, .linked-tools-section h2, .faq-section h2) {
  font-family: var(--cx-heading);
  letter-spacing: -.025em;
}
html body[class*="calc-page-"]:not(#cx) .calculator-workspace > .section-head h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }

/* ---------- Workspace cards ---------- */
html body[class*="calc-page-"]:not(#cx) .calculator-workspace__grid { gap: 22px; align-items: start; }
html body[class*="calc-page-"]:not(#cx) .calculator-workspace__grid > .input-card,
html body[class*="calc-page-"]:not(#cx) .calculator-workspace__grid > .result-card {
  border-radius: 28px;
  box-shadow: 0 30px 60px -44px rgba(24, 36, 35, .75);
  transition: box-shadow 400ms ease, transform 400ms var(--cx-spring);
}
html body[class*="calc-page-"]:not(#cx) .calculator-workspace__grid > .input-card { border: 1px solid var(--cx-border); background: #fff; }
html body[class*="calc-page-"]:not(#cx) .calculator-workspace__grid > .input-card:focus-within { box-shadow: 0 34px 64px -42px rgba(40, 97, 83, .55); }
@media (min-width: 1081px) {
  html body[class*="calc-page-"]:not(#cx) .calculator-workspace__grid > .result-card { position: sticky; top: 92px; }
}
html body[class*="calc-page-"]:not(#cx) .card-eyebrow {
  background: var(--cx-bg-2);
  color: var(--cx-brand-deep);
}
html body[class*="calc-page-"]:not(#cx) .card-intro h3 { font-family: var(--cx-heading); letter-spacing: -.015em; }

/* Fields */
html body[class*="calc-page-"]:not(#cx) .calculator-form .input-row { transition: background-color 300ms ease; }
html body[class*="calc-page-"]:not(#cx) .calculator-form .input-row:focus-within .input-label-text { color: var(--cx-brand); }
html body[class*="calc-page-"]:not(#cx) .input-control {
  border: 1.5px solid var(--cx-border);
  border-radius: 14px !important;
  background: var(--cx-bg);
  transition: border-color 200ms ease, box-shadow 260ms ease, background-color 200ms ease, transform 260ms var(--cx-spring);
}
html body[class*="calc-page-"]:not(#cx) .input-control:hover { border-color: #b9d3bf; background: #fff; }
html body[class*="calc-page-"]:not(#cx) .input-control:focus-within {
  border-color: var(--cx-brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(40, 97, 83, .12), 0 10px 22px -16px rgba(40, 97, 83, .7);
}
html body[class*="calc-page-"]:not(#cx) .input-control strong { border-left-color: var(--cx-border); color: var(--cx-muted); background: rgba(238, 243, 235, .6); }
html body[class*="calc-page-"]:not(#cx) .input-control input[type="checkbox"]:checked { background: linear-gradient(135deg, var(--cx-brand), var(--cx-brand-deep)); }
html body[class*="calc-page-"]:not(#cx) .input-control input[type="checkbox"]::before { transition: transform 320ms var(--cx-spring); }
html body[class*="calc-page-"]:not(#cx) .input-footer { border-radius: 14px; transition: background-color 200ms ease, transform 260ms var(--cx-spring); }
html body[class*="calc-page-"]:not(#cx) .input-footer:hover { transform: translateY(-1px); }
html body[class*="calc-page-"]:not(#cx) .input-footer:hover .footer-arrow { transform: rotate(-180deg); }
html body[class*="calc-page-"]:not(#cx) .input-footer .footer-arrow { display: inline-block; transition: transform 500ms var(--cx-spring); }

/* ---------- Result: signature block ---------- */
html body[class*="calc-page-"]:not(#cx) .result-card .result-head h3 { font-family: var(--cx-heading); letter-spacing: -.015em; }
/* Light result cards (most calculators): the primary value becomes a deep-green glowing panel. */
html body[class*="calc-page-"]:not(#cx) .result-card:not(.result-engine-v2) {
  border: 1px solid var(--cx-border);
  background: #fff;
}
html body[class*="calc-page-"]:not(#cx) .result-card:not(.result-engine-v2) #result-primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 6px 0 16px;
  padding: 22px 24px;
  border-radius: 20px;
  color: #fff;
  font-family: var(--cx-heading);
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(198, 174, 120, .35), transparent 60%),
    linear-gradient(140deg, #182423 0%, #1f3833 50%, #286153 100%);
  box-shadow: 0 22px 40px -26px rgba(24, 36, 35, .85);
  -webkit-text-fill-color: #fff;
}
html body[class*="calc-page-"]:not(#cx) .result-card:not(.result-engine-v2) #result-primary::after,
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 #result-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .16) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
html body[class*="calc-page-"]:not(#cx) .result-card #result-primary.cx-bump::after { animation: cx-sheen 900ms var(--cx-ease); }
html body[class*="calc-page-"]:not(#cx) .result-card #result-primary.cx-bump { animation: cx-bump 520ms var(--cx-spring); }
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 #result-primary { position: relative; isolation: isolate; overflow: hidden; }
/* Dark result cards (result engine v2): fix the low-contrast detail copy. */
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 :is(.result-breakdown, .result-breakdown p, .calculator-method-notice, .result-interpretation) { color: rgba(244, 246, 251, .84); }
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 .calculator-method-notice + a,
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 a:not(.result-cta) { color: var(--cx-gold-soft); }
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 .card-eyebrow { background: rgba(255, 255, 255, .1); color: var(--cx-gold-soft); }
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 {
  background:
    radial-gradient(520px 260px at 100% 0%, rgba(198, 174, 120, .26), transparent 60%),
    linear-gradient(160deg, #1d4c41 0%, #1b3a33 55%, #182423 100%);
}
html body[class*="calc-page-"]:not(#cx) .result-card .result-cta {
  border-radius: 14px;
  transition: transform 260ms var(--cx-spring), box-shadow 260ms ease;
}
html body[class*="calc-page-"]:not(#cx) .result-card .result-cta:hover { transform: translateY(-2px); }

/* ---------- Trust chips under the workspace ---------- */
html body[class*="calc-page-"]:not(#cx) .calculator-workspace > .hero-trust span {
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--cx-border);
  transition: transform 260ms var(--cx-spring), box-shadow 260ms ease;
}
html body[class*="calc-page-"]:not(#cx) .calculator-workspace > .hero-trust span:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px #b9d3bf, 0 10px 20px -16px rgba(24, 36, 35, .6); }

/* ---------- Content sections ---------- */
html body[class*="calc-page-"]:not(#cx) .seo-inline-card {
  position: relative;
  padding: clamp(24px, 3vw, 34px) clamp(22px, 3.4vw, 40px);
  border: 1px solid var(--cx-border);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 22px 44px -40px rgba(24, 36, 35, .65);
}
html body[class*="calc-page-"]:not(#cx) .seo-inline-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 28px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--cx-gold), var(--cx-brand));
}
html body[class*="calc-page-"]:not(#cx) .seo-inline-card a { color: var(--cx-brand); font-weight: 700; text-underline-offset: 3px; }

/* Related tools: rows that slide, arrow that springs */
html body[class*="calc-page-"]:not(#cx) .tools-grid .tool-card {
  border-radius: 18px;
  transition: background-color 250ms ease, transform 350ms var(--cx-spring), box-shadow 300ms ease;
}
html body[class*="calc-page-"]:not(#cx) .tools-grid .tool-card:hover,
html body[class*="calc-page-"]:not(#cx) .tools-grid .tool-card:focus-visible {
  transform: translateX(6px);
  background: #fff;
  box-shadow: 0 16px 30px -24px rgba(24, 36, 35, .7);
}
html body[class*="calc-page-"]:not(#cx) .tools-grid .tool-card::after { transition: transform 400ms var(--cx-spring), color 200ms ease; }
html body[class*="calc-page-"]:not(#cx) .tools-grid .tool-card:hover::after { transform: translateX(6px); color: var(--cx-brand); }
html body[class*="calc-page-"]:not(#cx) .tools-grid .tool-card h3 { font-family: var(--cx-heading); }

/* FAQ */
html body[class*="calc-page-"]:not(#cx) .faq-card details { border-radius: 18px; transition: background-color 250ms ease, box-shadow 300ms ease; }
html body[class*="calc-page-"]:not(#cx) .faq-card details[open] { background: #fff; box-shadow: 0 18px 36px -30px rgba(24, 36, 35, .7); }
html body[class*="calc-page-"]:not(#cx) .faq-card details[open] > p { animation: cx-rise 450ms var(--cx-spring) both; }
html body[class*="calc-page-"]:not(#cx) .faq-card summary > span:last-child { transition: transform 350ms var(--cx-spring); }
html body[class*="calc-page-"]:not(#cx) .faq-card details[open] summary > span:last-child { transform: rotate(90deg); }

/* Final CTA */
html body[class*="calc-page-"]:not(#cx) .covo-cta-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: 30px;
  background:
    radial-gradient(90% 140% at 100% 100%, rgba(198, 174, 120, .42), transparent 55%),
    linear-gradient(120deg, #182423, #286153);
  box-shadow: 0 34px 60px -40px rgba(24, 36, 35, .9);
}
html body[class*="calc-page-"]:not(#cx) .covo-cta-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  top: -180px;
  left: 30%;
  border-radius: 50%;
  background: #3f8a74;
  filter: blur(50px);
  opacity: .5;
  animation: cx-drift 18s ease-in-out infinite alternate;
}
html body[class*="calc-page-"]:not(#cx) .covo-cta-card .section-kicker { width: fit-content; background: rgba(255, 255, 255, .1); color: var(--cx-gold-soft); }
html body[class*="calc-page-"]:not(#cx) .covo-cta-card .covo-cta-button {
  border-radius: 14px;
  background: #fff;
  color: var(--cx-ink);
  transition: transform 300ms var(--cx-spring), background-color 200ms ease;
}
html body[class*="calc-page-"]:not(#cx) .covo-cta-card .covo-cta-button:hover { transform: translateY(-2px); background: var(--cx-gold-soft); }

/* ---------- Scroll reveal (only when JS runs) ---------- */
html.cx-js body[class*="calc-page-"]:not(#cx) .cx-reveal { transform: translateY(26px); transition: transform 900ms var(--cx-spring); transition-delay: calc(var(--cx-i, 0) * 70ms); }
html.cx-js body[class*="calc-page-"]:not(#cx) .cx-reveal.is-in { transform: none; }
html.cx-ready body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-content > * { animation: cx-rise 850ms var(--cx-spring) both; }
html.cx-ready body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-content > :nth-child(2) { animation-delay: 80ms; }
html.cx-ready body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-content > :nth-child(3) { animation-delay: 160ms; }
html.cx-ready body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-content > :nth-child(4) { animation-delay: 240ms; }
html.cx-ready body[class*="calc-page-"]:not(#cx) .calc-hero-shell .hero-content > :nth-child(5) { animation-delay: 320ms; }

@media (max-width: 720px) {
  html body[class*="calc-page-"]:not(#cx) .hero-large.calc-hero-shell { border-radius: 26px; margin-bottom: 22px; }
  html body[class*="calc-page-"]:not(#cx) .calculator-workspace__grid > :is(.input-card, .result-card) { border-radius: 24px; }
  html body[class*="calc-page-"]:not(#cx) .tools-grid .tool-card:hover { transform: none; }
}

@keyframes cx-drift { to { transform: translate(-90px, -40px) scale(1.15); } }
@keyframes cx-pulse { 0% { box-shadow: 0 0 0 0 rgba(127, 209, 168, .6); } 70%, 100% { box-shadow: 0 0 0 10px rgba(127, 209, 168, 0); } }
@keyframes cx-sweep { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes cx-sheen { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes cx-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes cx-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cx-bump { 0% { transform: scale(1); } 35% { transform: scale(1.025); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  html body[class*="calc-page-"]:not(#cx) *, html body[class*="calc-page-"]:not(#cx) *::before, html body[class*="calc-page-"]:not(#cx) *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0s !important; }
  html.cx-js body[class*="calc-page-"]:not(#cx) .cx-reveal { opacity: 1; transform: none; }
  .cx-progress { display: none; }
}

/* Rows whose label column gets squeezed by a long select (detected by calculator-luxe.js):
   label on top, control full width — fixes labels overflowing under the field. */
html body[class*="calc-page-"]:not(#cx) .calculator-form .input-row.cx-stack { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
html body[class*="calc-page-"]:not(#cx) .calculator-form .input-row.cx-stack > .input-control { width: 100%; min-width: 0; }

/* Light boxes nested in the dark result card keep dark copy (e.g. .prk-usage-note, alerts). */
html body[class*="calc-page-"]:not(#cx) .result-card.result-engine-v2 :is(.prk-usage-note, .result-alert, [class*="-note"]:not(.calculator-method-notice)) { color: var(--cx-text); }
