/* ==========================================================================
   Xploration Day – Landing page
   ========================================================================== */

:root {
  --black: #000;
  --white: #fff;
  --ink: #141414;
  --label: #383838;
  --muted: rgba(0, 0, 0, 0.67);
  --placeholder: rgba(0, 0, 0, 0.59);
  --line: rgba(0, 0, 0, 0.1);
  --dash: rgba(0, 0, 0, 0.2);
  --field-bg: rgba(0, 0, 0, 0.04);
  --slot-bg: #f5f5f5;
  --slot-border: #eaeaea;
  --error: #c4002f;
  --success: #2e7d32;

  --font-title: "Montserrat", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, sans-serif;

  --card-w: 614px;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  overflow-x: hidden;
}

img { display: block; max-width: none; }
p, h1, h2 { margin: 0; }

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

.eyebrow {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 10px;
  line-height: normal;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ---------- Shader elements (WebGPU canvas + static fallback) ---------- */

.shader-fallback,
.shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.is-live > .shader-fallback { visibility: hidden; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  height: 900px;
  background: linear-gradient(to bottom, #fff, #f0f0f0);
  overflow: hidden;
}

/* 1440×900 scene in design coordinates; scaled down on smaller screens.
   Stacking: orbits (1) < planets behind (5) < logo (10) < planets in front (20). */
.hero__stage {
  --scale: 1;
  position: absolute;
  top: 0;
  left: 50%;
  width: 1440px;
  height: 900px;
  transform: translateX(-50%) scale(var(--scale));
  transform-origin: 50% 40%;
  pointer-events: none;
}

.orbit {
  position: absolute;
  z-index: 1;
  transform-origin: 50% 50%;
  will-change: transform;
}
.orbit--1 {
  left: 30.84px;
  top: 230.65px;
  width: 1377.714px;
  height: 342.911px;
  transform: rotate(-30deg);
}
.orbit--2 {
  left: 133.16px;
  top: 256.12px;
  width: 1173.082px;
  height: 291.978px;
  transform: rotate(30deg);
}

.planet {
  position: absolute;
  z-index: 5;
  border-radius: 50%;
  overflow: hidden;
  will-change: transform;
}
.planet.is-front { z-index: 20; }

.hero__logo {
  position: absolute;
  z-index: 10;
  left: 422.018px;
  top: 314px;
  width: 595.965px;
  will-change: transform;
}

.logo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 595.965 / 79;
}
.logo img { position: absolute; }

/* ==========================================================================
   Registration
   ========================================================================== */

.register {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -368px; /* overlaps the hero, as in the design (form starts at y=532) */
  padding: 0 16px 48px;
}

/* Event info */
.event-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: var(--card-w);
  background: rgba(0, 0, 0, 0.05);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  border-radius: 16px 16px 0 0;
  text-align: center;
}

.event-info__intro {
  grid-column: 1 / -1;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
}

.event-info__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 16px 32px;
}
.event-info__col + .event-info__col { border-left: 1px solid var(--line); }

.event-info__value {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
}
.event-info__value strong { font-weight: 700; }

/* Boarding pass */
.pass {
  position: relative;
  width: 100%;
  max-width: var(--card-w);
  margin-top: -16px;
  padding: 25px 24px 24px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.pass__inner {
  border: 1px dashed var(--dash);
  border-radius: 9px;
}

.pass__head,
.pass__intro,
.pass__fields { border-bottom: 1px dashed var(--dash); }

.pass__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
}

.pass__mission {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pass__type {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.pass__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
}

.pass__intro-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pass__title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 32px;
  line-height: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.pass__lead {
  max-width: 401px;
  font-family: var(--font-title);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-wrap: balance;
}

.pass__badge {
  position: relative;
  flex: none;
  width: 100px;
  height: 100px;
}

.foil {
  position: absolute;
  inset: 0;
  border-radius: 14px;
}

.pass__badge-rocket {
  position: absolute;
  left: 24.5px;
  top: 28.5px;
}

/* Fields */
.pass__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.field-row {
  display: flex;
  gap: 16px;
}
.field-row > .field { flex: 1 1 0; min-width: 0; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field__label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  line-height: normal;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--label);
}
.field__label--multiline { align-items: flex-start; }

/* Accompagnant·e·s : un groupe nom / prénom / organisation par personne */
.companion {
  gap: 12px;
  padding: 16px;
  border: 1px dashed currentColor;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--label) 40%, transparent);
}
.companion[hidden] { display: none; }
.companion > legend { float: left; width: 100%; }

/* Icons whose SVG bleeds outside their layout box (stroke overflow in Figma) */
.icon { position: relative; flex: none; height: 7.5px; }
.icon img { position: absolute; }
.icon--person { width: 5.834px; }
.icon--person img { left: -0.5px; top: -0.5px; }
.icon--people { width: 17.668px; }
.icon--people img { left: -0.5px; top: -0.5px; }

.field__control {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--black);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field__control::placeholder { color: var(--placeholder); opacity: 1; }
.field__control:focus-visible {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.select { position: relative; }
.select .field__control {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
}
.select .field__control:invalid { color: var(--placeholder); }
.select option { color: var(--black); }
.select__caret {
  position: absolute;
  right: 14.54px;
  top: 20px;
  transform: scaleY(-1);
  pointer-events: none;
}

/* Time slots */
.slots { gap: 12px; }

.slots__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.slots__full {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 700;
  font-size: 14px;
}

.slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--slot-bg);
  border: 1px solid var(--slot-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.slot:hover { border-color: rgba(56, 56, 56, 0.4); }

.slot input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slot__radio {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(56, 56, 56, 0.24);
  border-radius: 10px;
}
.slot__radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: var(--white);
  transform: scale(0);
  transition: transform 0.15s;
}

.slot__text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  line-height: normal;
  white-space: nowrap;
}

.slot:has(input:checked) {
  background: var(--black);
  border: 1.5px solid var(--label);
  padding: 11.5px 15.5px;
}
.slot:has(input:checked) .slot__radio { border-color: var(--white); }
.slot:has(input:checked) .slot__radio::after { transform: scale(1); }
.slot:has(input:checked) .slot__text { color: var(--white); }
.slot:has(input:focus-visible) { outline: 2px solid var(--black); outline-offset: 2px; }

/* Validation feedback (after a submit attempt) */
.was-validated .field__control:invalid { border-color: var(--error); }
.was-validated .slots:has(input:invalid) .slot { border-color: var(--error); }

/* Footer of the pass */
.pass__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.barcode {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: none;
}
.barcode__bars {
  display: flex;
  gap: 2px;
  height: 40px;
}
.barcode__bars i {
  display: block;
  height: 40px;
  background: rgba(0, 0, 0, var(--o));
}
.barcode__code {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 8px;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.27);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 40px;
  background: var(--black);
  border: 0;
  border-radius: 12px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 14px;
  line-height: normal;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.btn-submit:hover img { transform: translate(2px, -2px); }
.btn-submit img { transition: transform 0.2s; }
.btn-submit:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }
.btn-submit:disabled { opacity: 0.6; cursor: progress; transform: none; }

.form-status {
  font-family: var(--font-body);
  font-size: 14px;
  text-align: center;
}
.form-status:empty { display: none; }
.form-status.is-error,
.form-status.is-success { margin-top: 16px; }
.form-status.is-error { color: var(--error); }
.form-status.is-success { color: var(--success); font-weight: 600; }

/* Confirmation */
.confirmation {
  width: 100%;
  max-width: var(--card-w);
  margin-bottom: 24px;
  padding: 24px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  outline: none;
  animation: confirmation-in 0.5s ease-out;
}
.confirmation[hidden] { display: none; }

.confirmation__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px dashed var(--dash);
  border-radius: 9px;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.confirmation__inner p { margin: 0; }
.confirmation__inner strong { color: var(--black); }

.confirmation__title {
  margin: 4px 0;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--black);
}

.confirmation__bye {
  margin-top: 4px !important;
  font-weight: 700;
  color: var(--black);
}

@keyframes confirmation-in {
  from { opacity: 0; transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
  .confirmation { animation: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 59px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 48px 40px 80px; /* 48px + 32px right-col inset from the design */
  text-align: center;
  color: var(--ink);
}

.footer__by,
.footer__contact {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
}

.footer__contact a { color: inherit; }
.footer__contact a[href^="tel:"] { text-decoration: none; }

.footer__logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
}

.footer__main-logo { max-width: 100%; height: auto; }

.logo-link {
  display: block;
  max-width: 100%;
  border-radius: 4px;
  transition: opacity 0.2s;
}
.logo-link:hover { opacity: 0.7; }
.logo-link:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }
.logo-link img { display: block; }

.footer__amp {
  display: flex;
  align-items: center;
  gap: 23.171px;
  width: 100%;
}
.footer__amp img { flex: 1 1 0; min-width: 0; height: 1px; }
.footer__amp span {
  font-family: var(--font-title);
  font-size: 30px;
  letter-spacing: 3.44px;
  color: #858585;
}

.partners {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.partners__sep img {
  width: 40px;
  height: 1.448px;
  transform: rotate(-90deg);
  margin: 0 -19.28px;
}

.partner-logo {
  position: relative;
  display: block;
  height: 40px;
}
.partner-logo img { position: absolute; }
.partner-logo--webup { width: 135px; }
.partner-logo--target { width: 145px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .hero__stage { --scale: 0.8; }
}

@media (max-width: 900px) {
  .footer { padding: 0 24px 40px; gap: 48px; }
  .partners {
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px 32px;
  }
  .partners__sep { display: none; }
}

@media (max-width: 680px) {
  .hero { height: 560px; }
  .hero__stage { --scale: 0.6; transform-origin: 50% 32%; }
  .register { margin-top: -180px; }

  .pass { padding: 17px 16px 16px; }
  .pass__head,
  .pass__intro,
  .pass__fields,
  .pass__foot { padding: 20px 16px; }
  .pass__title { font-size: 26px; }
  .pass__badge { transform: scale(0.8); margin: -10px; }

  .field-row { flex-direction: column; }
  .slots__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .pass__foot { flex-direction: column-reverse; align-items: stretch; }
  .barcode { align-self: flex-start; }
  .btn-submit { padding: 16px 20px; letter-spacing: 2px; white-space: normal; }

  .footer__amp span { font-size: 24px; }
}

@media (max-width: 420px) {
  .event-info { grid-template-columns: 1fr; }
  .event-info__col + .event-info__col { border-left: 0; border-top: 1px solid var(--line); }
  .event-info__col { padding: 16px; }
  .event-info__col:last-child { padding-bottom: 32px; }
  .pass__type { display: none; }
  .pass__badge { display: none; }
  .slot { padding: 12px; gap: 8px; }
  .slot:has(input:checked) { padding: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ALTCHA */
.field--altcha altcha-widget {
  display: block;
  font-family: var(--font-body);
  --altcha-max-width: 100%;
  --altcha-color-base: var(--field-bg);
  --altcha-border-color: var(--line);
  --altcha-border-radius: 8px;
  --altcha-color-primary: var(--black);
  --altcha-color-error: var(--error);
}

/* ---------- Loader (masqué au chargement complet de la page) ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--white);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__orbit { width: 120px; height: 120px; transform: rotate(-30deg); }
.loader__track { fill: none; stroke: var(--line); stroke-width: 2; }
.loader__comet {
  fill: none;
  stroke: var(--black);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 40 260;
  animation: loader-orbit 1.4s linear infinite;
}
@keyframes loader-orbit { to { stroke-dashoffset: -300; } }
@media (prefers-reduced-motion: reduce) {
  .loader__comet { animation-duration: 3s; }
  .loader { transition: none; }
}
