/* ============================================
   SINDACATO EUROPEO – Design professionale
   Palette dal logo: blu, oro, bianco, nero
   ============================================ */

:root {
  /* Dal logo: blu scuro (simile alle striature) */
  --primary: #0d2840;
  --primary-hover: #143a5c;
  --primary-light: #1e4976;
  /* Oro (stelle e dettagli logo) */
  --accent: #b8860b;
  --accent-hover: #d4a017;
  --accent-light: #f5e6c8;
  /* Neutri */
  --white: #ffffff;
  --off-white: #f7f8fa;
  --text: #1a1d21;
  --text-muted: #5c6268;
  --border: #e2e6eb;
  --border-light: #eef0f3;
  /* Tipografia professionale */
  --font-head: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --max-width: 1140px;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(13, 40, 64, 0.06);
  --shadow-hover: 0 4px 16px rgba(13, 40, 64, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--accent);
}

/* ---- Header ---- */
.masthead {
  background: var(--primary);
  color: var(--white);
  padding: 1rem 1.5rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.masthead-logo {
  height: 128px;
  width: auto;
}

.masthead-title {
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  text-align: center;
  flex: 1;
  min-width: 200px;
}

.masthead-title a {
  color: var(--white);
  text-decoration: none;
}
.masthead-title a:hover {
  color: var(--accent-light);
}

.masthead-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.masthead-meta span {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.2rem;
}

/* ---- Navigazione ---- */
.nav-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border-light);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  justify-content: center;
}

.nav-list a {
  display: block;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  padding: 1rem 1.25rem;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.nav-list a:hover {
  color: var(--primary);
  background: var(--off-white);
}
.nav-list a.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

/* Hamburger: nascosto su desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.nav-toggle:hover {
  background: var(--off-white);
  border-color: var(--primary);
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  margin: 0 auto;
  transition: transform 0.3s, opacity 0.3s;
}
/* Checkbox nascosto per toggle menu mobile */
.nav-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Mobile: menu a scomparsa */
@media (max-width: 768px) {
  .nav-bar {
    padding: 0.75rem 1rem;
  }
  .nav-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }
  .nav-toggle {
    display: flex;
    order: 1;
    cursor: pointer;
  }
  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 2;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 0.5rem;
  }
  /* Apertura menu: checkbox checked O classe nav-open (fallback JS) */
  .nav-check:checked ~ .nav-list,
  .nav-bar.nav-open .nav-list {
    display: flex !important;
  }
  .nav-check:checked ~ .nav-toggle .nav-toggle-bar:nth-child(1),
  .nav-bar.nav-open .nav-toggle .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-check:checked ~ .nav-toggle .nav-toggle-bar:nth-child(2),
  .nav-bar.nav-open .nav-toggle .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .nav-check:checked ~ .nav-toggle .nav-toggle-bar:nth-child(3),
  .nav-bar.nav-open .nav-toggle .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .nav-list a {
    padding: 0.85rem 1rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .nav-list a.active {
    border-left-color: var(--accent);
    border-bottom-color: transparent;
  }
}

/* ---- Main ---- */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ---- Titoli di sezione ---- */
.section-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.5rem;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 3rem 2rem 3.5rem;
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero .lead {
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 640px;
  margin: 0 auto 1.75rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ---- Bottoni ---- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn:hover {
  text-decoration: none;
}

.btn-inverse {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-inverse:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.35);
}

.hero .btn:not(.btn-inverse) {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}
.hero .btn:not(.btn-inverse):hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.main .btn:not(.btn-inverse) {
  background: var(--white);
  color: var(--primary);
  border-color: var(--border);
}
.main .btn:not(.btn-inverse):hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}

/* ---- Griglia servizi ---- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.service-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
}
.service-card h3 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}
.service-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.service-card a {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.service-card a:hover {
  color: var(--accent);
}

/* ---- Notizie ---- */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.news-list li {
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 1.25rem;
}
.news-list li:last-child {
  border-bottom: none;
}
.news-list a {
  font-weight: 600;
  color: var(--text);
}
.news-list a:hover {
  color: var(--primary);
}
.news-list .date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* ---- Articolo singolo (pagina notizia) ---- */
.article {
  max-width: 720px;
}
.article-header {
  margin-bottom: 1.5rem;
}
.article-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.5rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.article-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.article-body {
  font-size: 1.05rem;
  line-height: 1.7;
}
.article-body h2 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1.75rem 0 0.6rem;
}
.article-body p {
  margin: 0 0 1rem;
  color: var(--text);
}
.article-body ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.article-body li {
  margin-bottom: 0.35rem;
}
.article-body .btn {
  margin-top: 0.5rem;
}

/* ---- Pagine interne ---- */
.page-header {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
.page-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.02em;
}

/* ---- Contatti ---- */
.contact-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.contact-block h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.5rem;
}
.contact-block p {
  margin: 0;
  color: var(--text-muted);
}
.contact-block a {
  color: var(--primary);
  font-weight: 600;
}
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.cta-buttons .btn {
  margin: 0;
}
.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover {
  background: rgba(13, 40, 64, 0.06);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* ---- Servizi: liste ---- */
.main ul:not(.nav-list):not(.news-list) {
  margin: 0.75rem 0 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
}
.main ul:not(.nav-list):not(.news-list) li {
  margin-bottom: 0.4rem;
}

/* ---- Intro summary (SEO / assistenti) ---- */
.intro-summary {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.intro-summary p {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

/* ---- FAQ ---- */
.faq-list {
  margin: 1rem 0 2rem;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--white);
  box-shadow: var(--shadow);
}
.faq-q {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.5rem;
}
.faq-a {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---- CTA section ---- */
.cta-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow);
}
.cta-section .section-title {
  margin-top: 0;
}
.cta-section p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ---- Footer ---- */
.footer {
  background: var(--primary);
  color: var(--white);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  font-size: 0.9rem;
}
.footer-inner a {
  color: var(--accent-light);
  font-weight: 500;
}
.footer-inner a:hover {
  color: var(--white);
}
.footer-inner p {
  margin: 0.5rem 0;
  color: rgba(255, 255, 255, 0.8);
}
.footer-inner strong {
  color: var(--white);
}

/* ---- Form ---- */
.form-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.form-block h2 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.form-group label .required {
  color: var(--accent);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 400px;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 40, 64, 0.15);
}
.form-group textarea {
  min-height: 100px;
  resize: vertical;
}
.form-error {
  font-size: 0.85rem;
  color: #c53030;
  margin-top: 0.25rem;
}
.form-actions {
  margin-top: 1.25rem;
}
.form-actions .btn,
.form-actions button.btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.form-actions button.btn {
  font-family: inherit;
}
.msg-success {
  background: #e6ffed;
  border: 1px solid #9ae6b4;
  color: #22543d;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.msg-error {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #c53030;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
