/* ============================================================
   Sistema Registrazione Bambini — Main Stylesheet
   Colors: Red #E3001B | Blue #2F2A85 | Navy #1E1A5E
   ============================================================ */

/* -- Custom Properties ---------------------------------------- */
:root {
  --red:        #E3001B;
  --red-dark:   #B91C1C;
  --blue:       #2F2A85;
  --navy:       #1E1A5E;
  --white:      #FFFFFF;
  --gray-50:    #F5F7FA;
  --gray-100:   #EEF0F4;
  --gray-200:   #D9DDE3;
  --gray-400:   #9CA3AF;
  --gray-600:   #6B7280;
  --gray-800:   #1F2937;
  --success:    #22C55E;
  --warning:    #F59E0B;
  --danger:     #B91C1C;
  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 10px 30px rgba(0,0,0,.08);
  --shadow-md:  0 20px 50px rgba(0,0,0,.12);
  --transition: .25s ease;
  --font:       'Inter', 'Poppins', system-ui, sans-serif;
}

/* -- Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--red); }

/* -- Typography ----------------------------------------------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--navy); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { color: var(--gray-600); }

/* -- Navbar ---------------------------------------------------- */
.navbar {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(30,26,94,.08);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.navbar-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}
.navbar-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.navbar-title small {
  display: block;
  font-weight: 400;
  color: var(--gray-600);
  font-size: .75rem;
}
.navbar-links { display: flex; gap: 20px; align-items: center; }
.navbar-links a { font-size: .875rem; color: var(--gray-600); font-weight: 500; transition: color var(--transition); }
.navbar-links a:hover { color: var(--red); }

/* -- Hero ------------------------------------------------------ */
.hero {
  background: linear-gradient(150deg, var(--navy) 0%, #28237A 40%, var(--blue) 70%, #E3001B22 100%),
              linear-gradient(135deg, var(--navy), var(--blue));
  padding: 72px 24px 110px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(227,0,27,.18) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 60px;
  background: var(--gray-50);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-content { position: relative; max-width: 760px; margin: 0 auto; }
.hero-logo-wrap {
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.4));
  animation: heroLogoIn .6s ease both;
}
@keyframes heroLogoIn {
  from { opacity: 0; transform: translateY(-12px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-logo-wrap img { width: 130px; height: 130px; object-fit: contain; }
.hero h1 { color: var(--white); margin-bottom: 16px; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero p  { color: rgba(255,255,255,.82); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* -- Category Cards ------------------------------------------- */
.cards-section {
  max-width: 1100px;
  margin: -56px auto 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.cat-card {
  background: var(--white);
  border-radius: var(--radius);
  border-top: 4px solid var(--red);
  box-shadow: 0 4px 20px rgba(30,26,94,.08), 0 1px 4px rgba(0,0,0,.04);
  padding: 32px 26px 28px;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: .04;
  transform: translate(30px, -30px);
  background: var(--red);
}
.cat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(30,26,94,.14), 0 4px 12px rgba(0,0,0,.06);
}
.cat-card:nth-child(2) { border-top-color: var(--blue); }
.cat-card:nth-child(2)::before { background: var(--blue); }
.cat-card:nth-child(3) { border-top-color: var(--navy); }
.cat-card:nth-child(3)::before { background: var(--navy); }
.cat-card:nth-child(4) { border-top-color: var(--red); }
.cat-card .cat-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 18px;
}
.cat-card:nth-child(1) .cat-icon { background: rgba(227,0,27,.08); }
.cat-card:nth-child(2) .cat-icon { background: rgba(47,42,133,.08); }
.cat-card:nth-child(3) .cat-icon { background: rgba(30,26,94,.08); }
.cat-card:nth-child(4) .cat-icon { background: rgba(227,0,27,.08); }
.cat-card h3 { color: var(--navy); margin-bottom: 8px; font-size: 1.05rem; }
.cat-card p  { font-size: .85rem; line-height: 1.55; }
.cat-card .arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--red);
  margin-top: 18px;
  transition: gap .2s ease;
}
.cat-card:nth-child(2) .arrow { color: var(--blue); }
.cat-card:nth-child(3) .arrow { color: var(--navy); }
.cat-card:hover .arrow { gap: 10px; }

/* -- Buttons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .875rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font);
  white-space: nowrap;
}
/* Effetto hover UNIFORME su tutti i pulsanti: si sollevano di 2px.
   Escluso quando disabilitati. La transizione è già definita in .btn (transition: all). */
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); color: var(--white); }
.btn-secondary { background: var(--blue); color: var(--white); }
.btn-secondary:hover { background: var(--navy); color: var(--white); }
.btn-outline { background: transparent; border: 2px solid var(--gray-200); color: var(--gray-800); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger  { background: var(--danger);  color: var(--white); }
.btn-sm { padding: 8px 16px; font-size: .8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* -- Form Layout ---------------------------------------------- */
.form-page {
  min-height: 100vh;
  background: var(--gray-50);
}
.form-hero {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  padding: 40px 24px 60px;
  text-align: center;
  color: var(--white);
}
.form-hero h1 { color: var(--white); margin-bottom: 8px; font-size: 1.8rem; }
.form-hero p  { color: rgba(255,255,255,.75); }
.form-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.3);
  color: var(--white);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.form-container {
  max-width: 900px;
  margin: -36px auto 60px;
  padding: 0 16px;
}
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.form-card-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 14px;
}
.form-card-header .section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(227,0,27,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.form-card-header .section-icon.blue { background: rgba(47,42,133,.08); }
.form-card-header h3 { font-size: 1rem; color: var(--navy); margin: 0; }
.form-card-body { padding: 28px; }

/* -- Form Fields ---------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-800);
  text-transform: uppercase;
  letter-spacing: .4px;
}
/* Asterisco "obbligatorio" sempre rosso, anche fuori dalle label (es. titoli sezione) */
.req { color: var(--red) !important; margin-left: 2px; }
.form-control {
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .925rem;
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,42,133,.12);
}
.form-control.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227,0,27,.1);
}
.form-control.success { border-color: var(--success); }
.field-error {
  font-size: .78rem;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 4px;
}
select.form-control { cursor: pointer; }

/* -- Radio Group ---------------------------------------------- */
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  color: var(--gray-800);
  text-transform: none;
  letter-spacing: 0;
}
.radio-label:hover { border-color: var(--blue); color: var(--blue); }
.radio-label input { display: none; }
.radio-label.selected {
  background: rgba(47,42,133,.06);
  border-color: var(--blue);
  color: var(--blue);
}
.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radio-dot::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--transition);
}
.radio-label.selected .radio-dot::after { opacity: 1; }

/* -- Upload Zones --------------------------------------------- */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--gray-50);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--blue);
  background: rgba(47,42,133,.04);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone .upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone .upload-label { font-size: .875rem; color: var(--gray-600); }
.upload-zone .upload-label strong { color: var(--blue); }
.upload-zone .upload-hint { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }
.upload-zone.has-file { border-color: var(--success); background: rgba(34,197,94,.04); }
.upload-preview {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.upload-preview img {
  max-height: 180px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.upload-preview .pdf-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(227,0,27,.06);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-weight: 600;
  font-size: .875rem;
}
.file-info {
  margin-top: 8px;
  font-size: .75rem;
  color: var(--success);
  font-weight: 600;
}
/* -- Document Section ----------------------------------------- */
.doc-section {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--blue);
}
.doc-section.parent { border-left-color: var(--red); }
.doc-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--blue);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-section.parent .doc-section-title { color: var(--red); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.doc-item { display: flex; flex-direction: column; gap: 6px; }
.doc-item label { font-size: .75rem; }

/* -- Consent Checkboxes --------------------------------------- */
.consent-block {
  background: rgba(30,26,94,.04);
  border: 1px solid rgba(30,26,94,.12);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.consent-block input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.consent-block label {
  font-size: .85rem;
  color: var(--gray-800);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  line-height: 1.5;
}
.consent-block label a { color: var(--blue); font-weight: 600; }

/* -- Alerts --------------------------------------------------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 4px solid transparent;
}
.alert-error   { background: rgba(185,28,28,.08); border-color: var(--red); color: #7F1D1D; }
.alert-success { background: rgba(34,197,94,.08);  border-color: var(--success); color: #14532D; }
.alert-warning { background: rgba(245,158,11,.08); border-color: var(--warning); color: #78350F; }
.alert-info    { background: rgba(47,42,133,.06);  border-color: var(--blue); color: var(--navy); }
.alert ul { margin: 6px 0 0 16px; }
.alert li { margin-bottom: 4px; }

/* -- Cookie Banner -------------------------------------------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  color: var(--white);
  padding: 20px 24px;
  z-index: 999;
  box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  transform: translateY(100%);
  transition: transform .4s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-text { flex: 1; font-size: .875rem; color: rgba(255,255,255,.85); }
.cookie-text a { color: var(--white); font-weight: 600; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn { font-size: .8rem; padding: 10px 20px; }

/* -- Info Section --------------------------------------------- */
.info-section {
  max-width: 1100px;
  margin: 0 auto 72px;
  padding: 0 24px;
}
.info-grid {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.info-item { text-align: center; }
.info-icon {
  font-size: 36px;
  margin-bottom: 14px;
  display: block;
}
.info-item h3 {
  font-size: .95rem;
  margin-bottom: 8px;
  color: var(--navy);
}
.info-item p {
  font-size: .84rem;
  line-height: 1.55;
}
@media (max-width: 768px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
}

/* -- Animations ----------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* Hero entrance */
.hero-logo-wrap { animation: fadeInUp .55s ease both; }
.hero h1        { animation: fadeInUp .6s .1s ease both; }
.hero p         { animation: fadeInUp .6s .2s ease both; }

/* Cards staggered */
.cat-card {
  animation: fadeInUp .55s ease both;
  opacity: 0;
  animation-fill-mode: forwards;
}
.cat-card:nth-child(1) { animation-delay: .15s; }
.cat-card:nth-child(2) { animation-delay: .28s; }
.cat-card:nth-child(3) { animation-delay: .41s; }
.cat-card:nth-child(4) { animation-delay: .54s; }

/* Info items staggered */
.info-item {
  animation: fadeInUp .5s ease both;
  opacity: 0;
}
.info-item:nth-child(1) { animation-delay: .1s; }
.info-item:nth-child(2) { animation-delay: .22s; }
.info-item:nth-child(3) { animation-delay: .34s; }
.info-item:nth-child(4) { animation-delay: .46s; }

/* Form cards entrance */
.form-card {
  animation: fadeInUp .45s ease both;
  animation-delay: .08s;
}

/* Navbar */
.navbar { animation: fadeIn .4s ease both; }

/* Footer --------------------------------------------------- */
footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 24px;
  font-size: .8rem;
  margin-top: auto;
}
footer a { color: rgba(255,255,255,.9); }

/* -- Success Page --------------------------------------------- */
.success-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.success-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 56px 48px;
  text-align: center;
  max-width: 560px;
  width: 100%;
}
.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(34,197,94,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}
.success-card h1 { font-size: 1.8rem; margin-bottom: 12px; }
.success-card p  { font-size: 1rem; color: var(--gray-600); margin-bottom: 28px; }

/* -- Utilities ------------------------------------------------ */
.text-center { text-align: center; }
.text-red    { color: var(--red) !important; }
.text-blue   { color: var(--blue) !important; }
.text-muted  { color: var(--gray-400); font-size: .85rem; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.divider { height: 1px; background: var(--gray-100); margin: 24px 0; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: var(--white);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -- Hamburger button ----------------------------------------- */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  transition: background var(--transition);
}
.nav-burger:hover { background: var(--gray-100); }
.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
  transform-origin: center;
}
/* X quando aperto */
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -- Responsive ----------------------------------------------- */
@media (max-width: 768px) {
  .nav-burger { display: flex; }

  .navbar-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 3px solid var(--red);
    box-shadow: 0 8px 24px rgba(30,26,94,.12);
    padding: 16px 28px 20px;
    gap: 4px;
    z-index: 99;
  }
  .navbar-links.open { display: flex; }
  .navbar-links a {
    padding: 10px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--gray-100);
  }
  .navbar-links a:last-child { border-bottom: none; }

  .cards-section { margin-top: -28px; }
  .form-grid  { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .doc-grid   { grid-template-columns: 1fr; }
  .form-card-body { padding: 20px; }
  .success-card   { padding: 36px 24px; }
  .hero { padding: 60px 20px 80px; }
}

@media (max-width: 480px) {
  .radio-group { flex-direction: column; }
  .cookie-banner-inner { flex-direction: column; align-items: flex-start; }
  .cat-card { padding: 24px 20px; }
}

/* ── Overlay di caricamento pratica ─────────────────────────── */
.upload-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center;
  background: rgba(11,72,107,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.upload-overlay.show { display: flex; }
.upload-box {
  background: #fff; border-radius: 16px; padding: 32px 28px;
  max-width: 340px; width: calc(100% - 40px); text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.upload-box .loader { margin: 0 auto 22px; }
.upload-title { font-size: 1.05rem; font-weight: 700; color: #0B486B; margin-bottom: 10px; }
.upload-pct   { font-size: 2rem; font-weight: 800; color: #C02942; line-height: 1; margin-bottom: 12px; }
.upload-bar   { height: 8px; background: #EEF0F4; border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.upload-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg,#0B486B,#C02942); border-radius: 99px; transition: width .25s ease; }
.upload-sub   { font-size: .82rem; color: #6B7280; }

/* Loader animato */
.loader {
  display: inline-grid;
  width: 80px;
  aspect-ratio: 2;
  box-sizing: content-box;
  border-bottom: 8px solid #0000;
  background:
    linear-gradient(90deg,#0B486B 50%,#C02942 0)
    50% 100%/52% 8px border-box repeat-x;
  animation: l8-0 1s linear infinite;
}
.loader:before {
  content: "";
  margin: 0 25%;
  border-radius: 50%;
  background: repeating-conic-gradient(#C02942 0 60deg,#0B486B 0 120deg);
  animation: l8-1 1s linear infinite;
}
@keyframes l8-0 { to { background-position: -58% 100%; } }
@keyframes l8-1 { to { rotate: 120deg; } }
