/* ============================================
   M&R Multiservizi — Design System
   ============================================ */

:root {
  /* Colori */
  --color-navy: #1A2D5A;
  --color-blue: #2D6AAF;
  --color-light-blue: #8CBDD9;
  --color-pale: #E1EEF8;
  --color-green: #5BA829;
  --color-white: #FFFFFF;
  --color-gray-100: #F5F5F5;
  --color-gray-600: #646464;
  --color-text: #1A1A1A;

  /* Font */
  --font-heading: 'DM Sans', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spaziature */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;

  /* Padding sezioni (dal design Figma) */
  --section-py: 80px;
  --section-px: 80px;
  --hero-pt: 200px;
  --hero-pb: 125px;
  --cta-py: 80px;
  --footer-pt: 48px;
  --footer-pb: 32px;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 100px;

  /* Ombre */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-header: 0 4px 16px rgba(0, 0, 0, 0.1);

  /* Transizioni */
  --transition: 0.3s ease;

  /* Container */
  --container-max: 1280px;
}

/* ---- Reset base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-navy);
}

h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

p { margin-bottom: 1em; }

/* ---- Container ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--section-px);
}

/* ---- Bottoni ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn.btn--primary {
  background: var(--color-blue);
  color: var(--color-white);
  font-weight: 500;
  border-radius: 0.9em;
  border: none;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  box-shadow: inset 0 0 1.6em -0.6em var(--color-navy);
  overflow: hidden;
  position: relative;
  height: 2.8em;
  padding: 12px 48px 12px 20px !important;
  gap: 0;
  white-space: nowrap;
}
.btn--primary .btn__icon {
  background: var(--color-white);
  margin-left: 1em;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.2em;
  width: 2.2em;
  border-radius: 0.7em;
  box-shadow: 0.1em 0.1em 0.6em 0.2em rgba(26, 45, 90, 0.35);
  right: 0.3em;
  transition: all 0.3s;
}
.btn--primary:hover .btn__icon {
  width: calc(100% - 0.6em);
}
.btn--primary .btn__icon svg {
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.3s;
  color: var(--color-blue);
  flex-shrink: 0;
}
.btn--primary:hover .btn__icon svg {
  transform: translateX(0.1em);
}
.btn--primary:active .btn__icon {
  transform: scale(0.95);
}

.btn.btn--call {
  background: var(--color-white);
  color: var(--color-blue);
  border: none;
  padding: 12px 20px;
  border-radius: 0.9em;
  height: 2.8em;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn.btn--call:hover {
  opacity: 0.85;
}
.btn.btn--call:active {
  transform: scale(0.97);
}

.btn--secondary {
  background: var(--color-white);
  color: var(--color-blue);
  border: none;
  border-radius: 0.9em;
  height: 2.8em;
  padding: 12px 20px;
  font-size: 14px;
}
.btn--secondary:hover {
  background: var(--color-pale);
}

.btn--outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}
.btn--outline:hover {
  background: var(--color-white);
  color: var(--color-navy);
}

/* ---- Label sezione ---- */
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-blue);
  margin-bottom: var(--space-sm);
}

/* ---- Trust Badge ---- */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-white);
}
.trust-badge__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-green);
}

/* ---- Link Arrow ---- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-blue);
  transition: gap var(--transition);
}
.link-arrow:hover {
  gap: 10px;
}

/* ---- Utility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ---- Accessibility ---- */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: 4px;
}
/* On dark surfaces (hero content, cta band, footer) use a light ring */
.hero__content :focus-visible,
.cta-band :focus-visible,
.footer :focus-visible,
.modal-overlay :focus-visible,
.hero--video :focus-visible {
  outline-color: var(--color-white);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 2000;
  background: var(--color-navy);
  color: var(--color-white);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 8px;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root {
    --section-px: 20px;
    --section-py: 48px;
    --hero-pt: 120px;
    --hero-pb: 80px;
  }

  h1 { font-size: 32px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
}

/* ── Fix horizontal overflow ── */
html, body {
  overflow-x: hidden;
}

/* ── Fix primary button text centering mobile ── */
@media (max-width: 768px) {
  .btn.btn--primary {
    justify-content: center;
    text-align: center;
    width: 100%;
    font-size: 14px;
  }
}
