:root {
  --bg: #f6f8f6;
  --surface: #ffffff;
  --primary: #00915a;
  --primary-dark: #006e44;
  --primary-deep: #0f3b2e;
  --text: #13221b;
  --muted: #55635c;
  --border: #d7e2dc;
  --success: #067647;
  --error: #b42318;
  --radius: 14px;
  --shadow: 0 12px 28px rgba(15, 59, 46, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

.hero {
  background: linear-gradient(180deg, #ffffff 0%, #f1f7f3 100%);
  border-bottom: 1px solid #e2ebe6;
  padding-bottom: 2.4rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
}

.brand {
  color: var(--primary-deep);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-cta {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.hero-content {
  text-align: center;
  padding: 1.2rem 0 0.8rem;
}

.hero-resultats {
  display: flex;
  align-items: center;
  padding: 2.4rem 0;
}

.hero-resultats .hero-content {
  padding: 0;
  width: 100%;
}

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Page d'accueil « économies » : pas de forçage uppercase sur le titre principal */
h1 {
  margin: 0.5rem 0 0.8rem;
  font-family: "Montserrat", sans-serif;
  color: var(--primary-deep);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.15;
}

.subtitle {
  max-width: 740px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 1.8rem;
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.section {
  padding: 1.6rem 0;
}

h2 {
  margin-top: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--primary-deep);
  font-size: 2rem;
}

.center-title {
  text-align: center;
}

.section-note {
  text-align: center;
  color: var(--muted);
  margin: 0 auto;
  max-width: 680px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid #eaecf0;
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.04);
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
}

.section-alt {
  background: #00915a;
  padding: 0.7rem 0 1.2rem;
}

.result-panel {
  background: #00915a;
  padding: 1.6rem 0;
  width: 100%;
}

.how-it-works {
  text-align: center;
}

.how-it-works h2 {
  font-size: calc(2rem - 4pt);
}

.steps-arrow {
  margin: 0.2rem 0 0.35rem;
  color: var(--primary);
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 700;
}

.steps {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.8;
}

.how-it-works .steps {
  display: inline-block;
  text-align: center;
  list-style-position: inside;
  padding-left: 0;
}

.section-alt .how-it-works,
.section-alt .how-it-works h2,
.section-alt .how-it-works .steps,
.section-alt .how-it-works .steps-arrow,
.section-alt .how-it-works li,
.section-alt .how-it-works strong,
.section-alt .how-it-works u {
  color: #fff;
}

.form-wrap {
  max-width: min(960px, 100%);
  margin: 0 auto;
}

.lead-form {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  border: 1px solid #d8e6de;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem 1rem;
}

.lead-form select {
  padding: 0.58rem 0.75rem;
}

.lead-form .btn-primary,
.lead-form .form-disclaimer,
.lead-form .form-note,
.lead-form .form-message {
  grid-column: 1 / -1;
}

.lead-form .form-note {
  text-align: center;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.74rem 0.82rem;
  font: inherit;
  font-weight: 400;
  background: #fbfdfb;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(0, 145, 90, 0.2);
  border-color: var(--primary);
}

.checkbox {
  align-items: start;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  font-weight: 500;
}

.checkbox input {
  margin-top: 0.25rem;
}

.full {
  width: 100%;
}

.form-disclaimer {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
  font-weight: 400;
  text-align: center;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-message {
  min-height: 1.3rem;
  margin: 0;
  font-size: 0.92rem;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--error);
}

.calc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(10, 24, 18, 0.58);
  backdrop-filter: blur(4px);
}

.calc-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf8 100%);
  border: 1px solid #d8e6de;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(680px, 100%);
  padding: 1.2rem;
  text-align: center;
}

.calc-title {
  margin: 0;
  color: var(--primary-deep);
  font-weight: 700;
}

.calc-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.digit-stream {
  min-height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0.5rem 0 0.75rem;
}

.digit-item {
  grid-area: 1 / 1;
  font-size: clamp(1.15rem, 3.5vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-family: "Montserrat", "Segoe UI Symbol", "Cambria Math", sans-serif;
  color: var(--primary);
  opacity: 0;
  white-space: nowrap;
  transform: translateX(var(--x-shift, 0)) rotate(var(--tilt, 0deg)) scale(0.9) translateY(12px);
  animation: digit-pop 720ms ease-out forwards;
}

@keyframes digit-pop {
  0% {
    opacity: 0;
    transform: translateX(var(--x-shift, 0)) rotate(var(--tilt, 0deg)) scale(0.9) translateY(12px);
  }
  28% {
    opacity: 1;
    transform: translateX(var(--x-shift, 0)) rotate(var(--tilt, 0deg)) scale(1.03) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(var(--x-shift, 0)) rotate(var(--tilt, 0deg)) scale(1) translateY(-12px);
  }
}

.progress-wrap {
  margin-top: 0.25rem;
}

.progress-track {
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: #deebe4;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #12a36a 0%, var(--primary) 70%, #0e7f50 100%);
  transition: width 80ms linear;
}

.progress-text {
  margin: 0.45rem 0 0;
  font-weight: 700;
  color: var(--primary-deep);
}

body.calculating {
  overflow: hidden;
}

.result-card {
  max-width: 780px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid #d8e6de;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.4rem;
  text-align: center;
}

.result-label {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Version « économies » : conserver le vert pour le montant affiché */
.result-amount {
  margin: 0.45rem 0 0.8rem;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1;
  color: var(--primary);
  font-weight: 700;
}

.result-details {
  margin: 0 auto 1.4rem;
  max-width: 640px;
  color: var(--muted);
}

.result-details-advice {
  font-size: calc(1em + 2pt);
}

.result-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 4px 16px rgba(0, 145, 90, 0.45),
    0 0 28px rgba(0, 145, 90, 0.35);
  animation: contact-btn-glow 2.5s ease-in-out infinite;
}

.btn-shine::after {
  content: "";
  position: absolute;
  inset: -20% -60%;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 62%
  );
  transform: translateX(-120%) skewX(-18deg);
  animation: contact-btn-shine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.btn-shine:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28) inset,
    0 6px 22px rgba(0, 145, 90, 0.55),
    0 0 36px rgba(0, 145, 90, 0.45);
}

@keyframes contact-btn-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.2) inset,
      0 4px 16px rgba(0, 145, 90, 0.4),
      0 0 22px rgba(0, 145, 90, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.25) inset,
      0 4px 20px rgba(0, 145, 90, 0.55),
      0 0 34px rgba(0, 145, 90, 0.42);
  }
}

@keyframes contact-btn-shine {
  0%,
  100% {
    transform: translateX(-120%) skewX(-18deg);
  }
  45% {
    transform: translateX(120%) skewX(-18deg);
  }
}

.contact-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #d8e6de;
  display: grid;
  gap: 0.8rem;
  text-align: left;
}

.contact-form[hidden] {
  display: none !important;
}

.phone-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0.6rem;
}

.footer {
  padding: 2rem 0 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid #e2ebe6;
  background: #fcfdfc;
}

.footer a {
  color: inherit;
}

.legal-content {
  max-width: 920px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid #d8e6de;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.04);
  padding: 1.4rem;
  line-height: 1.65;
}

.legal-content h2 {
  margin-top: 1.35rem;
  margin-bottom: 0.4rem;
  font-size: 1.35rem;
}

.legal-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  color: var(--primary-deep);
  font-size: 1.1rem;
}

.legal-content p {
  margin: 0.45rem 0;
}

.legal-content ul {
  margin: 0.45rem 0 0.6rem;
  padding-left: 1.2rem;
}

@media (max-width: 860px) {
  .lead-form {
    grid-template-columns: repeat(2, 1fr);
  }

  .phone-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .lead-form {
    grid-template-columns: 1fr;
  }
}

body.cookie-banner-open {
  padding-bottom: 5.5rem;
}

.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10000;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 -8px 32px rgba(15, 59, 46, 0.08);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-banner--hidden {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 0;
}

.cookie-banner__text {
  margin: 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.cookie-banner__text a {
  color: var(--primary-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
  color: var(--primary);
}

.cookie-banner__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.55rem;
}

.cookie-banner__btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.62rem 1.15rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cookie-banner__btn--ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.cookie-banner__btn--ghost:hover {
  border-color: #b8c9c0;
  background: #f4f8f6;
  color: var(--text);
}

.cookie-banner__btn--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.cookie-banner__btn--primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

@media (max-width: 768px) {
  body.cookie-banner-open {
    padding-bottom: 9.5rem;
  }

  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0 1.1rem;
  }

  .cookie-banner__actions {
    justify-content: stretch;
  }

  .cookie-banner__btn {
    flex: 1;
    text-align: center;
  }
}
