/* ============================================================
   Microcredito Castel Goffredo — Stile istituzionale
   Ispirato alle linee guida Designers Italia / AGID
   ============================================================ */

:root {
  /* Palette istituzionale */
  --c-blue-900: #06357A;   /* primario scuro */
  --c-blue-700: #0B5BC4;   /* primario */
  --c-blue-600: #0066CC;   /* link / accent */
  --c-blue-100: #E8F0FB;   /* sfondo soft */
  --c-blue-50:  #F4F8FD;

  --c-green:    #1B7A3A;   /* successo / WhatsApp */
  --c-amber:    #B8860B;   /* attenzione */
  --c-red:      #B22222;   /* errore / urgenza */

  --c-tricolor-green: #008C45;
  --c-tricolor-white: #F4F5F0;
  --c-tricolor-red:   #CD212A;

  --c-ink-900: #1A1A1A;
  --c-ink-700: #3A3A3A;
  --c-ink-500: #5C6670;
  --c-ink-300: #B8C0C7;
  --c-ink-100: #E5E8EB;
  --c-ink-50:  #F5F6F7;
  --c-paper:   #FFFFFF;

  /* Tipografia */
  --f-sans: "Titillium Web", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-serif: "Lora", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spazi */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  --max-w: 1120px;
  --content-w: 760px;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(6, 53, 122, 0.06), 0 1px 3px rgba(6, 53, 122, 0.04);
  --shadow-md: 0 4px 12px rgba(6, 53, 122, 0.08), 0 2px 4px rgba(6, 53, 122, 0.04);
  --shadow-lg: 0 12px 32px rgba(6, 53, 122, 0.12);

  --focus: 0 0 0 3px rgba(11, 91, 196, 0.35);
}

/* Reset essenziale */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-ink-900);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--c-blue-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
a:hover { color: var(--c-blue-900); text-decoration-thickness: 2px; }
a:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }

/* Skip link accessibilità */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--c-blue-900);
  color: white;
  padding: 12px 16px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============================================================
   Banda tricolore + Header istituzionale
   ============================================================ */

.tricolor-bar {
  height: 4px;
  background: linear-gradient(
    to right,
    var(--c-tricolor-green) 0%, var(--c-tricolor-green) 33.33%,
    var(--c-tricolor-white) 33.33%, var(--c-tricolor-white) 66.66%,
    var(--c-tricolor-red) 66.66%, var(--c-tricolor-red) 100%
  );
}

.site-header {
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-ink-100);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  text-decoration: none;
  color: var(--c-ink-900);
  flex: 1;
}
.brand:hover { color: var(--c-ink-900); }
.brand__crest {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__entity {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-500);
  font-weight: 600;
}
.brand__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-ink-900);
}
.brand__sub {
  font-size: 13px;
  color: var(--c-ink-500);
  font-weight: 400;
  margin-top: 2px;
}

.site-nav { display: flex; gap: var(--sp-2); }
.site-nav a {
  text-decoration: none;
  color: var(--c-ink-700);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 15px;
  transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--c-blue-50); color: var(--c-blue-700); }
.site-nav a[aria-current="page"] { color: var(--c-blue-700); background: var(--c-blue-100); }

@media (max-width: 760px) {
  .site-header__inner { flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
  .site-nav { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .brand__name { font-size: 16px; }
  .brand__sub { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  background: linear-gradient(135deg, var(--c-blue-900) 0%, var(--c-blue-700) 100%);
  color: white;
  padding: var(--sp-8) var(--sp-5);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--sp-7);
  align-items: center;
}
.hero__eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--sp-4);
}
.hero h1 {
  font-family: var(--f-sans);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 var(--sp-4) 0;
  letter-spacing: -0.01em;
}
.hero__lead {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
  margin: 0 0 var(--sp-5) 0;
  max-width: 56ch;
}
.hero__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

.hero__card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  backdrop-filter: blur(6px);
}
.hero__card-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin: 0 0 var(--sp-3) 0;
}
.hero__card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--sp-3);
}
.hero__card-list li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  font-size: 15px;
  color: white;
}
.hero__card-list strong { display: block; font-weight: 600; }
.hero__card-list span { color: rgba(255,255,255,0.8); font-size: 14px; }
.hero__card-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  color: rgba(255,255,255,0.9);
  margin-top: 2px;
}

@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero { padding: var(--sp-7) var(--sp-4); }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 12px 22px;
  font-family: var(--f-sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1.2;
}
.btn--primary {
  background: white;
  color: var(--c-blue-900);
  border-color: white;
}
.btn--primary:hover { background: var(--c-blue-50); color: var(--c-blue-900); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn--outline {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.5);
}
.btn--outline:hover { background: rgba(255,255,255,0.1); border-color: white; color: white; }

.btn--solid {
  background: var(--c-blue-700);
  color: white;
  border-color: var(--c-blue-700);
}
.btn--solid:hover { background: var(--c-blue-900); border-color: var(--c-blue-900); color: white; }

.btn--ghost {
  background: transparent;
  color: var(--c-blue-700);
  border-color: var(--c-ink-100);
}
.btn--ghost:hover { background: var(--c-blue-50); border-color: var(--c-blue-700); color: var(--c-blue-900); }

.btn:focus-visible { outline: none; box-shadow: var(--focus); }
