/* ============================================================
   ItaLink — Foglio di stile principale
   Riproduce il design system del sito originale (tema ASMEL):
   blu #0066CC, scuri #013A6B/#004E95, testo #0E0E0E, grigio #4F4F4F.
   ============================================================ */

:root {
  --blue: #0066CC;
  --blue-dark: #013A6B;
  --blue-mid: #004E95;
  --blue-light: #E3F2FF;
  --ink: #0E0E0E;
  --gray: #4F4F4F;
  --bg-light: #f1f1f1;
  --bg-softer: #F7F7F7;
  --red: #F23030;
  --white: #ffffff;
  --radius-card: 10px;
  --radius-btn: 6px;
  --shadow-header: 0 10px 15px rgba(5, 13, 29, .18);
  --shadow-card: 0 4px 4px rgba(0, 0, 0, .25);
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Reset di base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--white);
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-decoration: none; transition: color .3s ease-in-out; }
a:hover, a:focus { color: var(--blue-mid); text-decoration: underline; }

h1, h2, h3, h4, h5 { line-height: 1.25; margin: 0 0 16px; font-weight: 700; }
p { margin: 0 0 1em; }

/* ---------- Accessibilità ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

.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;
}

.hidden { display: none !important; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}
.container--narrow { max-width: 860px; }
.container--medium { max-width: 980px; }

.main-content { min-height: calc(100vh - 320px); }

.content-section { padding: 56px 0; background-color: var(--white); }
.section-landing { padding: 72px 0; background-color: var(--bg-softer); }

.center-block { text-align: center; }

.page-title { font-size: 2.25rem; margin-bottom: 24px; color: var(--ink); }
.page-title--article { font-size: 2.5rem; line-height: 1.2; }
.page-title--inline { display: inline; margin-bottom: 0; }

.lead { font-size: 1.125rem; color: var(--gray); margin-bottom: 24px; }

.back-link { display: inline-block; margin-bottom: 16px; font-weight: 500; }

.article-meta { color: var(--gray); margin-bottom: 24px; }
.fallback-note {
  background: #fff8e6;
  border: 1px solid #f0d9a0;
  color: #7a5c00;
  padding: 10px 16px;
  border-radius: var(--radius-card);
  margin-bottom: 24px;
  font-size: .9375rem;
}
.article-hero-image { width: 100%; border-radius: var(--radius-card); margin-bottom: 32px; box-shadow: var(--shadow-card); }
.article-body h4 { font-size: 1.25rem; margin-top: 28px; color: var(--blue-dark); }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin-bottom: 6px; }

.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin: 0 0 8px;
}

.success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--white);
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
}

.site-branding img { height: 52px; width: auto; display: block; }

.admin-context-label {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.header-nav { margin-left: auto; }
.header-nav--right { margin-left: auto; }

.primary-nav__menu {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav__menu a,
.nav-logout {
  display: inline-block;
  padding: 10px 14px;
  font-weight: 600;
  font-size: .9375rem;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: color .3s ease-in-out, background-color .3s ease-in-out;
}

.primary-nav__menu a:hover, .nav-logout:hover { color: var(--blue); }

.primary-nav__menu a.is-active {
  color: var(--blue);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.nav-logout { color: var(--gray); font-weight: 500; }

/* Selettore lingua (v1.5.0): codici ISO compatti, separati da divisori sottili */
.lang-switcher {
  display: flex;
  align-items: center;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--bg-light);
}
.lang-switcher a {
  padding: 6px 7px;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gray);
}
.lang-switcher a + a { border-left: 1px solid var(--bg-light); }
.lang-switcher a:hover { box-shadow: none; }
.lang-switcher a.is-active { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }

/* Hamburger (solo mobile) */
.mobile-nav-button {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.mobile-nav-button span {
  display: block;
  width: 26px; height: 3px;
  margin: 5px 0;
  background-color: var(--ink);
  border-radius: 2px;
  transition: transform .3s ease-in-out, opacity .3s ease-in-out;
}
.mobile-nav-button[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-nav-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-nav-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero homepage ---------- */
.hero {
  position: relative;
  background-color: var(--blue-dark);
  background-image: linear-gradient(rgba(1, 26, 51, .45), rgba(1, 26, 51, .45)), url('../img/hero_bg.jpg');
  background-size: cover;
  background-position: center;
  padding: 96px 0 72px;
}

.hero__inner {
  position: relative; /* sopra lo sfondo animato .hero-fx (v1.8.0) */
  z-index: 1;
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero__left, .hero__right { flex: 1 1 46%; }

.hero__title {
  font-size: 3.75rem;
  line-height: 4.875rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.hero__tagline {
  font-size: 1.25rem;
  font-weight: 300;
  color: rgba(255, 255, 255, .92);
  margin: 0;
}

/* Card CTA (Candidato / Azienda / Comune) */
.hero-cta-wrapper {
  display: flex;
  flex-flow: row wrap;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
}

.cta-card {
  background-color: var(--white);
  border-radius: var(--radius-card);
  padding: 24px;
  min-height: 200px;
  flex: 1 1 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform .3s ease-in-out, box-shadow .3s ease-in-out;
}

.cta-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(5, 13, 29, .3);
  text-decoration: none;
}

.cta-card__title {
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--blue);
  text-align: center;
}

.cta-card__text {
  font-size: 1rem;
  font-weight: 300;
  color: var(--gray);
  text-align: center;
  margin: 0;
}

/* Freccia scroll-down animata */
.scroll-down-container {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1; /* sopra lo sfondo animato .hero-fx (v1.8.0) */
}

.scroll-down-link {
  display: block;
  width: 34px; height: 34px;
  /* Chevron verso il basso (path Material "expand_more") */
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmZmZmZiI+PHBhdGggZD0iTTcgMTBsNSA1IDUtNXoiLz48L3N2Zz4=");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: fade_move_down 2s ease-in-out infinite;
}

@keyframes fade_move_down {
  0%   { opacity: 0; transform: translateY(-6px); }
  50%  { opacity: 1; transform: translateY(4px); }
  100% { opacity: 0; transform: translateY(10px); }
}

/* ---------- Hero: sfondo animato "Italia" (v1.8.0) -----------------
   Tre strati decorativi SOTTO il contenuto, a bassa opacità per non
   compromettere la leggibilità del testo:
   1. glow tricolore (verde/rosso) in deriva lenta;
   2. skyline di monumenti italiani con deriva continua (loop);
   3. particelle-luce che salgono lentamente.
   Con prefers-reduced-motion le animazioni sono disattivate. ---------- */
.hero-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none; /* puramente decorativo */
  z-index: 0;
}

/* 1) Glow tricolore */
.hero-fx__glow {
  position: absolute;
  border-radius: 50%;
  opacity: .13;
  will-change: transform;
}
.hero-fx__glow--verde {
  width: 72vw; height: 90vh;
  left: -24vw; top: -38vh;
  background: radial-gradient(closest-side, #3FAE6A 0%, rgba(63, 174, 106, 0) 72%);
  animation: hero-glow-verde 95s ease-in-out infinite alternate;
}
.hero-fx__glow--rosso {
  width: 80vw; height: 95vh;
  right: -30vw; bottom: -45vh;
  background: radial-gradient(closest-side, #D25A4E 0%, rgba(210, 90, 78, 0) 72%);
  animation: hero-glow-rosso 115s ease-in-out infinite alternate;
}
@keyframes hero-glow-verde {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(9vw, 7vh, 0) scale(1.18); }
}
@keyframes hero-glow-rosso {
  from { transform: translate3d(0, 0, 0) scale(1.12); }
  to   { transform: translate3d(-8vw, -6vh, 0) scale(.95); }
}

/* 2) Skyline dei monumenti (due copie affiancate = loop continuo) */
.hero-fx__skyline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 150px;
  opacity: .14;
}
.hero-fx__skyline-track {
  display: flex;
  width: 200%;
  height: 100%;
  animation: hero-skyline-drift 90s linear infinite;
  will-change: transform;
}
.hero-fx__skyline-svg {
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  display: block;
}
@keyframes hero-skyline-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* 3) Particelle-luce ("luci d'Italia") */
.hero-fx__particles i {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 240, 205, .95), rgba(255, 240, 205, 0) 70%);
  opacity: 0;
  animation-name: hero-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes hero-rise {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  10%  { opacity: .38; }
  55%  { opacity: .30; }
  100% { transform: translate3d(24px, -78vh, 0); opacity: 0; }
}
.hero-fx__particles i:nth-child(1) { left: 6%;  width: 5px; height: 5px; animation-duration: 21s; animation-delay: -4s; }
.hero-fx__particles i:nth-child(2) { left: 18%; width: 4px; height: 4px; animation-duration: 17s; animation-delay: -9s; }
.hero-fx__particles i:nth-child(3) { left: 31%; width: 6px; height: 6px; animation-duration: 24s; animation-delay: -13s; }
.hero-fx__particles i:nth-child(4) { left: 47%; width: 4px; height: 4px; animation-duration: 19s; animation-delay: -2s; }
.hero-fx__particles i:nth-child(5) { left: 60%; width: 5px; height: 5px; animation-duration: 23s; animation-delay: -17s; }
.hero-fx__particles i:nth-child(6) { left: 72%; width: 4px; height: 4px; animation-duration: 18s; animation-delay: -7s; }
.hero-fx__particles i:nth-child(7) { left: 85%; width: 6px; height: 6px; animation-duration: 26s; animation-delay: -12s; }
.hero-fx__particles i:nth-child(8) { left: 94%; width: 4px; height: 4px; animation-duration: 20s; animation-delay: -5s; }

/* Accessibilità: niente animazioni per chi le disattiva */
@media (prefers-reduced-motion: reduce) {
  .hero-fx__glow,
  .hero-fx__skyline-track { animation: none; }
  .hero-fx__particles { display: none; }
}

/* ---------- Blocco immagine + testo (home) ---------- */
.image-text-block {
  display: flex;
  gap: 48px;
  align-items: center;
  margin-bottom: 56px;
}

.image-text-block__image { flex: 0 1 42%; }
.image-text-block__image img { width: 100%; border-radius: var(--radius-card); box-shadow: var(--shadow-card); }

.image-text-block__text { flex: 1 1 58%; }
.text-content p { margin-bottom: 1em; color: var(--ink); }

.block__title { font-size: 1.5rem; line-height: 2.125rem; color: var(--ink); font-weight: 700; }
.section-title { text-align: center; margin: 48px 0 32px; }

/* ---------- News teaser ---------- */
.news-teaser-list { display: flex; flex-direction: column; gap: 32px; }

.node-teaser {
  display: flex;
  gap: 28px;
  align-items: stretch;
}

.teaser-col { flex: 1; }

.teaser-image {
  flex: 0 0 45%;
  border-radius: var(--radius-card);
  overflow: hidden;
  display: block;
  background: var(--bg-light);
}
.teaser-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease-in-out; }
.node-teaser:hover .teaser-image img { transform: scale(1.03); }

.text-col h4 { font-size: 1.25rem; margin-bottom: 10px; }
.text-col h4 a, .text-col h4 span { color: var(--ink); }
.text-col h4 a:hover { color: var(--blue); text-decoration: none; }

.more-link { text-align: center; margin-top: 32px; font-weight: 600; }

/* ---------- Pulsanti ---------- */
.button, button.button {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid var(--blue);
  background-color: var(--blue);
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5rem;
  font-family: inherit;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: all .3s ease-in-out;
}

.button:hover, .button:focus {
  background-color: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
  text-decoration: none;
}

.button--primary { /* alias esplicito */ }

.button--small { padding: 7px 14px; font-size: .875rem; line-height: 1.25rem; }
.button--large { padding: 16px 40px; font-size: 1.125rem; }

.button--danger { background-color: var(--red); border-color: var(--red); color: #fff; }
.button--danger:hover, .button--danger:focus { background-color: transparent; color: var(--red); border-color: var(--red); }

.link-muted { color: var(--gray); font-weight: 500; }
.link-muted:hover { color: var(--blue); }

/* ---------- Paginazione ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 40px; list-style: none; padding: 0; }

.pager__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px; height: 42px;
  padding: 0 10px;
  border: 1px solid var(--bg-light);
  border-radius: var(--radius-btn);
  font-weight: 600;
  color: var(--ink);
  background: #fff;
}

.pager__item:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pager__item.is-current { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Form ---------- */
.form-page .page-title { margin-bottom: 16px; }

.field { margin-bottom: 20px; }

.field label, .field .label {
  display: block;
  font-weight: 600;
  font-size: .9375rem;
  margin-bottom: 6px;
  color: var(--ink);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="url"],
.field input[type="search"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cfcfcf;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background-color: #fff;
  transition: border-color .3s ease-in-out, box-shadow .3s ease-in-out;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, .18);
}

.field textarea { resize: vertical; min-height: 96px; }

.field input[type="file"] { padding: 10px; border: 1px dashed #b5b5b5; border-radius: var(--radius-btn); background: var(--bg-softer); width: 100%; }

.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
  border-color: var(--red);
}

.field-error { display: block; color: var(--red); font-size: .875rem; margin-top: 6px; font-weight: 500; }

.hint { font-size: .875rem; color: var(--gray); margin: 6px 0 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.grid-2--inline { align-items: end; }

.radio-row, .check-inline-wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 6px; }

.radio-row label, .check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

.field input[type="radio"], .field input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }

.check-inline { margin-bottom: 6px; }

.field--inline { margin-top: 10px; max-width: 320px; }
.field--consenso label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.field--consenso input[type="checkbox"] { margin-top: 4px; }

.form-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.form-actions--between { justify-content: space-between; align-items: center; }

/* Sezioni linguistiche del form articoli (una per lingua) */
.lang-block {
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-card);
  padding: 20px 24px 4px;
  margin: 0 0 24px;
}
.lang-block legend {
  font-weight: 700;
  font-size: 1.0625rem;
  padding: 0 8px;
  color: var(--ink);
}

/* Lingua attiva nell'editor pagine (v2.1.0): tab in cima al form */
.page-lang-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  border-bottom: 2px solid var(--bg-light);
}
.page-lang-tabs a {
  padding: 10px 16px;
  font-weight: 600;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.page-lang-tabs a:hover { color: var(--ink); }
.page-lang-tabs a.is-active { color: var(--blue); border-bottom-color: var(--blue); }

/* Campi condizionali (mostrati/nascosti da main.js) */
.conditional.hidden { display: none !important; }

/* ---------- Stepper candidatura ---------- */
.stepper {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0 0 36px;
  padding: 0;
  counter-reset: step;
}

.stepper__step {
  flex: 1;
  text-align: center;
  position: relative;
  padding-top: 42px;
}

.stepper__num {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-light);
  color: var(--gray);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.stepper__step::before {
  content: "";
  position: absolute;
  top: 16px; left: -50%; right: 50%;
  height: 3px;
  background: var(--bg-light);
}
.stepper__step:first-child::before { display: none; }

.stepper__label { font-size: .8125rem; color: var(--gray); font-weight: 600; }

.stepper__step.is-current .stepper__num { background: var(--blue); color: #fff; }
.stepper__step.is-current .stepper__label { color: var(--blue); }
.stepper__step.is-done .stepper__num { background: var(--blue-mid); color: #fff; }
.stepper__step.is-done::before, .stepper__step.is-current::before { background: var(--blue-mid); }

.form-step { border: none; padding: 0; margin: 0 0 8px; }
.form-step legend { font-size: 1.375rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 24px; padding: 0; }

/* ---------- Anteprima candidatura ---------- */
.preview-table { width: 100%; border-collapse: collapse; margin-bottom: 28px; background: #fff; box-shadow: var(--shadow-card); border-radius: var(--radius-card); overflow: hidden; }
.preview-table th, .preview-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bg-light); font-size: .9375rem; }
.preview-table tr > th:first-child { background: var(--blue-dark); color: #fff; width: 40%; letter-spacing: .02em; }
.preview-table td:nth-child(odd) { background: var(--bg-softer); font-weight: 600; width: 35%; }

/* ---------- Pagine informative ---------- */
.steps-list { padding-left: 22px; margin-bottom: 24px; }
.steps-list li { margin-bottom: 8px; }

.info-box, .gdpr-box { /* .gdpr-box mantenuto come alias */
  background: var(--bg-softer);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
  padding: 20px 24px;
  margin: 28px 0;
  font-size: .9375rem;
  color: var(--gray);
}

.landing-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }

/* ---------- Area riservata ---------- */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 32px; }

.dash-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: transform .3s ease-in-out, box-shadow .3s ease-in-out;
}

.dash-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(5, 13, 29, .25); text-decoration: none; }
.dash-card__num { font-size: 2.25rem; font-weight: 800; color: var(--blue); line-height: 1.1; }
.dash-card__label { color: var(--gray); font-weight: 600; font-size: .9375rem; }

.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; flex-wrap: wrap; }
.filter-bar input[type="search"], .filter-bar select { padding: 10px 14px; border: 1px solid #cfcfcf; border-radius: var(--radius-btn); font-family: inherit; font-size: .9375rem; background: #fff; }
.filter-bar input[type="search"] { flex: 1; min-width: 200px; }

/* ---------- Tabelle dati ---------- */
.data-table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--shadow-card); border-radius: var(--radius-card); overflow: hidden; font-size: .9375rem; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bg-light); }
.data-table thead th { background: var(--blue-dark); color: #fff; font-weight: 600; white-space: nowrap; }
.data-table tbody tr:hover { background: var(--blue-light); }
.data-table .col-actions { white-space: nowrap; width: 1%; }

.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--active { background: #e6f4ea; color: #1e7b34; }
.badge--expired, .badge--off { background: #fde8e8; color: var(--red); }
.badge--deadline { background: var(--blue-light); color: var(--blue-dark); }
.badge--pending { background: #fff3e0; color: #b26a00; }

.badge--role-candidato { background: var(--blue-light); color: var(--blue-dark); }
.badge--role-azienda { background: #fff3e0; color: #b26a00; }
.badge--role-comune { background: #ede7f6; color: #5e35b1; }
.badge--role-admin { background: var(--ink); color: #fff; }

/* ---------- Bandi (area riservata) ---------- */
.bando-list { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }

.bando-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 28px;
}

.bando-card__title { color: var(--blue-dark); margin-bottom: 10px; }
.bando-card__desc { color: var(--gray); margin-bottom: 16px; }
.bando-card__meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ---------- Alert ---------- */
.alert { padding: 14px 20px; border-radius: var(--radius-btn); margin-bottom: 24px; font-weight: 500; }
.alert--success { background: #e6f4ea; color: #1e7b34; border-left: 4px solid #1e7b34; }
.alert--error { background: #fde8e8; color: var(--red); border-left: 4px solid var(--red); }
.alert--info { background: var(--blue-light); color: var(--blue-dark); border-left: 4px solid var(--blue); }

/* ---------- Pannello di amministrazione ---------- */
.admin-tabs { background: #fff; border-bottom: 1px solid var(--bg-light); box-shadow: 0 2px 6px rgba(5, 13, 29, .08); position: sticky; top: 76px; z-index: 90; }

.admin-tabs__menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; }

.admin-tabs__menu a {
  display: block;
  padding: 14px 16px;
  font-weight: 600;
  font-size: .9375rem;
  color: var(--gray);
  white-space: nowrap;
}

.admin-tabs__menu a:hover { color: var(--blue); text-decoration: none; }
.admin-tabs__menu a.is-active { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }

.admin-main { padding-bottom: 64px; }
.admin-section { padding-top: 40px; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin-bottom: 40px; }

.stat-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: transform .3s ease-in-out, box-shadow .3s ease-in-out;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(5, 13, 29, .22); text-decoration: none; }
.stat-card__num { font-size: 2rem; font-weight: 800; color: var(--blue); line-height: 1.1; }
.stat-card__label { color: var(--gray); font-weight: 600; font-size: .875rem; text-align: center; }

.admin-subtitle { margin-top: 32px; color: var(--blue-dark); }

.quick-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }

.comune-add-form {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 32px;
}

.form-step--password { border-top: 1px solid var(--bg-light); margin-top: 8px; padding-top: 20px; }

.email-body-box {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 28px;
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--blue-dark);
  background-image: linear-gradient(30deg, var(--blue-dark) 50%, var(--blue-mid) 50%);
  color: #fff;
  padding: 56px 0 24px;
  margin-top: 0;
}

.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--blue-light); }

.site-footer__inner { display: flex; flex-wrap: wrap; gap: 40px; }

.footer-column { flex: 1 1 200px; font-size: .9375rem; }
.footer-first { flex: 1.2 1 240px; }

.footer-logo-title { font-size: 1.75rem; margin-bottom: 16px; color: #fff; }
.footer-column img { max-height: 84px; width: auto; }

.site-footer .block__title { color: var(--blue-light); font-size: 1.0625rem; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; }
.footer-column p { margin-bottom: 10px; color: rgba(255, 255, 255, .85); }

.footer-social { display: flex; gap: 14px; align-items: center; }
.footer-social a { color: #fff; display: inline-flex; transition: transform .3s ease-in-out, color .3s ease-in-out; }
.footer-social a:hover { color: var(--blue-light); transform: translateY(-2px); }

.footer-bottom { flex-basis: 100%; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 20px; font-size: .875rem; color: rgba(255, 255, 255, .75); }
.footer-bottom p { margin-bottom: 6px; }

/* ============================================================
   Homepage v1.4 — Il progetto, Servizi, Vetrina, Bollino Italia
   ============================================================ */

/* Titolo di sezione in testa alla propria banda (senza margine superiore extra) */
.container > .section-title:first-child { margin-top: 0; }
.section-sub {
  text-align: center;
  color: var(--gray);
  max-width: 720px;
  margin: -16px auto 40px;
  font-size: 1.0625rem;
}
.section-title--light { color: #fff; }
.section-sub--light { color: rgba(255, 255, 255, .85); }

/* Intro dell'hero (cos'è / a chi / perché) */
.hero__intro {
  margin-top: 16px;
  max-width: 54ch;
  color: rgba(255, 255, 255, .85);
  font-size: 1.0625rem;
  line-height: 1.65;
}
.hero__intro strong { color: #fff; }

/* v2.1.1: testo hero sempre bianco per visibilità sullo sfondo blu.
   !important sovrascrive le colorazioni inline che l'admin può inserire
   dall'editor (es. <h3 style="color:#aaaaaa">). */
.hero__tagline, .hero__tagline *,
.hero__intro, .hero__intro * { color: #fff !important; }

/* v2.1.4: l'intro è ora un div che contiene il <p> di CKEditor.
   Normalizzo i margini del <p> interno per non duplicare lo spazio
   già dato da .hero__intro (margin-top: 16px). */
.hero__intro p { margin: 0 0 1em; }
.hero__intro p:last-child { margin-bottom: 0; }

/* "Perché nasce": tre chip icona + testo (sezione Il progetto) */
.progetto-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.progetto-chips li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-softer);
  border: 1px solid var(--bg-light);
  border-radius: var(--radius-card);
  padding: 20px 22px;
}

.progetto-chips__icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--blue);
  margin-top: 2px;
}

.progetto-chips strong { display: block; font-size: .9375rem; margin-bottom: 4px; }
.progetto-chips p { margin: 0; color: var(--gray); font-size: .875rem; line-height: 1.5; }

/* ---------- Servizi (tre blocchi per pubblico) ---------- */
.servizi { background-color: var(--bg-softer); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.service-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--blue);
}

.service-card--comune { border-top-color: #5e35b1; }
.service-card--azienda { border-top-color: #b26a00; }
.service-card--candidato { border-top-color: var(--blue); }

.service-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.service-card__icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.service-card--comune .service-card__icon { background: #ede7f6; color: #5e35b1; }
.service-card--azienda .service-card__icon { background: #fff3e0; color: #b26a00; }

.service-card__title { margin: 0; font-size: 1.25rem; color: var(--ink); }

.service-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-list li { border-left: 3px solid var(--bg-light); padding-left: 14px; }
.service-card--comune .service-list li { border-left-color: rgba(94, 53, 177, .28); }
.service-card--azienda .service-list li { border-left-color: rgba(178, 106, 0, .28); }
.service-card--candidato .service-list li { border-left-color: rgba(0, 102, 204, .28); }

.service-list strong { display: block; font-size: .9375rem; margin-bottom: 2px; color: var(--blue-dark); }
.service-list p { margin: 0; color: var(--gray); font-size: .9rem; line-height: 1.55; }
.service-list a { display: inline-block; margin-top: 6px; font-weight: 600; font-size: .875rem; }

.service-card .button { width: 100%; text-align: center; }

/* ---------- Vetrina (banda scura: territori + vita in Italia) ---------- */
.vetrina {
  background-color: var(--blue-dark);
  background-image: linear-gradient(rgba(1, 26, 51, .88), rgba(0, 78, 149, .72)), url('../img/hero_bg.jpg');
  background-size: cover;
  background-position: center;
  padding: 64px 0;
}

.territory-badges {
  list-style: none;
  margin: 0 0 56px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.territory-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 150px;
  padding: 14px 26px;
  border: 2px dashed rgba(233, 196, 106, .75);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.territory-badge__name { color: #fff; font-weight: 700; font-size: 1.0625rem; }
.territory-badge__prov {
  color: #E9C46A;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}

.vetrina__life-title { color: #fff; text-align: center; margin: 0 0 24px; font-size: 1.375rem; }

.life-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 980px;
  margin: 0 auto;
}

.life-item {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  text-align: center;
}

.life-item__icon { display: inline-flex; color: #E9C46A; margin-bottom: 12px; }
.life-item h4 { color: #fff; font-size: 1.0625rem; margin-bottom: 8px; }
.life-item p { color: rgba(255, 255, 255, .8); font-size: .9375rem; margin: 0; line-height: 1.55; }

/* ---------- Bollino Italia (richiamo finale) ---------- */
.bollino {
  background-color: var(--bg-softer);
  border-top: 1px solid var(--bg-light);
  padding: 64px 0;
}

.bollino__inner { display: flex; align-items: center; gap: 56px; }

.bollino__seal {
  flex: 0 0 auto;
  width: 280px;
  max-width: 100%;
}

.bollino__seal img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(1, 58, 107, .25));
}

.bollino__text { flex: 1; }
.bollino__ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Responsive ---------- */
@media screen and (max-width: 992px) {
  .hero__title { font-size: 2.5rem; line-height: 3.625rem; }
  .hero__tagline { font-size: 1rem; }

  .hero__inner { flex-direction: column; align-items: stretch; gap: 30px; }
  .hero__left, .hero__right { flex: 1 1 100%; text-align: center; }

  /* Sfondo animato hero (v1.8.0): skyline più compatta su tablet */
  .hero-fx__skyline { height: 110px; opacity: .12; }

  .image-text-block { flex-direction: column; gap: 28px; }
  .image-text-block__image, .image-text-block__text { flex: 1 1 100%; }

  /* Homepage v1.4 */
  .progetto-chips { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }
  .life-grid { grid-template-columns: 1fr; max-width: 520px; }

  .bollino__inner { flex-direction: column; text-align: center; gap: 32px; }
  .bollino__seal { width: 220px; }
  .bollino__ctas { justify-content: center; }

  .node-teaser { flex-direction: column; }
  .teaser-image { flex: 1 1 auto; max-height: 320px; }

  .admin-tabs { top: 76px; }
}

@media screen and (max-width: 767px) {
  .mobile-nav-button { display: block; }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    box-shadow: var(--shadow-header);
    display: none;
    padding: 8px 0;
  }

  .header-nav.is-open { display: block; }

  .primary-nav__menu { flex-direction: column; align-items: stretch; gap: 0; }
  .primary-nav__menu li { border-top: 1px solid var(--bg-light); }
  .primary-nav__menu a, .nav-logout { display: block; width: 100%; text-align: left; padding: 14px 24px; box-shadow: none !important; }

  /* Selettore lingua in mobile: riga centrata di codici */
  .lang-switcher { margin-left: 0; padding: 8px 24px; border-left: none; justify-content: center; }

  .hero { padding: 64px 0 56px; }
  .hero-fx__skyline { height: 84px; opacity: .11; } /* skyline compatta su mobile (v1.8.0) */
  .hero__title { font-size: 2rem; line-height: 2.75rem; }
  .hero-cta-wrapper { flex-direction: column; }
  .cta-card { min-height: 130px; flex: 1 1 auto; }

  .grid-2 { grid-template-columns: 1fr; gap: 0; }

  .page-title { font-size: 1.75rem; }
  .page-title--article { font-size: 1.875rem; }

  .stepper__label { display: none; }
  .stepper__step { padding-top: 36px; }

  .data-table { display: block; overflow-x: auto; white-space: nowrap; }

  .site-footer__inner { flex-direction: column; gap: 28px; }
}
