:root {
  --red: #d71920;
  --red-dark: #ad1117;
  --logo-blue: #1473c9;
  --dark: #10131a;
  --text: #242936;
  --muted: #667085;
  --light: #f5f7fb;
  --soft-red: #fff1f2;
  --border: #e6e9f0;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(16, 19, 26, .12);
  --radius: 24px;
  --container: 1160px;
  --field-bg: #f2f5f9;
  --field-border: rgba(20, 63, 130, .24);
  --success-bg: #ecf9f0;
  --success-text: #1d7a46;
  --error-bg: #fff1f1;
  --error-text: #b33139;
}

* { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

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

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

.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}

/* Navbar copiata dalla home */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230, 233, 240, .9);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: 132px;
  max-width: 36vw;
  height: auto;
  margin: 7px 0;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--dark);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 19, 26, .06);
}

.menu-toggle span {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: background .2s ease;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .22s ease, top .22s ease;
}

.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 10px 13px;
  border-radius: 999px;
  color: #4b5565;
  font-weight: 650;
  font-size: .95rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--red);
  background: #f2f4f7;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  border-radius: 999px;
  color: var(--white) !important;
  background: var(--red) !important;
  box-shadow: 0 12px 26px rgba(215, 25, 32, .22);
}

/* Sezione contatti: stesso sfondo chiaro della hero della home */
.page-wrap {
  position: relative;
  overflow: hidden;
  padding: 82px 0 78px;
  background:
    radial-gradient(circle at 50% -18%, rgba(20, 115, 201, .22), transparent 36%),
    radial-gradient(circle at 92% 24%, rgba(20, 115, 201, .11), transparent 30%),
    radial-gradient(circle at 8% 34%, rgba(215, 25, 32, .08), transparent 27%),
    linear-gradient(180deg, #ffffff 0%, #f2f8fe 52%, #f8fbff 78%, #ffffff 100%);
}

.contact-card {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr);
  gap: 54px;
  align-items: start;
}

.contact-card::before {
  display: none;
}

.contact-copy,
.contact-form-wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--red);
  background: var(--soft-red);
  border: 1px solid rgba(215, 25, 32, .13);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

h1, h2, h3 {
  color: var(--dark);
  line-height: 1.08;
  letter-spacing: -.045em;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 4.6vw, 4.15rem);
  max-width: 900px;
}

.lead {
  margin: 22px 0 0;
  max-width: 760px;
  color: #3c4454;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
}

.info-list {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.info-item {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 16px 22px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(20, 63, 130, .12);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(16, 19, 26, .055);
}

.info-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #55b8ff, var(--logo-blue));
}

.info-label {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.info-value {
  color: var(--dark);
  font-weight: 750;
}

.contact-form {
  display: block;
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: 1 / -1;
}

.field-half { grid-column: span 1; }

.field label,
.checkbox-label span {
  color: var(--dark);
  font-size: .95rem;
  font-weight: 700;
}

.optional {
  color: var(--muted);
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 39, 70, .04);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field textarea { resize: vertical; }

.field input::placeholder,
.field textarea::placeholder {
  color: #7b8495;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(215, 25, 32, .45);
  box-shadow: 0 0 0 4px rgba(215, 25, 32, .08), inset 0 1px 2px rgba(15, 39, 70, .04);
  background: #ffffff;
}

.field small {
  color: var(--muted);
  line-height: 1.55;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--red);
}

.honeypot-wrap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.selected-files {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.selected-file-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(20, 63, 130, .12);
  font-size: .92rem;
  line-height: 1.45;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.selected-file-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selected-file-main strong {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.selected-file-main span { color: var(--muted); }

.selected-file-remove {
  flex: 0 0 auto;
  border: 1px solid rgba(20, 63, 130, .12);
  background: #fff;
  color: var(--dark);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.selected-file-remove:hover,
.selected-file-remove:focus-visible {
  background: #f8fafc;
  border-color: rgba(215, 25, 32, .36);
  transform: translateY(-1px);
}

.selected-file-item.invalid {
  border-color: rgba(255, 120, 120, .45);
  background: #fff1f1;
}

.files-summary {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .62);
  color: var(--muted);
  font-size: .92rem;
  border: 1px solid rgba(20, 63, 130, .10);
}

.files-summary.summary-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.form-status { margin-top: 14px; }

.loading,
.error-message,
.sent-message {
  border-radius: 14px;
  padding: 14px 16px;
  font-size: .95rem;
  line-height: 1.5;
}

.loading {
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(20, 63, 130, .10);
}

.error-message { background: var(--error-bg); color: var(--error-text); }
.sent-message { background: var(--success-bg); color: var(--success-text); }

.submit-btn {
  margin-top: 18px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--red);
  box-shadow: 0 12px 26px rgba(215, 25, 32, .22);
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.submit-btn:hover,
.submit-btn:focus-visible {
  transform: translateY(-1px);
  opacity: .95;
  box-shadow: 0 18px 38px rgba(215, 25, 32, .28);
}

.submit-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

.site-footer {
  padding: 32px 0;
  color: #7b8495;
  background: #0b0d12;
  font-size: .95rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a:hover { color: #ffffff; }

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: .2s ease;
  font-size: 1.35rem;
  font-weight: 900;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .brand-logo {
    width: 102px;
    max-width: 40vw;
    margin: 2px 0;
  }

  .nav {
    min-height: 58px;
    padding: 5px 0;
  }

  .menu-toggle {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .nav-links {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    width: auto;
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }

  .nav-links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
  }

  .nav-cta { margin-top: 4px; }

  .page-wrap { padding-top: 54px; }

  .contact-card {
    grid-template-columns: 1fr;
    gap: 34px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .page-wrap {
    padding: 48px 0 58px;
  }

  .contact-card {
    width: min(100% - 24px, var(--container));
  }

  h1 {
    font-size: clamp(2.15rem, 10vw, 3rem);
  }

  .lead {
    font-size: 1.02rem;
  }

  .form-grid { grid-template-columns: 1fr; }
  .field-half { grid-column: 1 / -1; }

  .selected-file-item {
    flex-direction: column;
    align-items: stretch;
  }

  .selected-file-remove { width: 100%; }
}
