/* Token e stili condivisi tra sito pubblico e area gestore. */
:root {
  --ocean-950: #041a33;
  --ocean-900: #062a52;
  --ocean-800: #0a3d78;
  --ocean-700: #0b56a3;
  --ocean-500: #1677c9;
  --sky-500: #12a4e6;
  --sky-400: #41c3f5;
  --ice-200: #aee6fb;
  --ice-100: #def5fe;
  --orange-600: #e85d0c;
  --orange-500: #ff7a1a;
  --orange-400: #ff9a3c;
  --orange-100: #ffe7d2;
  --sand-50: #fef8ef;
  --sand-100: #fbecd6;
  --sand-200: #f3d7ae;
  --sand-300: #e7b77a;
  --ink: #0a1d33;
  --ink-soft: #48607a;
  --line: rgba(10, 29, 51, 0.1);
  --white: #fff;

  --font-display: 'Lilita One', system-ui, sans-serif;
  /* Titolo arancio sfumato, come la scritta della locandina */
  --grad-title: linear-gradient(180deg, #ffb551 0%, #ff8a1f 48%, #e85d0c 100%);
  --font-body: 'Manrope', system-ui, sans-serif;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(6, 42, 82, 0.06), 0 2px 8px rgba(6, 42, 82, 0.06);
  --shadow: 0 2px 6px rgba(6, 42, 82, 0.06), 0 18px 40px -12px rgba(6, 42, 82, 0.22);
  --shadow-lg: 0 30px 70px -20px rgba(6, 42, 82, 0.45);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-synthesis: none; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sand-50);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: 0.005em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sky-400); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 400; font-size: 1.5rem;
  text-decoration: none; letter-spacing: 0.01em;
}
.logo-mark { width: auto; height: 46px; filter: drop-shadow(0 4px 8px rgba(4, 26, 51, 0.3)); transition: transform 0.6s var(--ease-spring); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.logo b { color: var(--orange-500); font-weight: 400; }

/* ---------- Bottoni ---------- */
.btn {
  --btn-bg: var(--orange-500);
  --btn-fg: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s, background 0.2s;
  box-shadow: 0 10px 24px -10px var(--btn-bg);
  overflow: hidden; isolation: isolate; white-space: nowrap;
}
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.6s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px var(--btn-bg); }
.btn:hover::after { transform: translateX(100%); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--ghost { --btn-bg: transparent; --btn-fg: currentColor; box-shadow: inset 0 0 0 2px currentColor; }
.btn--ghost:hover { box-shadow: inset 0 0 0 2px currentColor; background: rgba(255, 255, 255, 0.08); }
.btn--sky { --btn-bg: var(--sky-500); }
.btn--dark { --btn-bg: var(--ocean-900); }
.btn--sm { padding: 9px 16px; font-size: 0.9rem; }
.btn--block { width: 100%; }

.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chip / badge ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em;
  background: var(--sand-100); color: var(--ink);
  white-space: nowrap;
}
.chip--level { background: var(--ice-100); color: var(--ocean-700); }
.chip--maschile { background: #dcecff; color: #134a8a; }
.chip--femminile { background: var(--orange-100); color: #b04408; }
.chip--misto { background: #d5f5e8; color: #0c6650; }
.chip--format { background: var(--ocean-900); color: #fff; }

.status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  backdrop-filter: blur(6px);
}
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status--open { color: #0b84c6; }
.status--open::before { animation: pulse 1.6s ease-out infinite; }
.status--closed, .status--past { color: var(--ink-soft); }
.status--full { color: var(--orange-600); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 164, 230, 0.6); }
  100% { box-shadow: 0 0 0 9px rgba(18, 164, 230, 0); }
}

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.input, .field input:not([type='checkbox']):not([type='radio']):not([type='file']), .field select, .field textarea {
  width: 100%; padding: 13px 15px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sky-500); box-shadow: 0 0 0 4px rgba(18, 164, 230, 0.18);
}
.field input:user-invalid, .field select:user-invalid { border-color: var(--orange-500); }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--sky-500); flex-shrink: 0; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--orange-100); color: #9a3a07; font-weight: 600; font-size: 0.92rem;
  animation: shake 0.4s;
}
@keyframes shake {
  25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
