/* ───────────────────────────────────────────────────────────
   Leeftijdsverificatie (18+) + intro-overlay  —  gedeeld bestand
   Geladen op index.html, over-ons.html en apparel.html.
   Inhoud (logo + formulier) wordt door age-gate.js geinjecteerd.
   ─────────────────────────────────────────────────────────── */

#intro-root { display: none; }

.show-intro #intro-root {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #193d53;
  overflow: hidden;
  cursor: default; /* herstel native cursor: body heeft cursor:none + custom dot ligt erachter */
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}
.show-intro,
.show-intro body { overflow: hidden; }

/* ── Logo (CSS-mask van het witte logo, zodat de kleur te animeren is) ── */
.intro-logo-pos {
  position: absolute;
  left: 50%;
  top: 12vh;
  transform: translateX(-50%);
  transition: top 0.55s cubic-bezier(0.76, 0, 0.24, 1),
              transform 0.55s cubic-bezier(0.76, 0, 0.24, 1);
}

.intro-logo {
  width: clamp(170px, 30vw, 300px);
  aspect-ratio: 378.76 / 119.03;
  background-color: #fff;
  -webkit-mask: url('Logo/Klaasje logo wit.svg') center / contain no-repeat;
          mask: url('Logo/Klaasje logo wit.svg') center / contain no-repeat;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.show-intro #intro-root .intro-logo {
  animation: introLogoIn 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes introLogoIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
}

/* Kleurcyclus: directe sprongen (steps), exact als de oude loadingscreen */
#intro-root.is-coloring .intro-logo {
  animation: introLogoColors 0.55s steps(1, end) forwards;
}
@keyframes introLogoColors {
  0%   { background-color: #db3b4b; }
  33%  { background-color: #6fbf5a; }
  66%  { background-color: #ffd243; }
  100% { background-color: #ffd243; }
}

/* ── Verificatie-formulier ── */
.intro-gate {
  position: absolute;
  left: 50%;
  top: 53%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s ease;
}

.intro-fields {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.intro-input {
  width: 58px;
  padding: 14px 0;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  color: #fff;
  text-align: center;
  font: 500 18px 'AlteHaasGrotesk', sans-serif;
  letter-spacing: 0.06em;
  outline: none;
  cursor: text;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.intro-input--year { width: 86px; }
.intro-input::placeholder { color: rgba(255, 255, 255, 0.4); letter-spacing: 0.14em; }
.intro-input:focus { border-color: #fff; }
.intro-input::-webkit-outer-spin-button,
.intro-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.intro-submit {
  padding: 0 22px;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  color: #fff;
  font: 700 14px 'AlteHaasGrotesk', sans-serif;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.intro-submit:hover { background: #fff; color: #193d53; border-color: #fff; }

/* ── Uitleg + 18+ badge ── */
.intro-note {
  margin-top: 24px;
  text-align: center;
}
.intro-note p {
  max-width: 320px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.8);
  font: 400 14px/1.55 'AlteHaasGrotesk', sans-serif;
  text-wrap: balance;
}
.intro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-top: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font: 700 14px 'AlteHaasGrotesk', sans-serif;
}

/* ── Foutmelding ── */
.intro-error {
  min-height: 1.2em;
  margin: 16px auto 0;
  max-width: 15em;
  color: #db3b4b;
  text-align: center;
  text-wrap: balance;
  font: 400 14px/1.5 'AlteHaasGrotesk', sans-serif;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.intro-error.is-visible { opacity: 1; }

/* ── Error-shake op de invulvakjes ── */
@keyframes introShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.intro-fields.shake { animation: introShake 0.4s ease; }

/* ── Submit-sequentie: logo naar midden, gate weg, daarna omhoog ── */
#intro-root.is-submitting .intro-gate { opacity: 0; pointer-events: none; }
#intro-root.is-submitting .intro-logo-pos { top: 50%; transform: translate(-50%, -50%); }
#intro-root.is-out .intro-logo { opacity: 0; transform: translateY(-18px) scale(1.08); }
#intro-root.is-out { transform: translateY(-100%); }

/* Op telefoon de hele groep (logo + gate) lager, beter verticaal gecentreerd */
@media (max-width: 600px) {
  .intro-logo-pos { top: 23vh; }
  .intro-gate { top: 64%; }
}

@media (prefers-reduced-motion: reduce) {
  .show-intro #intro-root .intro-logo { animation: none; }
  .intro-logo-pos, .intro-gate, .intro-logo, .show-intro #intro-root { transition: none; }
  .intro-fields.shake { animation: none; }
}
