:root {
  --navy: #053871;
  --cyan: #51bcec;
  --question: #00b0ff;
  --input-border: #c2d6df;
  --placeholder: #87979f;
  --shadow: #d1e5ec;
  --panel: rgba(229, 244, 255, 0.35);
  --text: #053871;
  --white: #ffffff;
  --title: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir", "Avenir Next", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: none;
  padding-top: var(--header-h);
  color: var(--text);
  overflow-x: hidden;
  background: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.landing {
  position: relative;
  isolation: isolate;
  min-height: 0;
  padding: 0;
  width: 100%;
  font-family: var(--body);
}

.landing:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, #f1f6f9 0%, #f8f9fb 100%) !important;
  opacity: 1;
  pointer-events: none;
}

.brands {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 36px;
  width: min(700px, 100%);
  margin: 0 auto;
  padding: 28px 40px 22px;
  background: var(--white);
  border-radius: 0 0 28px 28px;
  box-shadow: 5px 5px 16px var(--shadow);
}

.brands__eurochem {
  width: 214px;
}

.brands__eoletec {
  width: 220px;
}

.landing .hero {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 649px;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent url(../images/jeu-concours-top.png) center top / 1750px 649px no-repeat;
}

main {
  position: relative;
  z-index: 2;
  width: 100%;
  background: url(../images/jeu-concours-bottom.jpg);
  background-position-y: bottom;
  background-position-x: center;
  padding-bottom: 890px;
  margin-top: -85px;
  z-index: 0;
  padding-top: 75px;
}

.card {
  width: min(1000px, 100%);
  margin: 0 auto 0;
  padding: 56px 78px 48px;
  background: var(--white);
  border-radius: 30px;
  box-shadow: 0 0 20px var(--shadow);
}

.card__intro {
  text-align: center;
  margin-bottom: 42px;
}

.card h1 {
  margin: 0;
  color: var(--navy);
  font-family: var(--title);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.15;
}

.card h1 span {
  display: block;
  margin-top: 6px;
  color: var(--cyan);
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.15;
}

.card__intro p {
  margin: 18px 0 0;
  color: var(--navy);
  font-family: var(--title);
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 500;
  line-height: 1.3;
}

.panel {
  margin: 0 0 37px;
  padding: 28px 32px;
  min-width: 0;
  border: 1px solid var(--cyan);
  border-radius: 0 0 50px 0;
  background: var(--panel);
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15);
}

.panel__row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 20px 28px;
  align-items: start;
}

.panel__row--score {
  grid-template-columns: minmax(260px, 1.1fr) minmax(280px, 1fr);
}

.panel__q {
  margin: 0;
  padding: 0;
  color: var(--question);
  font-family: var(--body);
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  float: none;
}

.panel__hint {
  display: block;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
}

.choices {
  display: grid;
  gap: 0;
  padding-top: 2px;
}

.choices--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 36px;
}

.choice {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  color: var(--navy);
  font-size: 20px;
  line-height: 36px;
  font-weight: 500;
}

.choice input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background: var(--white);
  display: grid;
  place-content: center;
}

.choice input::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  transform: scale(0);
}

.choice input:checked::after {
  transform: scale(1);
}

.choice input:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.particulier-msg {
  margin: 36px auto 12px;
  max-width: 445px;
  color: #ea0005;
  font-size: 20px;
  font-weight: 600;
  font-style: italic;
  text-align: center;
  line-height: 1.35;
}

#panel-habitat {
  margin-top: 28px;
  padding-top: 22px;
}

.particulier-msg[hidden],
.fields[hidden],
#jeu-suite[hidden],
#panel-habitat[hidden],
.panel[hidden] {
  display: none;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  align-items: start;
  margin-top: 22px;
}

.field--full {
  grid-column: 1 / -1;
}

.field {
  position: relative;
  display: block;
}

.field input {
  width: 100%;
  height: 55px;
  padding: 0 44px 0 16px;
  border: 1px solid var(--input-border);
  border-radius: 5px;
  background: var(--white);
  color: var(--navy);
  font-family: var(--body);
  font-size: 18px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--placeholder);
}

.field input:hover {
  border-color: #a9c8d4;
}

.field input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(81, 188, 236, 0.2);
}

.field input:user-invalid,
.field input.is-invalid,
.choice input.is-invalid,
.score__mark input.is-invalid {
  border-color: #c0392b;
}

.field input.is-valid {
  border-color: #22a34a;
}

.field-ok {
  position: absolute;
  top: 16px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22a34a;
  pointer-events: none;
}

.field-ok::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.field-ok[hidden] {
  display: none;
}

.score {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.score__marks {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  width: 100%;
}

.score__mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 4px;
  cursor: pointer;
  color: var(--navy);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.score__mark input {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--question);
  border-radius: 3px;
  background: var(--white);
  display: grid;
  place-content: center;
}

.score__mark input:checked {
  background: var(--question);
}

.score__mark input:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  margin-bottom: 2px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.score__mark input:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.score__rule {
  position: relative;
  width: 90%;
  height: 15px;
  margin: 2px 5% 0;
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #f26722 20.6%,
    #ffb000 34.1%,
    #ffe422 51.8%,
    #9dd12c 72.2%,
    #239e2f 100%
  ) no-repeat bottom / 100% 3px;
}

.score__rule::before,
.score__rule::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 15px;
}

.score__rule::before {
  left: 0;
  background: #ff0000;
}

.score__rule::after {
  right: 0;
  background: #239e2f;
}

.form-error,
.field-error {
  margin: 6px 0 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.form-error {
  max-width: 450px;
  margin: 16px auto 0;
  text-align: center;
}

.legal {
  margin: 36px 0 35px;
  color: #9c9d9f;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
}

.legal__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: #9c9d9f;
}

.legal__consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--navy);
}

.legal__consent input:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.legal p {
  margin: 16px 0 0;
  color: #9c9d9f;
}

.legal a,
.legal a:hover,
.legal a:visited {
  color: #9c9d9f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.grecaptcha-badge {
  visibility: hidden !important;
}

.field-error[hidden],
.form-error[hidden] {
  display: none;
}

.panel.is-invalid {
  box-shadow: 2px 2px 10px rgba(180, 35, 24, 0.18);
}

.submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(288px, 100%);
  height: 78px;
  margin: 28px auto 8px;
  border: 2px solid var(--cyan);
  border-radius: 999px;
  background: var(--cyan);
  color: var(--white);
  font-family: "Avenir Next", var(--body);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.submit:hover {
  background: var(--white);
  color: var(--cyan);
}

.submit:active {
  transform: translateY(1px);
}

.submit:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.submit:disabled,
.submit:disabled:hover {
  opacity: 1;
  cursor: wait;
  background: var(--cyan);
  color: var(--white);
  transform: none;
}

.submit--off:disabled,
.submit--off:disabled:hover {
  cursor: not-allowed;
  opacity: 0.45;
  background: var(--navy);
}

.submit__spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: submit-spin 0.7s linear infinite;
}

@keyframes submit-spin {
  to {
    transform: rotate(360deg);
  }
}

.success {
  text-align: center;
  padding: 48px 16px 32px;
}

.success h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-family: var(--title);
  font-size: 36px;
  text-transform: uppercase;
}

.success p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}

.scene-bottom {
  position: relative;
  z-index: 0;
  display: flex;
  justify-content: center;
  width: calc(100% + 48px);
  margin: 8px -24px 0;
  pointer-events: none;
}

.scene-bottom img {
  width: min(1100px, 100%);
  height: auto;
}

@media (max-width: 1400px) {
  .landing {
    /* padding: 0 15px 32px; */
  }

main {
    background-size: 100%;
    margin-top: 0;
    padding: 20px 20px 50%;
    background-repeat: no-repeat;
}

  .brands {
    gap: 20px;
    padding: 20px 24px 16px;
    border-radius: 0 0 20px 20px;
    position: absolute;
    left: 0;
    right: 0;
  }

  .brands__eurochem,
  .brands__eoletec {
    width: min(160px, 42%);
  }

  .landing .hero {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1102 / 1560;
    margin: 0;
    padding: 0;
    background-image: url(../images/jeu-concours-top-mobile.png);
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
  }

  .card {
    margin-top: 12px;
    padding: 36px 22px 32px;
    /* margin-inline: 15px; */
  }

  .panel {
    padding: 22px 18px;
  }

  .panel__row,
  .panel__row--score {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .particulier-msg {
    margin-top: 28px;
    font-size: 18px;
  }

  .panel__q {
    font-size: 20px;
    line-height: 1.35;
  }

  .panel__hint {
    font-size: 16px;
  }

  .fields {
    grid-template-columns: 1fr;
  }

  .choice {
    font-size: 18px;
    line-height: 1.4;
  }

  .score__mark {
    font-size: 13px;
  }

  .score__mark input {
    width: 18px;
    height: 18px;
  }

  .score__rule {
    width: 90%;
    margin-left: 5%;
    margin-right: 5%;
  }

  .submit {
    height: 64px;
    font-size: 20px;
  }

  .scene-bottom {
    width: calc(100% + 30px);
    margin-left: -15px;
    margin-right: -15px;
  }
}

body.is-embed {
  padding-top: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
}

body.is-embed [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

body.is-embed .landing:before {
  display: none;
}

body.is-embed main {
  margin: 0;
  padding: 0 0 28px;
  background: #ffffff;
  overflow: visible;
}

body.is-embed .card {
  width: 100%;
  margin: 0;
  padding: 28px 104px 32px;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 720px) {
  body.is-embed .card {
    padding: 20px 16px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .submit {
    transition: none;
  }

  .submit__spinner {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.55;
  }
}
