/* ===========================
   Reset & base
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Font stack: sans-serif moderni di sistema */
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #0f172a;
  background: #fff;
}

/* Titoli eleganti con serif */
h1, h2, h3, h4, h5, h6 {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: #0f4c81;
}

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

a {
  color: #0f4c81;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   Variables
=========================== */
:root {
  --bg: #fff;
  --fg: #0f172a;
  --muted: #475569;
  --brand: #0f4c81;
  --brand-2: #0b355c;
  --surface: #f8fafc;
  --ring: #94a3b8;
  --maxw: 1100px;
  --radius: 14px;
}

/* ===========================
   Layout & containers
=========================== */
.container {
  max-width: var(--maxw);
  padding: 0 1rem;
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 0;
}

.brand img {
  width: auto;
  height: 64px;
}

/* ===========================
   Navigation
=========================== */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: .8rem;
}

.nav a {
  padding: .5rem .6rem;
  border-radius: .6rem;
  display: inline-block;
  color: var(--brand);
}

.nav a:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.lang {
  font-size: .9rem;
  letter-spacing: .06em;
  color: var(--muted);
}

/* ===========================
   Mobile toggle menu
=========================== */
.menu-toggle {
  display: none;
  background: #fff;
  color: var(--brand);
  border: none;
  border-radius: .7rem;
  padding: .5rem .7rem;
  cursor: pointer;
  position: relative;
  z-index: 70;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--brand);
  margin: 5px 0;
  border-radius: 2px;
  transition: .3s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.menu-toggle:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* ===========================
   Responsive nav
=========================== */
@media (max-width: 880px) {
  .menu-toggle {
    display: inline-block;
    background: #fff;
    color: var(--brand);
  }

  .menu-toggle span {
    background: var(--brand);
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    background: var(--brand); /* sfondo blu */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .4s ease, opacity .4s ease, padding .3s ease;
    z-index: 40;
  }

  .nav.open {
    padding: 1rem;
    max-height: 500px;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }

  .nav ul {
    flex-direction: column;
    width: 100%;
    margin: 0 0 .5rem 0;
  }

  .nav ul li {
    width: 100%;
  }

  .nav ul li+li {
    border-top: 1px solid #e5e7eb; /* divisore grigio chiaro */
  }

  .nav ul li a {
    display: block;
    padding: .75rem 0;
  }

  .nav a {
    color: #fff;
  }

  .lang {
    color: #e5e7eb;
  }
}

/* ===========================
   Banner
=========================== */
#banner {
  display: grid;
  place-items: center;
  min-height: 40vh;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg,#081c30,#0a2b4e 40%,#0f4c81 70%,#0b355c);
  transition: background .4s ease;
}

#banner:hover {
  background: linear-gradient(135deg,#0b355c,#0f4c81 30%,#0a2b4e 70%,#081c30);
}

#banner .inner {
  padding: 4rem 1rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease-out forwards;
}

/* Titolo principale con fade bianco */
#banner h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: .25rem 0;
  background: linear-gradient(to bottom, #ffffff 0%, rgba(255,255,255,0.8) 70%, rgba(255,255,255,0.2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeUp 1.2s ease-out forwards;
}

/* Sottotitolo più morbido */
#banner h4 {
  font-weight: 400;
  margin-top: .75rem;
  color: rgba(255,255,255,0.85);
  animation: fadeUp 1.4s ease-out forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   Sections
=========================== */
section.wrapper {
  padding: 3.5rem 0;
  background: var(--bg);
  text-align: left;
}

section.wrapper:nth-of-type(even) {
  background: var(--surface);
}

h2.major {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  margin: 2rem 0 1.2rem;
  text-align: left;
  color: var(--brand);
  font-weight: 500;
}

.box {
  text-align: left;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ===========================
   Grid
=========================== */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   Footer
=========================== */
footer {
  background: #0b1220;
  color: #e5e7eb;
  font-size:14px;
}

footer .container {
  padding: 2rem 1rem;
}

footer hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,.15);
  margin: 1rem 0;
}

footer a {
  color: #cfe3ff;
}

/* ===========================
   Accessibility
=========================== */
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ===========================
   Back to Top
=========================== */
#backToTop {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #0f4c81;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  display: none;
  z-index: 99;
}

#backToTop:hover {
  background: #0b355c;
}