/* ============================================================
   GATE — ingresso protetto condiviso (Thalassa · Borgo Harenae)
   Sorgente unico: landing-factory/shared/gate/
   Non definisce font né palette: eredita quelli del sito che lo
   ospita, così ogni progetto resta sé stesso e l'impianto è comune.
   ============================================================ */

html.gate-locked,
html.gate-locked body { overflow: hidden; height: 100%; }

/* Nasconde il sito finché il gate non è superato, senza toccarne il markup */
html.gate-locked body > *:not(.gate) { display: none !important; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  color: #fff;
  background-color: #10201f;
  background-size: cover;
  background-position: center;
  font-family: var(--font-body, 'Raleway', system-ui, sans-serif);
}

/* Velatura: leggibilità del testo senza spegnere la foto */
.gate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10, 22, 30, 0.55) 0%,
    rgba(10, 22, 30, 0.30) 38%,
    rgba(10, 22, 30, 0.72) 100%);
}

.gate > * { position: relative; z-index: 1; }

/* ─── Marchio, come nella nav dei siti ─── */
.gate__brand {
  padding: 22px 32px;
}
.gate__brand img {
  height: 38px;
  width: auto;
  display: block;
}

/* ─── Centro ─── */
.gate__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px 8vh;
}

.gate__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 1.1rem;
}

.gate__title {
  font-family: var(--font-display, var(--font-heading, Georgia, serif));
  font-weight: 400;
  line-height: 1.05;
  font-size: clamp(2.6rem, 1.8rem + 4vw, 5.2rem);
  margin-bottom: 0.6rem;
}

.gate__sub {
  font-size: 1rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 3rem;
}

/* ─── Form: una linea, nessun box ─── */
.gate__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  width: min(100%, 320px);
}

.gate__input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0.7rem 0.2rem;
  outline: none;
  transition: border-color 0.3s;
}
.gate__input::placeholder {
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.gate__input:focus { border-bottom-color: #fff; }

/* CTA identica a quelle di Thalassa e Borgo */
.gate__btn {
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 0.95rem 2.6rem;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.gate__btn:hover,
.gate__btn:focus-visible {
  background: #fff;
  border-color: #fff;
  color: #16242c;
}

.gate__error {
  min-height: 1.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s;
}
/* Due logiche d'errore: Thalassa aggiunge la classe, Borgo scrive il testo.
   Entrambe devono mostrare il messaggio. */
.gate__error.is-visible,
.gate__error:not(:empty) { opacity: 0.92; }

/* Borgo nasconde il gate con .hidden (già !important nel suo style.css):
   qui garantiamo che il display:flex non lo riporti in vita. */
.gate.hidden { display: none !important; }

.gate--shake { animation: gate-shake 0.4s; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.gate__foot {
  padding: 0 32px 26px;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
}

@media (max-width: 640px) {
  .gate__brand { padding: 18px 20px; }
  .gate__brand img { height: 30px; }
  .gate__inner { padding-bottom: 6vh; }
}

@media (prefers-reduced-motion: reduce) {
  .gate--shake { animation: none; }
}
