/* ------------------------------------------------------------------
   Page publique Elly Energy.
   La carte de formulaire et les boutons vivent dans shared/form-card.css
   afin que l'apercu du back office reste fidele au rendu publie.
   ------------------------------------------------------------------ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(78px + env(safe-area-inset-top, 0px) + 8px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 3px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 4px;
}

.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;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  background: var(--cyan-500);
  color: var(--navy-900);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: max(24px, env(safe-area-inset-left, 0px))
    max(24px, env(safe-area-inset-right, 0px));
}

/* ---------------- Typographie ---------------- */

.h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.4vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.h2--light {
  color: #fff;
}
.h2--xl {
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
}

.h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink);
}

.lead {
  margin-top: 16px;
  font-size: 1.0625rem;
  max-width: 46ch;
}

.eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-500);
  margin-bottom: 14px;
}
.eyebrow--light {
  color: var(--cyan-400);
}

.hand-note {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--cyan-400);
  transform: rotate(-4deg);
  white-space: nowrap;
  max-width: 100%;
}
.hand-note--dark {
  color: var(--navy-700);
  font-size: 1.5rem;
}
.hand-note--light {
  color: #fff;
  font-size: 1.5rem;
}
.hand-note--footer {
  color: var(--cyan-400);
  font-size: 1.15rem;
}
.hand-note__underline {
  position: relative;
  padding-bottom: 6px;
}
.hand-note__underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 8%;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: rotate(-1.4deg);
  border-radius: 2px;
}

.ico--xl {
  color: var(--navy-700);
}

.muted {
  color: #7b8ba3;
  font-size: 0.9375rem;
}

.btn--lg {
  --btn-py: 17px;
  padding-inline: 32px;
  font-size: 1.05rem;
}

/* ---------------- En-tete ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-800);
  padding-top: env(safe-area-inset-top, 0px);
  transition: box-shadow 0.2s ease;
}
.site-header.is-stuck {
  box-shadow: 0 6px 24px rgba(3, 16, 58, 0.35);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: 78px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  flex: none;
  line-height: 0;
}
.brand__logo {
  display: block;
  height: 58px;
  width: auto;
  max-width: min(210px, 48vw);
}

.site-nav {
  display: flex;
  gap: 34px;
  margin-inline-end: auto;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a {
  color: #fff;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition:
    border-color 0.18s ease,
    color 0.18s ease;
}
.site-nav a:hover {
  border-color: var(--cyan-400);
  color: var(--cyan-300);
}

.site-header__cta {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}
.hand-note--header {
  font-size: 1.05rem;
}

.nav-toggle {
  display: none;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: transparent;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 20px;
}
.nav-toggle__bars i {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  isolation: isolate;
  background: var(--navy-900);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      rgba(3, 16, 58, 0.96) 0%,
      rgba(3, 16, 58, 0.88) 34%,
      rgba(3, 16, 58, 0.45) 58%,
      rgba(3, 16, 58, 0.25) 100%
    ),
    linear-gradient(180deg, rgba(3, 16, 58, 0.5) 0%, rgba(3, 16, 58, 0) 40%);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas:
    "texte formulaire"
    "atouts formulaire";
  align-items: start;
  gap: 48px;
  padding-block: 76px 40px;
}

.hero__content {
  grid-area: texte;
  max-width: 620px;
  padding-top: 8px;
}

.hero__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.15rem, 4.6vw, 3.75rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  color: #fff;
}
.hero__title em {
  font-style: normal;
  color: var(--cyan-400);
}

.hero__lead {
  margin-top: 22px;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: #e7eefa;
}

.hero__features {
  grid-area: atouts;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.hero__features li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 20px 0;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
}
.hero__features li:first-child {
  border-left: 0;
  padding-left: 0;
}
.hero__features .ico {
  color: var(--cyan-400);
}

/* Carte d'eligibilite montee depuis le schema publie */

.card-form-wrap {
  grid-area: formulaire;
  position: relative;
}
.card-form-wrap > .form-card > .card-form {
  box-shadow: var(--shadow-card);
}

.form-loading {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  min-height: 420px;
}

.form-noscript {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e7eefa;
  font-size: 0.875rem;
}

/* ---------------- Sections ---------------- */

.section {
  padding-block: 84px;
}

/* Les ancres doivent degager l'en-tete collant. */
.section,
.cta,
#eligibilite,
.field {
  scroll-margin-top: calc(96px + env(safe-area-inset-top, 0px));
}

.section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.section__head .hand-note {
  margin-top: 6px;
}

.section--confort {
  background: #fff;
}
.section--aides {
  background: var(--surface-alt);
  padding-block: 64px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 44px;
}
.media-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--navy-800);
  box-shadow: var(--shadow-soft);
}
.media-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.media-card:hover img {
  transform: scale(1.04);
}
.media-card__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 46px 22px 20px;
  background: linear-gradient(
    180deg,
    rgba(3, 16, 58, 0) 0%,
    rgba(3, 16, 58, 0.92) 62%
  );
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}
.tick {
  display: block;
  width: 30px;
  height: 3px;
  border-radius: 3px;
  background: var(--cyan-400);
  margin-bottom: 10px;
}

/* Carte aides */

.aides-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.92fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
  padding: 40px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.aides-card .h2 {
  font-size: clamp(1.45rem, 2.05vw, 1.95rem);
}
.aides-card__text .lead {
  max-width: 32ch;
}
.aides-card__media img {
  width: 100%;
  aspect-ratio: 4 / 3.6;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.aides-card__aside {
  padding-left: 30px;
  border-left: 1px solid var(--line);
}
.aides-card__aside .h3 {
  margin-top: 14px;
}
.aides-card__aside p {
  margin-top: 12px;
  font-size: 0.9375rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.pill {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

/* Etapes */

.section--steps {
  background: var(--navy-700);
  color: var(--body-on-navy);
}
.section--steps .h2 {
  max-width: 18ch;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px;
  margin-top: 52px;
}
.step__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.step__num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--cyan-400);
  border: 1px solid rgba(0, 132, 250, 0.5);
  border-radius: 999px;
  padding: 4px 10px;
}
.step__top .ico {
  color: var(--cyan-400);
}
.step__title {
  margin-top: 18px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.3;
  color: #fff;
}
.step p {
  margin-top: 10px;
  font-size: 0.9375rem;
}

/* Appel a l'action */

.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--navy-900);
}
.cta__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.cta__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    rgba(3, 16, 58, 0.95) 0%,
    rgba(3, 16, 58, 0.8) 38%,
    rgba(3, 16, 58, 0.3) 70%,
    rgba(3, 16, 58, 0.18) 100%
  );
}
.cta__inner {
  position: relative;
  padding-block: 96px;
}
.cta__lines {
  margin-top: 20px;
  color: #dbe6f6;
  font-size: 0.9375rem;
}
.cta .btn {
  margin-top: 30px;
}
.cta .hand-note {
  position: absolute;
  right: 24px;
  bottom: 86px;
}

/* Pied de page */

.site-footer {
  background: var(--navy-800);
  color: #cddaee;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.site-footer__inner {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-block: 34px;
  font-size: 0.875rem;
}
.brand--footer .brand__logo {
  height: 48px;
}
.site-footer__nav {
  display: flex;
  gap: 28px;
}
.site-footer__nav a,
.site-footer__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-footer__nav a:hover,
.site-footer__legal a:hover {
  color: var(--cyan-300);
}
.site-footer__legal {
  margin-inline-start: auto;
}
.site-footer__legal a[aria-current="page"] {
  color: var(--cyan-300);
}
.hand-note--footer {
  transform: rotate(-3deg);
}

/* Animations */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1100px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 32px;
  }
  .aides-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .aides-card__aside {
    padding-left: 0;
    padding-top: 26px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .aides-card__media img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-header__cta {
    margin-inline-start: auto;
    margin-inline-end: 8px;
  }
  .site-header__cta .hand-note--header {
    display: none;
  }

  .site-header.nav-open .site-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 14px max(24px, env(safe-area-inset-left, 0px)) 20px
      max(24px, env(safe-area-inset-right, 0px));
    background: var(--navy-800);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 30px rgba(3, 16, 58, 0.4);
  }
  .site-header.nav-open .site-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
  }
  .site-header__inner {
    position: relative;
  }

  /* Mobile : le formulaire passe juste sous l'accroche, avant les arguments. */
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "texte" "formulaire" "atouts";
    gap: 26px;
    padding-block: 28px 40px;
  }
  .hero__content {
    max-width: none;
    padding-top: 0;
  }
  .hero__features {
    margin-top: 6px;
  }
  .card-form-wrap {
    max-width: 480px;
    width: 100%;
    min-width: 0;
  }

  .section {
    padding-block: 60px;
  }
  .section__head {
    flex-direction: column;
    gap: 22px;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .media-grid li:last-child {
    grid-column: 1 / -1;
  }
  .media-grid li:last-child img {
    aspect-ratio: 16 / 10;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }
  .cta__inner {
    padding-block: 70px;
  }
  .cta .hand-note {
    position: static;
    display: block;
    margin-top: 26px;
  }

  .site-footer__inner {
    flex-wrap: wrap;
    gap: 22px;
  }
  .site-footer__legal {
    margin-inline-start: 0;
  }
  .hand-note--footer {
    display: none;
  }
}

@media (max-width: 620px) {
  html {
    scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px) + 8px);
  }

  .shell {
    padding-inline: max(16px, env(safe-area-inset-left, 0px))
      max(16px, env(safe-area-inset-right, 0px));
  }
  .site-header__inner {
    min-height: 64px;
    gap: 10px;
  }
  .site-header__cta {
    justify-content: flex-end;
  }
  .site-header__cta .btn {
    font-size: 0.875rem;
    padding: 12px 14px;
    min-height: 44px;
    white-space: nowrap;
  }
  .brand {
    min-height: 44px;
    flex: none;
  }
  .brand__logo {
    height: 44px;
  }
  .site-header__cta .btn__arrow {
    display: none;
  }

  .section,
  .cta,
  #eligibilite,
  .field {
    scroll-margin-top: calc(76px + env(safe-area-inset-top, 0px));
  }

  /* Accroche resserree : le formulaire remonte dans le premier ecran. */
  .hero__inner {
    gap: 18px;
    padding-block: 16px 32px;
  }
  .hero__title {
    font-size: clamp(1.65rem, 7.2vw, 2.15rem);
    line-height: 1.08;
  }
  .hero__lead {
    margin-top: 10px;
    font-size: 1rem;
  }
  .eyebrow--light {
    margin-bottom: 8px;
    font-size: 0.72rem;
  }

  .hero__features {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero__features li {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }
  .hero__features li:first-child {
    border-top: 0;
  }
  .hero__features .ico {
    width: 26px;
    height: 26px;
  }

  .media-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .media-grid li:last-child img,
  .media-card img {
    aspect-ratio: 3 / 4;
  }
  .aides-card {
    padding: 22px 18px;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .hand-note--dark {
    font-size: 1.3rem;
    white-space: normal;
  }
  .cta .hand-note {
    white-space: normal;
    font-size: 1.35rem;
  }
  .cta__inner {
    padding-block: 56px 48px;
  }
  .site-footer__inner {
    align-items: flex-start;
    padding-block: 28px;
  }
}

@media (max-width: 400px) {
  .brand__logo {
    height: 40px;
  }
  .site-header .btn__label-full {
    display: none;
  }
  .site-header .btn__label-short {
    display: inline;
  }
}

/* ---------------- Pages legales ---------------- */

.legal-hero {
  background: var(--navy-800);
  color: #fff;
  padding: 36px 0 40px;
}

.legal-hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.legal-hero__lead {
  margin-top: 14px;
  max-width: 46ch;
  color: var(--body-on-navy);
  font-size: 1.05rem;
}

.legal-page {
  background: var(--surface);
  padding: 48px 0 80px;
}

.legal-article {
  max-width: 42rem;
  min-width: 0;
}

.legal-article > * + * {
  margin-top: 1.1em;
}

.legal-article h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--ink);
  margin-top: 2.2em;
}

.legal-article h2:first-child {
  margin-top: 0;
}

.legal-article p,
.legal-article li,
.legal-article dd {
  overflow-wrap: break-word;
}

.legal-article ul,
.legal-article ol {
  padding-left: 1.25rem;
}

.legal-article ul {
  list-style: disc;
}

.legal-article ol {
  list-style: decimal;
}

.legal-article li + li {
  margin-top: 0.4em;
}

.legal-article a {
  color: var(--royal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.legal-article a:hover {
  color: var(--electric);
}

.legal-dl {
  display: grid;
  grid-template-columns: minmax(7.5rem, 11.5rem) minmax(0, 1fr);
  gap: 10px 22px;
  margin: 18px 0 0;
  padding: 20px 22px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.legal-dl dt {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.legal-dl dd {
  margin: 0;
  min-width: 0;
}

.legal-updated {
  margin-top: 2.4em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  color: #7b8ba3;
  font-size: 0.9rem;
}

@media (max-width: 620px) {
  .legal-hero {
    padding: 28px 0 32px;
  }
  .legal-page {
    padding: 32px 0 64px;
  }
  .legal-dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px 0;
    padding: 16px 16px 18px;
  }
  .legal-dl dt {
    margin-top: 10px;
  }
  .legal-dl dt:first-child {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
