/**
 * Christmas Gospel Gallery
 * Token e stile ripresi dal tema christmas-gospel, in versione scura per l'uso durante i concerti
 */

:root {
  --primary-color: #ffd154;
  --secondary-color: #372800;
  --white-color: #fafafa;
  --black-color: #0d0d0d;

  --surface: #15120b;
  --surface-2: #1d1910;
  --line: rgba(255, 209, 84, 0.22);
  --text-soft: #cfc6b2;
  --danger: #ff7a6b;
  --success: #7ddc8a;

  --font-title: "Cormorant Infant", Georgia, serif;
  --font-body: "Poppins", system-ui, sans-serif;
  --radius: 5px;
  --radius-lg: 14px;
}

/* ---------- Base ---------- */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  color: var(--white-color);
  background-color: var(--black-color);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a,
button,
summary,
label,
select,
input {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 209, 84, 0.25);
}

main {
  flex: 1;
}

a {
  color: var(--primary-color);
}

strong, b {
  font-weight: 600;
}

img {
  max-width: 100%;
  height: auto;
}

.container-narrow {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.page-gallery .container-narrow,
.page-upload .container-narrow {
  max-width: 960px;
}

.page-pad {
  padding-top: 24px;
  padding-bottom: 48px;
}

/* ---------- Tipografia ---------- */

h1, h2, h3, .title-sm, .title-xs {
  font-family: var(--font-title);
  color: var(--white-color);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(48px, 13vw, 80px);
  font-weight: 600;
  line-height: 0.95;
  margin-bottom: 18px;
}

h1 span,
.title-sm span {
  color: var(--primary-color);
  font-style: italic;
  font-weight: 700;
}

h2 {
  font-size: clamp(32px, 9vw, 40px);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 20px;
}

.title-sm {
  font-size: clamp(38px, 10vw, 54px);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 16px;
}

.title-xs {
  font-size: 30px;
  font-weight: 700;
  margin: 0;
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.lead-light {
  color: var(--text-soft);
  font-size: 17px;
  margin-bottom: 28px;
}

.text-muted-light {
  color: var(--text-soft);
}

/* ---------- Bottoni (da .btn del tema) ---------- */

.btn-gold,
.btn-outline-gold {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 32px;
  border-radius: var(--radius);
  transition: all 0.3s ease-in-out;
}

.btn-gold {
  background: var(--primary-color);
  color: #000;
  border: 1px solid var(--primary-color);
}

.btn-gold:focus-visible,
.btn-gold:active {
  background: var(--secondary-color) !important;
  color: var(--primary-color) !important;
  border-color: var(--secondary-color) !important;
}

@media (hover: hover) {
  .btn-gold:hover {
    background: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    border-color: var(--secondary-color) !important;
  }
}

.btn-outline-gold {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline-gold:active {
  background: var(--primary-color);
  color: #000;
}

@media (hover: hover) {
  .btn-outline-gold:hover {
    background: var(--primary-color);
    color: #000;
  }
}

.btn-lg-touch {
  min-height: 58px;
  font-size: 22px;
  padding: 14px 28px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-link-light {
  background: none;
  border: 0;
  color: var(--text-soft);
  font-size: 14px;
  text-decoration: underline;
  min-height: 44px;
  padding: 10px 16px;
}

.link-gold {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- Header / footer ---------- */

.site-header {
  padding: 14px 0;
  position: relative;
  z-index: 20;
}

.page-landing .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-logo img {
  height: 44px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  gap: 6px;
}

.header-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 40px;
  color: var(--white-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  border: 1px solid transparent;
}

.header-nav a i {
  font-size: 18px;
}

.header-nav a.active {
  border-color: var(--line);
  color: var(--primary-color);
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(180deg, var(--black-color), #060606);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--white-color);
  font-size: 22px;
}

.footer-links,
.footer-copy {
  font-size: 12px;
  color: rgba(250, 250, 250, 0.7);
  margin-bottom: 6px;
}

.footer-links a,
.footer-copy a {
  color: rgba(250, 250, 250, 0.85);
  text-decoration: none;
}

.footer-links span {
  margin: 0 6px;
  opacity: 0.5;
}

/* ---------- Landing: hero ---------- */

.hero {
  position: relative;
  min-height: 82svh;
  display: flex;
  align-items: flex-end;
  padding: 110px 0 48px;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay scuro come .overflow-hidden::before del tema + sfumatura verso il nero */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 13, 13, 0.3) 0%, rgba(13, 13, 13, 0.3) 45%, rgba(13, 13, 13, 1) 100%);
  z-index: 1;
}

.hero-bg--default {
  background:
    radial-gradient(ellipse 70% 45% at 50% 18%, rgba(255, 209, 84, 0.32), transparent 70%),
    radial-gradient(ellipse 60% 40% at 15% 70%, rgba(255, 209, 84, 0.10), transparent 70%),
    linear-gradient(180deg, var(--secondary-color) 0%, #1a1300 50%, var(--black-color) 100%);
}

/* Piccole "luci" dorate decorative */
.hero-bg--default::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 209, 84, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 75% 22%, rgba(255, 209, 84, 0.7), transparent),
    radial-gradient(2px 2px at 60% 48%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 33% 58%, rgba(255, 209, 84, 0.6), transparent),
    radial-gradient(1px 1px at 85% 62%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 10% 15%, rgba(255, 255, 255, 0.5), transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  gap: 32px;
}

.hero-form {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.hero-form .card-dark {
  scroll-margin-top: 16px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-lead {
  font-size: 18px;
  color: rgba(250, 250, 250, 0.9);
  margin: 0 auto 28px;
  max-width: 440px;
}

.hero-lead strong {
  color: var(--primary-color);
}

/* ---------- Landing: scatti degli anni passati ---------- */

.past {
  padding: 56px 0 8px;
  text-align: center;
  overflow: hidden;
}

.past-title {
  font-size: 30px;
  margin: 0 16px 28px;
}

.past-title span {
  color: var(--primary-color);
}

.past-track-wrap {
  width: 100%;
  overflow: hidden;
}

.past-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
  width: max-content;
  animation: past-scroll 60s linear infinite;
}

@media (hover: hover) {
  .past-track-wrap:hover .past-track {
    animation-play-state: paused;
  }
}

.past-track {
  will-change: transform;
}

.past-track li {
  flex: 0 0 auto;
  width: 200px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
}

.past-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes past-scroll {
  to { transform: translateX(calc(-50% - 6px)); }
}

@media (min-width: 900px) {
  .past { padding-top: 80px; }
  .past-title { font-size: 40px; }
  .past-track { gap: 16px; }
  .past-track li { width: 260px; }
  @keyframes past-scroll {
    to { transform: translateX(calc(-50% - 8px)); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .past-track-wrap { overflow-x: auto; }
  .past-track { animation: none; }
  .past-track li[aria-hidden="true"] { display: none; }
}

/* ---------- Landing: cos'è e come funziona ---------- */

.about {
  padding-top: 40px;
  padding-bottom: 56px;
}

.about-title {
  font-size: 28px;
  margin: 0 0 12px;
  color: var(--primary-color);
}

.about-text {
  color: var(--text-soft);
  margin: 0 0 32px;
  line-height: 1.55;
}

.steps {
  padding-bottom: 0;
}

@media (min-width: 900px) {
  .hero {
    align-items: center;
    padding: 120px 0 72px;
    text-align: left;
  }

  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
    padding: 0 32px;
  }

  .hero-lead {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-form {
    margin: 0;
    max-width: none;
  }

  .hero-cta {
    display: none;
  }

  .about {
    max-width: 760px;
    padding-top: 64px;
  }
}

.steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 10px;
}

.steps-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
}

.step-n {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 22px;
  color: #000;
  background: var(--primary-color);
}

.steps-list strong {
  display: block;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
}

.steps-list small {
  color: var(--text-soft);
  font-size: 13px;
}

.steps-note {
  text-align: center;
  font-family: var(--font-title);
  font-size: 22px;
  font-style: italic;
  color: var(--primary-color);
  line-height: 1.2;
  margin: 0;
}

/* ---------- Form ---------- */

.register {
  padding-bottom: 48px;
  scroll-margin-top: 16px;
}

.card-dark {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
}

.form-dark .field {
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 359px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-dark .form-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.optional {
  opacity: 0.7;
  font-size: 12px;
}

.form-dark .form-control,
.form-dark .form-select,
.city-switch .form-select {
  background-color: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--white-color);
  min-height: 52px;
  font-size: 16px; /* evita lo zoom automatico su iOS */
  border-radius: var(--radius);
}

.form-dark .form-select,
.city-switch .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffd154' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.form-dark .form-control:focus,
.form-dark .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 209, 84, 0.2);
  background-color: var(--surface-2);
  color: var(--white-color);
}

.form-dark .is-invalid,
.check.is-invalid input {
  border-color: var(--danger) !important;
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
}

.check {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 14px 0 2px;
  padding: 8px 0;
}

.check input {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  margin-top: 0;
  accent-color: var(--primary-color);
}

.check label {
  font-size: 14px;
  line-height: 1.5;
  color: var(--white-color);
}

.check label small {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
}

.form-dark .btn-gold {
  margin-top: 24px;
}

.form-note {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  margin: 10px 0 0;
}

/* Honeypot: fuori dallo schermo, non display:none (alcuni bot lo riconoscono) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.city-picker {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 209, 84, 0.06);
}

.city-picker summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}

.city-picker summary::-webkit-details-marker {
  display: none;
}

.city-picker summary i {
  color: var(--primary-color);
}

.city-picker summary small {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  margin-left: 22px;
}

.city-change {
  color: var(--primary-color);
  font-size: 13px;
  text-decoration: underline;
}

.city-picker[open] summary {
  border-bottom: 1px solid var(--line);
}

.city-picker[open] .form-label,
.city-picker[open] .form-select {
  margin: 12px 16px 0;
  width: calc(100% - 32px);
}

.city-picker[open] .form-select {
  margin-bottom: 16px;
}

.alert-gold {
  background: rgba(255, 209, 84, 0.12);
  border: 1px solid var(--line);
  color: var(--white-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 15px;
}

.alert-gold i {
  color: var(--primary-color);
  margin-right: 4px;
}

/* ---------- Upload ---------- */

.upload-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0 16px;
}

.upload-head .eyebrow {
  width: 100%;
}

.city-switch .form-select {
  min-height: 48px;
  font-size: 16px; /* sotto i 16px iOS ingrandisce la pagina al tocco */
  margin-bottom: 16px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 190px;
  padding: 24px;
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 209, 84, 0.16), transparent 70%), var(--surface);
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.dropzone:active,
.dropzone.is-drag {
  transform: scale(0.98);
  background-color: var(--surface-2);
}

.dropzone i {
  font-size: 46px;
  color: var(--primary-color);
  line-height: 1;
}

.dropzone strong {
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

.dropzone small {
  color: var(--text-soft);
  font-size: 13px;
}

.upload-hint {
  font-size: 13px;
  color: var(--primary-color);
  margin: 14px 0 0;
  text-align: center;
}

.queue {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.q-thumb {
  flex: 0 0 52px;
  height: 52px;
  border-radius: 6px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 22px;
}

.q-thumb img,
.q-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.q-body {
  flex: 1;
  min-width: 0;
}

.q-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin: 6px 0 4px;
}

.q-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary-color);
  transition: width 0.25s ease;
}

.q-status {
  font-size: 12px;
  color: var(--text-soft);
}

.queue-item.is-done .q-status {
  color: var(--success);
}

.queue-item.is-done .q-bar span {
  background: var(--success);
}

.queue-item.is-error .q-status {
  color: var(--danger);
}

.queue-item.is-error .q-bar span {
  background: var(--danger);
}

.q-retry {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--primary-color);
  font-size: 20px;
}

.upload-done {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(125, 220, 138, 0.1);
  border: 1px solid rgba(125, 220, 138, 0.35);
}

.upload-done i {
  font-size: 28px;
  color: var(--primary-color);
}

.upload-done small {
  color: var(--text-soft);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 40px 0 14px;
}

.count {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  font-style: normal;
  vertical-align: middle;
  color: #000;
  background: var(--primary-color);
  border-radius: 20px;
  padding: 2px 9px;
}

.empty-state {
  color: var(--text-soft);
  text-align: center;
  padding: 28px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
}

.upload-limits {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  margin: 24px 0 0;
}

.logout {
  text-align: center;
  margin-top: 8px;
}

/* ---------- Griglia media ---------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

@media (min-width: 576px) {
  .media-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
}

@media (min-width: 900px) {
  .media-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.media-tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 28px;
}

.media-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

@media (hover: hover) {
  .media-tile:hover img {
    transform: scale(1.04);
  }
}

.badge-video {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.7);
  color: var(--primary-color);
  font-size: 16px;
}

.media-tile.is-new {
  animation: pop 0.5s ease;
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Galleria ---------- */

.city-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin: 8px -16px 18px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}

.city-tabs::-webkit-scrollbar {
  display: none;
}

.city-tabs a {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white-color);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
}

.city-tabs a small {
  opacity: 0.6;
  margin-left: 4px;
}

.city-tabs a.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #000;
  font-weight: 500;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #050505;
  color: var(--white-color);
  overscroll-behavior: contain;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.92);
}

html.lb-open {
  overflow: hidden;
}

/* Il contenuto occupa tutto lo schermo: i gesti (swipe, pinch, doppio tap) li gestisce lightbox.js */
.lb-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  padding: calc(64px + env(safe-area-inset-top)) env(safe-area-inset-right) calc(80px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}

.lb-stage img,
.lb-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  will-change: transform;
  -webkit-user-drag: none;
}

.lb-stage video {
  touch-action: auto;
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--white-color);
  font-size: 22px;
  display: grid;
  place-items: center;
}

.lb-close:active,
.lb-prev:active,
.lb-next:active {
  background: rgba(255, 255, 255, 0.28);
}

.lb-close {
  top: calc(8px + env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
}

.lb-prev,
.lb-next {
  bottom: calc(14px + env(safe-area-inset-bottom));
}

.lb-prev { left: max(16px, env(safe-area-inset-left)); }
.lb-next { right: max(16px, env(safe-area-inset-right)); }

.lb-counter {
  position: absolute;
  z-index: 2;
  bottom: calc(26px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.lb-counter[hidden],
.lb-prev[hidden],
.lb-next[hidden] {
  display: none;
}

/* ---------- Pagine legali ---------- */

.legal p,
.legal li {
  color: var(--text-soft);
  font-size: 15px;
}

.placeholder-legal {
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: rgba(255, 209, 84, 0.06);
}

.placeholder-legal strong {
  display: block;
  color: var(--primary-color);
  margin-bottom: 8px;
}

/* ---------- Accessibilità ---------- */

:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

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

/* ==========================================================================
   Landing in versione chiara (come christmasgospel.it):
   sfondi bianchi, titoli marrone #372800, oro solo per accenti e bottoni.
   Hero e footer restano scuri.
   ========================================================================== */

.page-landing {
  --surface: #ffffff;
  --surface-2: #f6f2e8;
  --line: rgba(55, 40, 0, 0.16);
  --text-soft: #6b5d3d;
  --danger: #c0392b;
  background-color: var(--white-color);
  color: var(--black-color);
}

.page-landing a {
  color: var(--secondary-color);
}

/* Hero: foto con velo scuro, testo bianco */
.page-landing .hero {
  color: var(--white-color);
}

.page-landing .hero a:not(.btn) {
  color: var(--primary-color);
}

.page-landing .hero-bg::before {
  background:
    linear-gradient(90deg, rgba(13, 13, 13, 0.72) 0%, rgba(13, 13, 13, 0.4) 60%, rgba(13, 13, 13, 0.3) 100%);
}

@media (max-width: 899px) {
  .page-landing .hero-bg::before {
    background: linear-gradient(180deg, rgba(13, 13, 13, 0.45) 0%, rgba(13, 13, 13, 0.7) 100%);
  }
}

/* Card del form: bianca sopra la foto */
.page-landing .card-dark {
  background: #fff;
  border: 0;
  color: var(--black-color);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.page-landing .card-dark h2 {
  color: var(--secondary-color);
}

.page-landing .form-dark .form-label {
  color: var(--secondary-color);
  font-weight: 400;
}

.page-landing .form-dark .form-control,
.page-landing .form-dark .form-select {
  background-color: #fff;
  border: 1px solid rgba(55, 40, 0, 0.25);
  color: var(--black-color);
}

.page-landing .form-dark .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23372800' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.page-landing .form-dark .form-control:focus,
.page-landing .form-dark .form-select:focus {
  background-color: #fff;
  color: var(--black-color);
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(255, 209, 84, 0.45);
}

.page-landing .check label {
  color: var(--black-color);
}

.page-landing .check input {
  accent-color: var(--secondary-color);
}

.page-landing .city-picker {
  background: rgba(255, 209, 84, 0.18);
}

.page-landing .city-picker summary i,
.page-landing .city-change {
  color: var(--secondary-color);
}

.page-landing .alert-gold {
  color: var(--black-color);
  background: rgba(255, 209, 84, 0.25);
}

/* Sezioni sotto la hero: sfondo bianco */
.page-landing .past {
  background: var(--white-color);
}

.page-landing .past .eyebrow {
  color: var(--secondary-color);
}

.page-landing .past-title {
  color: var(--secondary-color);
}

.page-landing .past-title span {
  color: var(--primary-color);
  font-style: italic;
  font-weight: 700;
}

.page-landing .past-track li {
  background: #ece6d6;
  box-shadow: 0 8px 24px rgba(55, 40, 0, 0.12);
}

.page-landing .about-title {
  color: var(--secondary-color);
  position: relative;
}

.page-landing .about-title::before {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 2px;
  width: 50px;
  height: 14px;
  background: var(--primary-color);
  opacity: 0.5;
  z-index: -1;
}

.page-landing .about-text {
  color: var(--black-color);
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1.3;
}

.page-landing .steps-list li {
  background: #fff;
  border: 1px solid rgba(55, 40, 0, 0.1);
  box-shadow: 0 6px 20px rgba(55, 40, 0, 0.06);
}

.page-landing .steps-list strong {
  color: var(--secondary-color);
}

.page-landing .steps-note {
  color: var(--secondary-color);
}

/* ==========================================================================
   Carica, galleria e pagine legali: stessa versione chiara della landing.
   Header e footer restano scuri (logo bianco), lightbox scura per le foto.
   ========================================================================== */

.page-upload,
.page-gallery,
.page-legal {
  --surface: #ffffff;
  --surface-2: #f6f2e8;
  --line: rgba(55, 40, 0, 0.16);
  --text-soft: #6b5d3d;
  --danger: #c0392b;
  --success: #2e8b43;
  background-color: var(--white-color);
  color: var(--black-color);
}

.page-upload .site-header,
.page-gallery .site-header,
.page-legal .site-header {
  background: var(--black-color);
}

.page-upload main a:not(.btn):not(.media-tile),
.page-gallery main a:not(.btn):not(.media-tile):not(.active),
.page-legal main a {
  color: var(--secondary-color);
}

.page-upload h1, .page-upload h2, .page-upload h3,
.page-gallery h1, .page-gallery h2, .page-gallery h3,
.page-legal h1, .page-legal h2, .page-legal h3,
.page-upload .title-sm, .page-upload .title-xs,
.page-gallery .title-sm, .page-gallery .title-xs {
  color: var(--secondary-color);
}

.page-upload .eyebrow,
.page-gallery .eyebrow,
.page-upload .upload-hint,
.page-upload .link-gold,
.page-gallery .link-gold {
  color: var(--secondary-color);
}

.page-upload h1 span,
.page-gallery h1 span {
  color: #d9a520;
}

.page-upload .alert-gold,
.page-gallery .alert-gold {
  color: var(--black-color);
  background: rgba(255, 209, 84, 0.25);
}

.page-upload .alert-gold i,
.page-upload .upload-done i,
.page-upload .q-retry,
.page-upload .dropzone i {
  color: var(--secondary-color);
}

.page-upload .dropzone {
  border-color: var(--primary-color);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 209, 84, 0.3), transparent 70%), #fff;
  box-shadow: 0 8px 24px rgba(55, 40, 0, 0.08);
}

.page-upload .dropzone strong {
  color: var(--secondary-color);
}

.page-upload .queue-item {
  border: 1px solid rgba(55, 40, 0, 0.1);
  box-shadow: 0 4px 14px rgba(55, 40, 0, 0.05);
}

.page-upload .q-bar {
  background: rgba(55, 40, 0, 0.1);
}

.page-upload .upload-done {
  background: rgba(46, 139, 67, 0.08);
  border-color: rgba(46, 139, 67, 0.35);
}

.page-upload .empty-state,
.page-gallery .empty-state {
  border-color: rgba(55, 40, 0, 0.2);
}

.page-upload .city-switch .form-select {
  background-color: #fff;
  border: 1px solid rgba(55, 40, 0, 0.25);
  color: var(--black-color);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23372800' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.page-upload .btn-link-light,
.page-gallery .btn-link-light {
  color: var(--text-soft);
}

.page-gallery .city-tabs a {
  color: var(--secondary-color);
  border-color: rgba(55, 40, 0, 0.25);
  background: #fff;
}

.page-gallery .city-tabs a.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #000;
}

.page-upload .media-tile,
.page-gallery .media-tile {
  background: #ece6d6;
}

.page-upload .btn-outline-gold,
.page-gallery .btn-outline-gold {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.page-upload .btn-outline-gold:active,
.page-gallery .btn-outline-gold:active {
  background: var(--secondary-color);
  color: var(--primary-color);
}

@media (hover: hover) {
  .page-upload .btn-outline-gold:hover,
  .page-gallery .btn-outline-gold:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
  }
}

.page-legal .placeholder-legal strong {
  color: var(--secondary-color);
}

/* La lightbox resta scura */
.lightbox {
  --text-soft: #cfc6b2;
}

/* Il footer resta scuro: i suoi link non ereditano il marrone delle pagine chiare */
.site-footer .footer-links a,
.site-footer .footer-copy a {
  color: rgba(250, 250, 250, 0.85);
}

.site-footer .footer-social a {
  color: var(--white-color);
}

.site-footer .footer-links a:hover,
.site-footer .footer-copy a:hover,
.site-footer .footer-social a:hover {
  color: var(--primary-color);
}

/* Città fissata dal link della landing */
.city-fixed {
  margin: 0 0 16px;
  font-size: 15px;
}

.city-fixed small {
  display: block;
  opacity: 0.7;
}

/* Video Stories (area utente) */
.story-box {
  margin: 32px 0 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
}

.story-box[hidden],
.story-box [hidden] {
  display: none !important;
}

.story-text,
.story-hint,
.story-progress {
  font-size: 14px;
  color: var(--text-soft);
}

.story-result video {
  display: block;
  width: min(100%, 270px);
  aspect-ratio: 9 / 16;
  margin: 16px auto;
  border-radius: 12px;
  background: #000;
}

.story-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Contenuti extra: perché partecipare, tappe, FAQ, call to action, footer
   ========================================================================== */

.why,
.tour,
.faq {
  padding-top: 56px;
  text-align: center;
}

.why .about-title span,
.tour .about-title span,
.faq .about-title span,
.cta-band h2 span {
  color: #d9a520;
  font-style: italic;
}

.feature-grid {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  text-align: left;
}

.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(55, 40, 0, 0.12);
  }
}

.feature-card i {
  font-size: 30px;
  color: #d9a520;
}

.feature-card h3 {
  font-family: var(--font-title);
  font-size: 24px;
  margin: 12px 0 6px;
  color: var(--secondary-color);
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.tour-grid {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}

.tour-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--black-color);
  color: var(--white-color) !important;
  text-decoration: none;
  text-align: left;
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tour-card.is-current,
.tour-card:active {
  border-color: var(--primary-color);
}

@media (hover: hover) {
  .tour-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
  }
}

.tour-name {
  font-family: var(--font-title);
  font-size: 30px;
  color: var(--primary-color);
  line-height: 1.1;
}

.tour-card small {
  opacity: 0.75;
}

.tour-go {
  margin-top: 8px;
  font-size: 13px;
  color: var(--primary-color);
}

.faq-list {
  margin-top: 24px;
  text-align: left;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list details[open] {
  padding-bottom: 16px;
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 10px 4px;
  font-weight: 500;
  color: var(--secondary-color);
}

.faq-list details > p {
  padding: 0 4px;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  font-size: 22px;
  line-height: 1;
  color: #d9a520;
  transition: transform 0.2s ease;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list p {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

.cta-band {
  margin-top: 64px;
  padding: 56px 0;
  text-align: center;
  background: radial-gradient(ellipse at top, #2a2108 0%, var(--black-color) 70%);
  color: var(--white-color);
}

.cta-band h2 {
  font-family: var(--font-title);
  font-size: clamp(34px, 7vw, 52px);
  color: var(--white-color);
  margin: 0 0 8px;
}

.cta-band h2 span {
  color: var(--primary-color);
}

.cta-band p {
  margin: 0 0 24px;
  opacity: 0.8;
}

/* Pagine interne */
.page-lead {
  max-width: 560px;
  margin: 8px 0 24px;
  color: var(--text-soft);
  font-size: 15px;
}

.stat-row {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-row li {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 8px;
  text-align: center;
}

.stat-row strong {
  display: block;
  font-family: var(--font-title);
  font-size: 34px;
  line-height: 1;
  color: var(--secondary-color);
}

.stat-row span {
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Footer a colonne (resta scuro su tutte le pagine) */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 20px;
  text-align: left;
  margin-bottom: 28px;
}

.footer-brand {
  grid-column: 1 / -1;
}

.footer-brand p {
  max-width: 360px;
  margin: 12px 0 0;
  font-size: 13px;
  color: rgba(250, 250, 250, 0.7);
}

.footer-brand .footer-social {
  justify-content: flex-start;
  margin: 16px 0 0;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 14px;
}

.footer-col a {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.footer-col h3 {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-color);
  font-weight: 500;
}

.site-footer .footer-col a {
  color: rgba(250, 250, 250, 0.85);
  text-decoration: none;
}

.site-footer .footer-col a:hover {
  color: var(--primary-color);
}

@media (min-width: 700px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tour-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }
}

/* ---------- Area riservata: eliminazione file ---------- */

.media-cell {
  position: relative;
}

.media-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  margin: 0;
}

.media-delete button {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* Il cerchio resta piccolo (32px) ma l'area di tocco è 44px */
.media-delete button::before {
  content: "";
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.78);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.media-delete button i {
  position: relative;
}

.media-delete button:active::before,
.media-delete button:focus-visible::before {
  background: #c0392b;
}

@media (hover: hover) {
  .media-delete button:hover::before {
    background: #c0392b;
  }
}

/* ==========================================================================
   Mobile: navigazione a schede, form, conferma a foglio, dettagli
   ========================================================================== */

.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--primary-color);
  color: #000 !important;
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* Barra a schede in basso (solo da telefono, solo per chi è registrato) */
.tabbar {
  display: none;
}

@media (max-width: 639px) {
  .header-nav {
    display: none;
  }

  .site-logo img {
    height: 38px;
  }

  .site-header {
    padding: 10px 0;
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .page-landing .site-header {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  body.has-tabbar {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: rgba(13, 13, 13, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .tabbar a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 62px;
    padding: 8px 4px;
    color: rgba(250, 250, 250, 0.72) !important;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
  }

  .tabbar a i {
    font-size: 23px;
    line-height: 1;
  }

  .tabbar a.active {
    color: var(--primary-color) !important;
    font-weight: 500;
  }

  .tabbar a.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28%;
    right: 28%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--primary-color);
  }

  .tabbar a:active {
    background: rgba(255, 255, 255, 0.06);
  }
}

/* Form: campo data coerente su iOS, link leggibili sul bianco */
.form-dark input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 52px;
  text-align: left;
  line-height: 1.2;
}

.form-dark input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.2em;
}

.page-landing .card-dark a {
  color: var(--secondary-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.form-dark .form-control,
.form-dark .form-select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-dark .btn-gold[disabled],
.form-dark .btn-gold[aria-busy="true"] {
  opacity: 0.7;
  pointer-events: none;
}

.field-error {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.field-error::before {
  content: "!";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

/* Galleria: tab città con scorrimento a scatti e bordi sfumati */
.city-tabs {
  scroll-snap-type: x proximity;
  scroll-padding: 0 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
}

.city-tabs a {
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

/* Foglio di conferma dal basso (eliminazione file) */
.sheet {
  width: 100%;
  max-width: 480px;
  margin: auto auto 0;
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 22px 22px 0 0;
  background: #fff;
  color: var(--black-color);
  overscroll-behavior: contain;
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.sheet[open] {
  animation: sheet-up 0.22s ease-out;
}

@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sheet::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin: -8px auto 16px;
  border-radius: 4px;
  background: rgba(55, 40, 0, 0.2);
}

.sheet-title {
  margin: 0 0 6px;
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--secondary-color);
}

.sheet-text {
  margin: 0 0 20px;
  color: var(--text-soft);
  font-size: 15px;
}

.sheet-actions {
  display: grid;
  gap: 10px;
}

.sheet-actions .btn {
  min-height: 52px;
}

.btn-danger-solid {
  background: #c0392b;
  border: 1px solid #c0392b;
  color: #fff;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-danger-solid:active {
  background: #962d22;
}

/* Telefoni piccoli (320-359px) */
@media (max-width: 359px) {
  .btn-gold,
  .btn-outline-gold {
    padding: 10px 18px;
    font-size: 18px;
  }

  .btn-lg-touch {
    font-size: 20px;
    padding: 12px 18px;
  }

  .card-dark {
    padding: 22px 14px;
  }

  .hero {
    padding-top: 92px;
  }

  .stat-row strong {
    font-size: 28px;
  }
}

/* Telefono in orizzontale: poca altezza */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 0;
    padding-top: 80px;
  }

  .lb-stage {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .lb-counter {
    bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .tabbar a {
    min-height: 48px;
    flex-direction: row;
    gap: 8px;
    font-size: 13px;
  }

  body.has-tabbar {
    padding-bottom: calc(50px + env(safe-area-inset-bottom));
  }
}

/* Schermi grandi: le schede in basso non servono, resta il menu in alto */
@media (min-width: 640px) {
  .tabbar {
    display: none;
  }
}

/* Il segnale di errore lo disegna .field-error: via l'icona di Bootstrap (si sovrapponeva a quella del calendario) */
.form-dark .form-control.is-invalid,
.form-dark .form-select.is-invalid {
  background-image: none;
  padding-right: 12px;
}

.form-dark .form-select.is-invalid {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23372800' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Esci: header (desktop) e footer (sempre, anche da telefono) */
.header-logout {
  margin: 0;
}

.header-logout button,
.footer-logout button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.header-logout button {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 40px;
  font-size: 14px;
  color: var(--white-color);
}

.header-logout button i {
  font-size: 18px;
}

.header-logout button:hover,
.site-footer .footer-logout button:hover {
  color: var(--primary-color);
}

.site-footer .footer-logout button {
  min-height: 32px;
  font-size: 13px;
  color: rgba(250, 250, 250, 0.85);
}

/* ---------- Form di registrazione compatto ---------- */
.hero-form .card-dark {
  padding: 18px 16px;
}

.hero-form .card-dark h2 {
  font-size: 28px;
  margin: 0 0 10px;
}

.form-dark .field {
  margin-bottom: 8px;
}

.field-row {
  gap: 8px;
}

.form-dark .form-label {
  font-size: 12px;
  margin-bottom: 2px;
}

.form-dark .form-control,
.form-dark .form-select {
  min-height: 42px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.hero-form .city-fixed {
  margin: 0 0 8px;
  font-size: 14px;
}

.hero-form .city-fixed small {
  display: inline;
  margin-left: 6px;
}

.hero-form .check {
  gap: 10px;
  margin: 4px 0 0;
  padding: 4px 0;
}

.hero-form .check input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.hero-form .check label {
  font-size: 12px;
  line-height: 1.35;
}

.hero-form .check label small {
  font-size: 11px;
}

.form-dark .btn-gold {
  margin-top: 12px;
}

.form-note {
  margin: 6px 0 0;
}

.hero-form .form-dark .btn-lg-touch {
  min-height: 48px;
  font-size: 18px;
  padding: 8px 20px;
}

/* Righe del form a due colonne: colonne sempre uguali, il campo data non allarga la sua */
.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row .field,
.form-dark input[type="date"] {
  min-width: 0;
}

/* I link del consenso nel form restano scuri sul bianco (la regola della hero li colorava d'oro) */
.page-landing .hero .card-dark a:not(.btn) {
  color: var(--secondary-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

/* Il campo data segue l'altezza compatta degli altri campi del form */
.form-dark input[type="date"] {
  min-height: 42px;
}
