/* ============================================================
   Menù Digitale Facile — Global Design System
   Mobile-first | Custom Properties | BEM-like
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ── Custom Properties ────────────────────────────────────── */
:root {
  /* Colors — Brand */
  --c-primary:          #c45d3e;
  --c-primary-light:    #d97b62;
  --c-primary-dark:     #a44a2e;
  --c-secondary:        #2d6a4f;
  --c-secondary-light:  #3d8a67;
  --c-secondary-dark:   #1e4d38;
  --c-accent:           #d4a843;
  --c-accent-light:     #e0bc6a;
  --c-accent-dark:      #b88e2e;

  /* Colors — UI */
  --c-bg:               #faf9f7;
  --c-bg-alt:           #f3f1ec;
  --c-surface:          #ffffff;
  --c-surface-raised:   #fffffe;
  --c-border:           #e5e2dc;
  --c-border-strong:    #ccc9c2;

  /* Colors — Text */
  --c-text:             #1a1814;
  --c-text-muted:       #6b6560;
  --c-text-subtle:      #9b948d;
  --c-text-on-primary:  #ffffff;
  --c-text-on-dark:     #faf9f7;

  /* Colors — Semantic */
  --c-error:            #c45d3e;
  --c-error-bg:         #fdf0ec;
  --c-error-border:     #f0b9aa;
  --c-success:          #2d6a4f;
  --c-success-bg:       #edf7f2;
  --c-success-border:   #a8d9bf;
  --c-warning:          #d4a843;
  --c-warning-bg:       #fdf8ec;
  --c-warning-border:   #f0d9a0;
  --c-info:             #3b82f6;
  --c-info-bg:          #eff6ff;
  --c-info-border:      #bfdbfe;

  /* Typography */
  --f-body:             'DM Sans', system-ui, sans-serif;
  --f-display:          'Playfair Display', Georgia, serif;

  /* Font Sizes — clamp(min, preferred, max) */
  --fs-xs:              clamp(0.70rem, 0.68rem + 0.10vw, 0.75rem);
  --fs-sm:              clamp(0.80rem, 0.78rem + 0.12vw, 0.875rem);
  --fs-base:            clamp(0.95rem, 0.92rem + 0.15vw, 1rem);
  --fs-md:              clamp(1.00rem, 0.96rem + 0.20vw, 1.125rem);
  --fs-lg:              clamp(1.10rem, 1.05rem + 0.28vw, 1.25rem);
  --fs-xl:              clamp(1.25rem, 1.15rem + 0.50vw, 1.5rem);
  --fs-2xl:             clamp(1.45rem, 1.28rem + 0.85vw, 1.875rem);
  --fs-3xl:             clamp(1.70rem, 1.44rem + 1.30vw, 2.25rem);
  --fs-4xl:             clamp(2.00rem, 1.60rem + 2.00vw, 3rem);
  --fs-5xl:             clamp(2.50rem, 1.90rem + 3.00vw, 4rem);

  /* Line Heights */
  --lh-tight:           1.2;
  --lh-snug:            1.375;
  --lh-base:            1.6;
  --lh-relaxed:         1.75;

  /* Spacing */
  --sp-1:               0.25rem;
  --sp-2:               0.5rem;
  --sp-3:               0.75rem;
  --sp-4:               1rem;
  --sp-5:               1.25rem;
  --sp-6:               1.5rem;
  --sp-8:               2rem;
  --sp-10:              2.5rem;
  --sp-12:              3rem;
  --sp-16:              4rem;
  --sp-20:              5rem;
  --sp-24:              6rem;

  /* Border Radius */
  --r-sm:               0.25rem;
  --r-md:               0.5rem;
  --r-lg:               0.75rem;
  --r-xl:               1rem;
  --r-2xl:              1.5rem;
  --r-full:             9999px;

  /* Shadows */
  --shadow-sm:          0 1px 3px rgba(26, 24, 20, 0.06), 0 1px 2px rgba(26, 24, 20, 0.04);
  --shadow-md:          0 4px 12px rgba(26, 24, 20, 0.08), 0 2px 4px rgba(26, 24, 20, 0.05);
  --shadow-lg:          0 10px 28px rgba(26, 24, 20, 0.10), 0 4px 10px rgba(26, 24, 20, 0.06);
  --shadow-xl:          0 20px 48px rgba(26, 24, 20, 0.14), 0 8px 20px rgba(26, 24, 20, 0.08);

  /* Transitions */
  --t-fast:             150ms ease;
  --t-base:             250ms ease;
  --t-slow:             400ms ease;

  /* Layout */
  --container-max:      1200px;
  --nav-height:         64px;
  --sidebar-width:      260px;
}

/* Dark mode rimosso — solo versione chiara per ora */

/* ── Modern CSS Reset ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

img, video, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  line-height: var(--lh-tight);
  color: var(--c-text);
  font-weight: 600;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p { max-width: 70ch; }

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection {
  background-color: var(--c-primary);
  color: #fff;
}

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

@media (min-width: 640px) {
  .container { padding-inline: var(--sp-6); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--sp-8); }
}

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

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo:hover {
  text-decoration: none;
}

.nav__logo-text {
  height: 40px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav__logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: block;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(196, 93, 62, 0.32);
  transition: transform var(--t-base, 0.2s) ease, box-shadow var(--t-base, 0.2s) ease;
}

.nav__logo:hover .nav__logo-mark {
  transform: rotate(-6deg) scale(1.05);
  box-shadow: 0 6px 18px rgba(196, 93, 62, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav__toggle {
  display: none; /* menu pubblico = pochi link: niente hamburger, link sempre inline */
  flex-direction: column;
  gap: 5px;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background-color var(--t-fast);
}

.nav__toggle:hover {
  background-color: var(--c-bg-alt);
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--c-text);
  border-radius: var(--r-full);
  transition: transform var(--t-base), opacity var(--t-fast);
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-1);
}

/* Su mobile mostra solo "Accedi": nascondi il bottone Registrati */
@media (max-width: 767px) {
  .nav__links a.btn {
    display: none;
  }

  /* "Accedi" (unico link visibile) diventa un vero pulsante outline */
  .nav__links a:not(.btn) {
    padding: var(--sp-2) var(--sp-5);
    color: var(--c-primary);
    font-weight: 600;
    border: 2px solid var(--c-primary);
    border-radius: var(--r-lg);
    line-height: 1;
    transition: color var(--t-fast), background-color var(--t-fast);
  }

  .nav__links a:not(.btn):hover {
    color: #fff;
    background-color: var(--c-primary);
  }
}

.nav__links--open {
  display: flex;
}

.nav__links a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--c-text-muted);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: color var(--t-fast), background-color var(--t-fast);
}

.nav__links a:hover {
  color: var(--c-primary);
  background-color: var(--c-bg-alt);
  text-decoration: none;
}

.nav__links a.btn {
  color: #fff;
  background-color: var(--c-primary);
  border-color: var(--c-primary);
  padding: var(--sp-2) var(--sp-4);
}

.nav__links a.btn:hover {
  color: #fff;
  background-color: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
}

.nav__links a.active {
  color: var(--c-primary);
  font-weight: 600;
}

@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }

  .nav__links {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: static;
    padding: 0;
    border-bottom: none;
    box-shadow: none;
    gap: var(--sp-1);
  }

  .nav__links a {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
  }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-family: var(--f-body);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--r-lg);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    box-shadow var(--t-fast),
    transform var(--t-fast);
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn--primary {
  background-color: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

.btn--primary:hover {
  background-color: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  color: #fff;
}

/* Secondary */
.btn--secondary {
  background-color: var(--c-secondary);
  border-color: var(--c-secondary);
  color: #fff;
}

.btn--secondary:hover {
  background-color: var(--c-secondary-dark);
  border-color: var(--c-secondary-dark);
  color: #fff;
}

/* Success */
.btn--success {
  background-color: var(--c-success);
  border-color: var(--c-success);
  color: #fff;
}

.btn--success:hover {
  background-color: var(--c-secondary-dark);
  border-color: var(--c-secondary-dark);
  color: #fff;
}

/* Danger */
.btn--danger {
  background-color: var(--c-error);
  border-color: var(--c-error);
  color: #fff;
}

.btn--danger:hover {
  background-color: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  color: #fff;
}

/* Ghost */
.btn--ghost {
  background-color: transparent;
  border-color: var(--c-border-strong);
  color: var(--c-text);
}

.btn--ghost:hover {
  background-color: var(--c-bg-alt);
  border-color: var(--c-text-muted);
  color: var(--c-text);
}

/* Sizes */
.btn--sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
  border-radius: var(--r-md);
  gap: var(--sp-1);
}

.btn--lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--fs-lg);
  border-radius: var(--r-xl);
}

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

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}

.card--hover {
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
  cursor: pointer;
}

.card--hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--c-border-strong);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.card__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
}

.card__body {
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}

.card__footer {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ── Form System ──────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
}

.form-label .required {
  color: var(--c-error);
  margin-left: var(--sp-1);
}

.form-hint {
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
  line-height: var(--lh-snug);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-family: var(--f-body);
  color: var(--c-text);
  background-color: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--c-text-subtle);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--c-border-strong);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(196, 93, 62, 0.15);
  background-color: var(--c-surface);
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px rgba(196, 93, 62, 0.12);
}

.form-input.is-success,
.form-select.is-success,
.form-textarea.is-success {
  border-color: var(--c-success);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-10);
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: var(--lh-relaxed);
}

.form-error {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--c-error);
  font-weight: 500;
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.form-check__input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  background-color: var(--c-surface);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0;
  position: relative;
}

.form-check__input:checked {
  background-color: var(--c-primary);
  border-color: var(--c-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

.form-check__input[type="radio"] {
  border-radius: var(--r-full);
}

.form-check__input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 4px var(--c-primary);
  background-color: var(--c-surface);
  border-color: var(--c-primary);
}

.form-check__label {
  font-size: var(--fs-sm);
  color: var(--c-text);
  line-height: var(--lh-snug);
}

.form-row {
  display: grid;
  gap: var(--sp-4);
}

@media (min-width: 640px) {
  .form-row--2 { grid-template-columns: 1fr 1fr; }
  .form-row--3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Flash Messages ───────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: var(--lh-snug);
  position: relative;
  margin-bottom: var(--sp-4);
}

.flash--success {
  background-color: var(--c-success-bg);
  border-color: var(--c-success-border);
  color: var(--c-success);
}

.flash--error {
  background-color: var(--c-error-bg);
  border-color: var(--c-error-border);
  color: var(--c-error);
}

.flash--warning {
  background-color: var(--c-warning-bg);
  border-color: var(--c-warning-border);
  color: var(--c-accent-dark);
}

.flash--info {
  background-color: var(--c-info-bg);
  border-color: var(--c-info-border);
  color: var(--c-info);
}

.flash__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: currentColor;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* Glifo bianco dentro il cerchio colorato */
.flash__icon {
  color: #fff;
}

.flash--success .flash__icon { background: var(--c-success); }
.flash--error   .flash__icon { background: var(--c-error); }
.flash--warning .flash__icon { background: var(--c-accent-dark); }
.flash--info    .flash__icon { background: var(--c-info); }

.flash__content {
  flex: 1;
  min-width: 0;
}

.flash__title {
  font-weight: 700;
  margin-bottom: var(--sp-1);
}

.flash__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
  font-size: var(--fs-lg);
  line-height: 1;
  transition: opacity var(--t-fast), background-color var(--t-fast);
  padding: 0;
  color: currentColor;
}

.flash__close:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.08);
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--f-body);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: var(--r-full);
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge--success {
  background-color: var(--c-success-bg);
  color: var(--c-success);
  border-color: var(--c-success-border);
}

.badge--error {
  background-color: var(--c-error-bg);
  color: var(--c-error);
  border-color: var(--c-error-border);
}

.badge--warning {
  background-color: var(--c-warning-bg);
  color: var(--c-accent-dark);
  border-color: var(--c-warning-border);
}

.badge--info {
  background-color: var(--c-info-bg);
  color: var(--c-info);
  border-color: var(--c-info-border);
}

.badge--neutral {
  background-color: var(--c-bg-alt);
  color: var(--c-text-muted);
  border-color: var(--c-border);
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-cards {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 640px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .stat-cards { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  background-color: var(--c-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-2);
}

.stat-card__icon--primary { background-color: var(--c-error-bg); }
.stat-card__icon--secondary { background-color: var(--c-success-bg); }
.stat-card__icon--accent { background-color: var(--c-warning-bg); }
.stat-card__icon--info { background-color: var(--c-info-bg); }

.stat-card__value {
  font-family: var(--f-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
}

.stat-card__label {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-weight: 500;
}

.stat-card__delta {
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-top: var(--sp-1);
}

.stat-card__delta--up   { color: var(--c-success); }
.stat-card__delta--down { color: var(--c-error); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  font-size: var(--fs-sm);
}

.table thead {
  background-color: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-border);
}

.table th {
  padding: var(--sp-3) var(--sp-5);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  white-space: nowrap;
}

.table td {
  padding: var(--sp-4) var(--sp-5);
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  background-color: var(--c-surface);
  transition: background-color var(--t-fast);
}

.table tbody tr:hover {
  background-color: var(--c-bg-alt);
}

.table__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.empty-state__icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: var(--sp-2);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--c-text);
  font-family: var(--f-display);
}

.empty-state__text {
  font-size: var(--fs-base);
  color: var(--c-text-muted);
  max-width: 40ch;
  line-height: var(--lh-relaxed);
  margin-inline: auto;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  padding-top: calc(var(--sp-16) + var(--sp-8));
  padding-bottom: var(--sp-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(196, 93, 62, 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(45, 106, 79, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-5);
  padding: var(--sp-2) var(--sp-4);
  background-color: var(--c-error-bg);
  border-radius: var(--r-full);
  border: 1px solid var(--c-error-border);
}

.hero__title {
  font-family: var(--f-display);
  font-size: var(--fs-5xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--c-text);
  margin-bottom: var(--sp-6);
  max-width: 18ch;
  margin-inline: auto;
  text-wrap: balance;
}

.hero__title em {
  font-style: italic;
  color: var(--c-primary);
  white-space: nowrap;
}

.hero__subtitle,
.hero__lead {
  font-size: var(--fs-lg);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--sp-10);
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.hero__proof {
  margin-top: var(--sp-12);
  font-size: var(--fs-sm);
  color: var(--c-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.hero__proof-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* ── Section ──────────────────────────────────────────────── */
.section {
  padding-block: var(--sp-16);
}

.section--alt {
  background-color: var(--c-bg-alt);
}

.section__header {
  text-align: center;
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--sp-12);
}

.section__eyebrow {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
  display: block;
}

.section__title {
  font-family: var(--f-display);
  font-size: var(--fs-3xl);
  margin-bottom: var(--sp-4);
}

.section__lead {
  font-size: var(--fs-md);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
  max-width: 60ch;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .section { padding-block: var(--sp-24); }
}

/* ── Features Grid ────────────────────────────────────────── */
.features__grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .features__grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .features__grid { grid-template-columns: 1fr 1fr 1fr; }
}

.feature-card {
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.feature-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background-color: var(--c-error-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--sp-5);
}

.feature-card__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--sp-3);
  color: var(--c-text);
  font-family: var(--f-display);
}

.feature-card__text,
.feature-card__desc {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
}

/* ── Steps ────────────────────────────────────────────────── */
.steps {
  display: grid;
  gap: var(--sp-8);
  position: relative;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--sp-10);
  }
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  position: relative;
}

.step__number {
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background-color: var(--c-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 6px var(--c-error-bg);
}

.step__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
  font-family: var(--f-display);
}

.step__text,
.step__desc {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
}

/* ── CTA Section ──────────────────────────────────────────── */
.cta {
  background-color: var(--c-primary);
  padding-block: var(--sp-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(212, 168, 67, 0.20) 0%, transparent 50%);
  pointer-events: none;
}

.cta__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
}

.cta__title {
  font-family: var(--f-display);
  font-size: var(--fs-3xl);
  color: #fff;
  font-weight: 700;
  line-height: var(--lh-tight);
}

.cta__text,
.cta__lead {
  font-size: var(--fs-md);
  color: rgba(255, 255, 255, 0.85);
  line-height: var(--lh-relaxed);
  max-width: 46ch;
  margin-inline: auto;
}

.cta .btn--primary {
  background-color: #fff;
  border-color: #fff;
  color: var(--c-primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.cta .btn--primary:hover {
  background-color: var(--c-bg-alt);
  border-color: var(--c-bg-alt);
  color: var(--c-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
}

.cta .btn--ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.cta .btn--ghost:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
}

.cta__actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page .nav,
.auth-page .footer {
  display: none;
}

.auth-page main {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(196, 93, 62, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(45, 106, 79, 0.06) 0%, transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-8) var(--sp-8);
  box-shadow: var(--shadow-xl);
}

.auth-card__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
  text-align: center;
}

.auth-card__logo-mark {
  width: 56px;
  height: 56px;
  background-color: var(--c-primary);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--shadow-md);
}

.auth-card__site-name {
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-text);
}

.auth-card__title {
  font-size: var(--fs-2xl);
  font-family: var(--f-display);
  text-align: center;
  margin-bottom: var(--sp-2);
}

.auth-card__subtitle {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  text-align: center;
  margin-bottom: var(--sp-8);
  line-height: var(--lh-snug);
}

.auth-card__footer {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background-color: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding-block: var(--sp-10);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 300px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-primary);
  text-decoration: none;
}

.footer__logo:hover {
  color: var(--c-primary-dark);
  text-decoration: none;
}

.footer__tagline {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: var(--lh-relaxed);
}

.footer__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .footer__cols {
    grid-template-columns: repeat(3, auto);
    gap: var(--sp-12);
  }
}

.footer__col-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-4);
}

.footer__col-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__col-links a {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer__col-links a:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  justify-content: center;
}

.footer__legal a {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer__legal a:hover {
  color: var(--c-primary);
}

.footer__bottom {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  align-items: center;
  text-align: center;
}

.footer__copyright {
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
}

.footer__credit {
  font-size: var(--fs-xs);
  color: var(--c-text-subtle);
}

.footer__credit a {
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer__credit a:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

/* ── Pricing ──────────────────────────────────────────────── */
.pricing {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.pricing-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  border-color: var(--c-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.pricing-card--featured {
  border-color: var(--c-primary);
  box-shadow: 0 12px 40px rgba(196, 93, 62, 0.16);
}

.pricing-card__features li:first-child {
  font-weight: 700;
}

.pricing-card__badge {
  align-self: center;
  background-color: var(--c-primary);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
}

.pricing-card__price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--sp-1);
}

.pricing-card__amount {
  font-family: var(--f-display);
  font-size: var(--fs-5xl);
  font-weight: 700;
  line-height: 1;
  color: var(--c-text);
}

.pricing-card__period {
  font-size: var(--fs-lg);
  color: var(--c-text-muted);
  font-weight: 600;
}

.pricing-card__note {
  font-size: var(--fs-sm);
  color: var(--c-text-subtle);
}

.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  text-align: left;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding-block: var(--sp-6);
}

.pricing-card__features li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--c-text);
  font-weight: 500;
}

.pricing-card__features li::before {
  content: '✓';
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--c-success);
  color: #fff;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Pagine legali / testo lungo ──────────────────────────── */
.legal {
  max-width: 760px;
  margin: 0 auto;
}

.legal__header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--c-border);
}

.legal__title {
  font-family: var(--f-display);
  font-size: var(--fs-3xl);
  margin: 0 0 var(--sp-2);
}

.legal__updated {
  font-size: var(--fs-sm);
  color: var(--c-text-subtle);
  margin: 0;
}

.legal__body h2 {
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  margin: var(--sp-8) 0 var(--sp-3);
}

.legal__body h3 {
  font-size: var(--fs-md);
  margin: var(--sp-5) 0 var(--sp-2);
}

.legal__body p,
.legal__body li {
  color: var(--c-text);
  line-height: var(--lh-base);
}

.legal__body ul {
  padding-left: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.legal__body a {
  color: var(--c-primary);
  font-weight: 600;
}

.legal__body strong {
  font-weight: 600;
}

.legal__note {
  background-color: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
}

@media (min-width: 640px) {
  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin-block: var(--sp-6);
}

/* ── Text Utilities ───────────────────────────────────────── */
.text-primary   { color: var(--c-primary); }
.text-secondary { color: var(--c-secondary); }
.text-accent    { color: var(--c-accent); }
.text-muted     { color: var(--c-text-muted); }
.text-subtle    { color: var(--c-text-subtle); }
.text-success   { color: var(--c-success); }
.text-error     { color: var(--c-error); }

.font-display   { font-family: var(--f-display); }
.font-body      { font-family: var(--f-body); }

/* ── Loading / Skeleton ───────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.skeleton {
  background-color: var(--c-border);
  border-radius: var(--r-md);
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}

/* ── Accessibility ────────────────────────────────────────── */
@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;
  }
}
