/* Etizei: tema "Aegean Circuit", marmo antico e segnali digitali.
   Tipografia self-hosted (Space Grotesk + Fraunces, entrambi OFL), niente
   CDN font esterni. Blocchi a spigoli netti, niente glassmorphism/pillole:
   ispirazione da composizioni piatte a campiture piene e accento laterale. */

@font-face {
  font-family: "Etizei Grotesk";
  src: url("/assets/fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Etizei Grotesk";
  src: url("/assets/fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Etizei Display";
  src: url("/assets/fonts/fraunces-600.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Etizei Display";
  src: url("/assets/fonts/fraunces-500italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --aegean-night: #0b1026;
  --aegean-deep: #171c3f;
  --aegean-indigo: #262c5e;
  --marble: #f4efe4;
  --marble-dim: #c9c3b3;
  --gold: #d9b25f;
  --gold-bright: #f2cf82;
  --terracotta: #e0754a;
  --ok-glow: #58e6b0;
  --blue-deep: #1b3a8a;
  --blue-bright: #4f7fe0;
  --blue-light: #8ab4f5;
  --edge: 3px;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(60rem 40rem at 15% -10%, rgba(217, 178, 95, 0.13), transparent 60%),
    radial-gradient(50rem 40rem at 110% 15%, rgba(224, 117, 74, 0.1), transparent 55%),
    linear-gradient(180deg, var(--aegean-night) 0%, var(--aegean-deep) 45%, var(--aegean-indigo) 100%);
  /* attachment fixed: il gradiente resta ancorato al viewport invece di
     stirarsi sull'intera altezza del documento: altrimenti su pagine
     lunghe la parte bassa appare come un unico colore piatto, rompendo
     la continuità visiva rispetto all'header (richiesta esplicita). */
  background-attachment: fixed;
  color: var(--marble);
  font-family: "Etizei Grotesk", -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.font-display {
  font-family: "Etizei Display", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.font-display em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold-bright);
}

/* Bagliori animati, discreti: fixed cosi' restano coerenti con lo
   sfondo (anch'esso fixed) durante lo scroll invece di rimanere ancorati
   solo alla prima schermata. */
.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: 45rem;
  height: 45rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  animation: drift 24s ease-in-out infinite alternate;
}

.aurora::before {
  top: -18rem;
  left: -10rem;
  background: radial-gradient(circle, var(--gold-bright), transparent 70%);
}

.aurora::after {
  bottom: -20rem;
  right: -12rem;
  background: radial-gradient(circle, var(--terracotta), transparent 70%);
  animation-delay: -9s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(3rem, -2rem) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after { animation: none; }
}

/* Fascia a chiave greca (meandro), motivo originale disegnato via SVG. */
.meander {
  height: 12px;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='12' viewBox='0 0 28 12'%3E%3Cpath d='M0 0 H10 V5 H4 V9 H14 V0 H28 V12 H0 Z' fill='%23d9b25f' fill-opacity='0.55'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 12px;
  opacity: 0.75;
}

.navbar-etizei {
  position: relative;
  z-index: 10;
  background: rgba(11, 16, 38, 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(217, 178, 95, 0.22);
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1;
}

.brand-mark .wordmark {
  font-family: "Etizei Display", serif;
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  /* Blu chiaro -> oro: entrambi gli estremi restano leggibili sullo
     sfondo scuro (a differenza del blu profondo usato in precedenza,
     che sul finale si confondeva col background). */
  background: linear-gradient(100deg, var(--blue-light) 0%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark .accent {
  color: var(--gold-bright);
}

.brand-mark .payoff {
  font-family: "Etizei Grotesk", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--marble-dim);
}

.nav-link-etizei {
  position: relative;
  color: var(--marble-dim);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding-bottom: 0.3rem;
  transition: color 0.2s ease;
}

.nav-link-etizei::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-light), var(--gold-bright));
  transition: right 0.25s ease;
}

.nav-link-etizei:hover {
  color: var(--marble);
}

.nav-link-etizei:hover::after {
  right: 0;
}

.nav-link-etizei.active {
  color: var(--gold-bright);
}

.nav-link-etizei.active::after {
  right: 0;
}

.btn-etizei.active {
  background: linear-gradient(100deg, var(--blue-light), var(--gold-bright));
  color: var(--aegean-night);
  border-color: transparent;
}

/* Selettore lingua */
.lang-switch .btn {
  background: transparent;
  border: 1px solid rgba(217, 178, 95, 0.4);
  color: var(--marble);
  border-radius: var(--edge);
  font-weight: 500;
}

.lang-switch .btn:hover,
.lang-switch .btn:focus {
  background: rgba(217, 178, 95, 0.14);
  color: var(--marble);
}

.lang-switch .dropdown-menu {
  background: var(--aegean-deep);
  border: 1px solid rgba(217, 178, 95, 0.4);
  border-radius: var(--edge);
}

.lang-switch .dropdown-item {
  color: var(--marble);
}

.lang-switch .dropdown-item:hover,
.lang-switch .dropdown-item.active {
  background: rgba(217, 178, 95, 0.18);
  color: var(--gold-bright);
}

.hero {
  position: relative;
  padding: 7rem 1rem 6rem;
  z-index: 1;
  overflow: hidden;
}

/* Stelline che brillano, dietro al testo dell'header. Due strati con
   timing diverso cosi' non lampeggiano tutte insieme. */
.hero .stars {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.hero .stars::before,
.hero .stars::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero .stars::before {
  background-image:
    radial-gradient(1.4px 1.4px at 8% 22%, var(--marble), transparent),
    radial-gradient(1.2px 1.2px at 28% 58%, var(--marble), transparent),
    radial-gradient(1px 1px at 48% 14%, var(--gold-bright), transparent),
    radial-gradient(1.2px 1.2px at 68% 42%, var(--marble), transparent),
    radial-gradient(1.5px 1.5px at 86% 24%, var(--marble), transparent),
    radial-gradient(1px 1px at 95% 58%, var(--gold-bright), transparent),
    radial-gradient(1.2px 1.2px at 18% 78%, var(--marble), transparent),
    radial-gradient(1.4px 1.4px at 58% 74%, var(--marble), transparent);
  animation: twinkle-a 4.5s ease-in-out infinite;
}

.hero .stars::after {
  background-image:
    radial-gradient(1px 1px at 14% 48%, var(--marble), transparent),
    radial-gradient(1.4px 1.4px at 38% 30%, var(--gold-bright), transparent),
    radial-gradient(1px 1px at 54% 64%, var(--marble), transparent),
    radial-gradient(1.4px 1.4px at 78% 12%, var(--marble), transparent),
    radial-gradient(1px 1px at 91% 38%, var(--gold-bright), transparent),
    radial-gradient(1.4px 1.4px at 24% 36%, var(--marble), transparent);
  animation: twinkle-b 6s ease-in-out infinite;
  animation-delay: 1.4s;
}

@keyframes twinkle-a {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.85; }
}

@keyframes twinkle-b {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .stars::before, .hero .stars::after { animation: none; opacity: 0.4; }
}

/* Mare in movimento sullo sfondo dell'header: due strati di onde
   traslucide che scorrono a velocita' diverse, in stile inciso/vettoriale
   coerente col resto del tema (nessuna immagine, solo SVG inline). */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  left: -10%;
  width: 120%;
  height: 9rem;
  bottom: -1rem;
  z-index: -1;
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: 60rem 9rem;
  opacity: 0.16;
}

.hero::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='90' viewBox='0 0 600 90'%3E%3Cpath d='M0 45 Q75 10 150 45 T300 45 T450 45 T600 45 V90 H0 Z' fill='%234f7fe0'/%3E%3C/svg%3E");
  animation: wave-drift-slow 26s linear infinite;
  bottom: -0.5rem;
}

.hero::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='90' viewBox='0 0 600 90'%3E%3Cpath d='M0 55 Q75 85 150 55 T300 55 T450 55 T600 55 V90 H0 Z' fill='%23d9b25f'/%3E%3C/svg%3E");
  animation: wave-drift-fast 17s linear infinite reverse;
  opacity: 0.1;
}

@keyframes wave-drift-slow {
  from { background-position-x: 0; }
  to   { background-position-x: -60rem; }
}

@keyframes wave-drift-fast {
  from { background-position-x: 0; }
  to   { background-position-x: -60rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after { animation: none; }
}

.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.7rem);
  line-height: 1.1;
}

.hero .lede {
  color: var(--marble-dim);
  font-size: 1.15rem;
  max-width: 40rem;
}

/* Etichetta di sezione con accento laterale, non centrata/fluttuante. */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
}

.section-label::before {
  content: "";
  width: 1.75rem;
  height: 10px;
  /* Mini meandro al posto di una semplice lineetta piena. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='10' viewBox='0 0 28 10'%3E%3Cpath d='M0 0 H9 V4 H4 V7 H12 V0 H28 V10 H0 Z' fill='%23d9b25f'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 14px 10px;
}

.btn-etizei {
  border-radius: var(--edge);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.65rem 1.5rem;
  border: 1px solid transparent;
}

.btn-gold {
  background: var(--gold);
  color: var(--aegean-night);
}

.btn-gold:hover {
  background: var(--gold-bright);
  color: var(--aegean-night);
}

.btn-outline-marble {
  border: 1px solid rgba(244, 239, 228, 0.5);
  color: var(--marble);
  background: transparent;
}

.btn-outline-marble:hover {
  background: rgba(244, 239, 228, 0.08);
  border-color: var(--marble);
  color: var(--marble);
}

/* Blocco piatto a spigoli vivi con accento superiore, non vetro/arrotondato. */
.block-flat {
  position: relative;
  overflow: hidden;
  background: rgba(244, 239, 228, 0.04);
  border: 1px solid rgba(217, 178, 95, 0.2);
  border-top: var(--edge) solid var(--gold);
  border-radius: 0;
  padding: 1.9rem 1.6rem;
  height: 100%;
  box-shadow: 0 1.5rem 2.5rem -1.75rem rgba(0, 0, 0, 0.55);
}

/* Brillio: una sottile striscia di luce che attraversa il blocco al passaggio del mouse. */
.block-flat::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 35%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(244, 239, 228, 0.16), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
  pointer-events: none;
}

.block-flat:hover::before {
  left: 130%;
}

@media (prefers-reduced-motion: reduce) {
  .block-flat::before { transition: none; display: none; }
}

.block-flat .block-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.block-flat .icon-badge {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--aegean-night);
}

.block-flat .icon-badge svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  fill: none;
}

.block-flat h3 {
  font-family: "Etizei Display", serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.005em;
  color: var(--marble);
  margin-bottom: 0;
}

.block-flat p {
  color: var(--marble-dim);
  margin-bottom: 0;
}

.status-pulse {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--ok-glow);
  box-shadow: 0 0 0 0 rgba(88, 230, 176, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(88, 230, 176, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(88, 230, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(88, 230, 176, 0); }
}

.cta-band {
  position: relative;
  z-index: 1;
  background: rgba(244, 239, 228, 0.03);
  border: 1px solid rgba(217, 178, 95, 0.28);
  border-left: var(--edge) solid var(--gold);
  padding: 2.75rem 2.25rem;
  box-shadow: 0 2rem 3rem -2rem rgba(0, 0, 0, 0.6);
}

.price-tag {
  font-family: "Etizei Display", serif;
  font-weight: 600;
  color: var(--gold-bright);
}

footer.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(217, 178, 95, 0.2);
  /* Padding basso maggiorato: il widget "Serve aiuto?" e il banner
     cookie sono fixed in basso e non devono mai coprire il testo reale
     del footer quando si scrolla fino in fondo. */
  padding: 2.5rem 1rem 5.5rem;
  color: var(--marble-dim);
  font-size: 0.88rem;
}

footer.site-footer a {
  color: var(--marble-dim);
  text-decoration: none;
}

footer.site-footer a:hover {
  color: var(--gold-bright);
}

/* Pagina di login */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 25rem;
  background: rgba(23, 28, 63, 0.6);
  border: 1px solid rgba(217, 178, 95, 0.28);
  border-top: var(--edge) solid var(--gold);
  padding: 2.5rem;
  box-shadow: 0 2rem 3rem -2rem rgba(0, 0, 0, 0.6);
}

.login-card .form-control {
  background: rgba(244, 239, 228, 0.06);
  border: 1px solid rgba(244, 239, 228, 0.2);
  border-radius: var(--edge);
  color: var(--marble);
}

.login-card .form-control:focus {
  background: rgba(244, 239, 228, 0.1);
  border-color: var(--gold);
  color: var(--marble);
  box-shadow: 0 0 0 0.15rem rgba(217, 178, 95, 0.22);
}

.login-card .form-control::placeholder {
  color: var(--marble-dim);
}

.login-card label {
  color: var(--marble-dim);
  font-size: 0.85rem;
}

.alert-etizei {
  background: rgba(224, 117, 74, 0.14);
  border: 1px solid rgba(224, 117, 74, 0.5);
  border-radius: 0;
  color: var(--marble);
}

[data-i18n], [data-i18n-placeholder] {
  transition: opacity 0.15s ease;
}

/* Banner cookie informativo: piccolo, angolo basso-destra, non una
   fascia a piena larghezza. */
#cookie-banner {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  left: auto;
  z-index: 1050;
  max-width: 20rem;
  background: rgba(11, 16, 38, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(217, 178, 95, 0.35);
  border-top: var(--edge) solid var(--gold);
  color: var(--marble);
  box-shadow: 0 1.5rem 2.5rem -1.5rem rgba(0, 0, 0, 0.7);
}

#cookie-banner .container {
  max-width: none;
  padding: 1rem 1.1rem;
}

#cookie-banner.d-none {
  display: none !important;
}

@media (max-width: 420px) {
  #cookie-banner {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
}

.legal-body h2 {
  font-family: "Etizei Display", serif;
  color: var(--gold-bright);
  font-size: 1.2rem;
  margin-top: 2.2rem;
}

.legal-body p, .legal-body li {
  color: var(--marble-dim);
}

.legal-body a {
  color: var(--gold-bright);
}

.legal-body .lead-in {
  font-size: 1.08rem;
  color: var(--marble);
}

/* Breadcrumb */
.breadcrumb-etizei {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--marble-dim);
}

.breadcrumb-etizei a {
  color: var(--marble-dim);
  text-decoration: none;
}

.breadcrumb-etizei a:hover {
  color: var(--gold-bright);
}

.breadcrumb-etizei .sep {
  opacity: 0.5;
}

.breadcrumb-etizei .current {
  color: var(--gold);
}

/* Widget "Serve aiuto?": angolo basso-sinistra, presente nelle aree
   applicative e nelle pagine di contenuto. */
.help-widget {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 1040;
}

.help-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(11, 16, 38, 0.9);
  border: 1px solid rgba(217, 178, 95, 0.4);
  color: var(--marble);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  box-shadow: 0 1rem 2rem -1rem rgba(0, 0, 0, 0.6);
}

.help-toggle:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  background: var(--gold);
  color: var(--aegean-night);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.help-bubble {
  position: absolute;
  left: 0;
  bottom: 3.2rem;
  width: 18rem;
  background: var(--aegean-deep);
  border: 1px solid rgba(217, 178, 95, 0.4);
  border-top: var(--edge) solid var(--gold);
  padding: 1rem 1.1rem;
  font-size: 0.85rem;
  color: var(--marble-dim);
  box-shadow: 0 1.5rem 2.5rem -1.5rem rgba(0, 0, 0, 0.7);
}

.help-bubble.d-none {
  display: none !important;
}

.help-bubble h4 {
  font-family: "Etizei Grotesk", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  margin-bottom: 0.5rem;
}

.help-bubble ul {
  padding-left: 1.1rem;
  margin-bottom: 0;
}

@media (max-width: 420px) {
  .help-bubble {
    width: calc(100vw - 2.5rem);
  }
}
