/* =========================================================================
   Quando Passa – base condivisa (token colore, reset, tipografia, pulsanti)
   Usata dall'app e dalle pagine di contenuto (/fermate/, 404).
   ========================================================================= */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3f1ee;
  --surface-3: #e9e5e0;
  --ink: #1b2f36;
  --ink-2: #536a71;
  --line: rgba(27, 47, 54, 0.12);
  --brand: #e8553a;
  --primary: #c9432b;
  --primary-hover: #b83c26;
  --on-primary: #ffffff;
  --primary-soft: #fdeee9;
  --primary-soft-ink: #a33a22;
  --teal: #1f5563;
  --gold: #f2b705;
  --gold-soft: #fff7db;
  --gold-ink: #6b4e00;
  --danger: #b42318;
  --focus: #0b63ce;
  --shadow-sm: 0 1px 2px rgba(16, 32, 38, 0.08), 0 2px 8px rgba(16, 32, 38, 0.06);
  --shadow-lg: 0 10px 30px rgba(16, 32, 38, 0.16), 0 2px 6px rgba(16, 32, 38, 0.08);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --control: 44px;
  --gutter: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --viewport-height: 100dvh;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1a1f;
  --surface: #16242a;
  --surface-2: #1e2f36;
  --surface-3: #283c44;
  --ink: #eef3f4;
  --ink-2: #a9bcc2;
  --line: rgba(238, 243, 244, 0.13);
  --brand: #ff7a5c;
  --primary: #ff7a5c;
  --primary-hover: #ff9478;
  --on-primary: #1b0e0a;
  --primary-soft: #3a2420;
  --primary-soft-ink: #ffb4a3;
  --teal: #7fd1e0;
  --gold: #ffd04f;
  --gold-soft: #3a3115;
  --gold-ink: #ffe08a;
  --danger: #ff8a80;
  --focus: #7cb8ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary-soft-ink);
  text-underline-offset: 2px;
}

:root[data-theme="dark"] a {
  color: var(--primary-soft-ink);
}

[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: calc(8px + var(--safe-top));
  left: 8px;
  z-index: 3000;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-small {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------- pulsanti */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.button:active {
  transform: scale(0.98);
}

.button-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.button-primary:hover {
  background: var(--primary-hover);
}

a.button-primary,
:root[data-theme="dark"] a.button-primary {
  color: var(--on-primary);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--surface-2);
}

.button-tonal {
  flex-direction: column;
  gap: 4px;
  min-height: 64px;
  padding: 8px 6px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.8125rem;
}

a.button-tonal,
:root[data-theme="dark"] a.button-tonal {
  color: var(--ink);
}

.button-tonal:hover {
  background: var(--surface-3);
}

.button-tonal.is-active {
  background: var(--gold-soft);
  color: var(--gold-ink);
}

.button-tonal.is-active .icon-star {
  fill: currentColor;
}

.button-ghost {
  background: transparent;
  color: var(--ink-2);
}

.button-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.button-danger,
.button-danger:hover {
  color: var(--danger);
}

.button-block {
  width: 100%;
}

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