/* Sito pubblico – impostazione da corriere.
   Colori del marchio da config.php → brand (variabili --c e --accent impostate nella pagina).
   Scala tipografica: 14 · 16 · 17 (testo) · 20 · 24 · 30 · 38 · 56 */
:root {
  --c: #14306b; --c-dark: #0d214b; --accent: #ffb400; --accent-dark: #e09e00;
  --text: #1f2530; --muted: #5a6371; --line: #dde2e8; --bg-soft: #f3f5f8; --sand: #cdbda6; --dark: #3a3f47;
  --font: "Titillium Web", "Segoe UI", Arial, sans-serif;
  --wrap: 1280px; --gutter: clamp(16px, 4vw, 40px);
  --radius: 8px; --shadow: 0 10px 30px rgba(16, 28, 48, .14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--text); background: #fff; }
a { color: var(--c); }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.18; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barra superiore (Privati / Aziende) ---------- */
.util { background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.util .wrap { display: flex; justify-content: space-between; align-items: stretch; min-height: 40px; }
.util .tabs { display: flex; }
.util .tabs a { display: flex; align-items: center; padding: 0 18px; text-decoration: none; color: var(--text); }
.util .tabs a.on { background: #fff; color: var(--c); font-weight: 600; box-shadow: inset 0 -3px 0 var(--c); }
.util .right { display: flex; align-items: center; gap: 24px; }
.util .right a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.util .right a:hover { color: var(--c); }

/* ---------- Testata ---------- */
.hdr { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.hdr .wrap { display: flex; align-items: center; gap: 44px; height: 80px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--c); font-weight: 700; font-size: 24px; letter-spacing: -.01em; white-space: nowrap; }
.logo img { display: block; height: 44px; width: auto; }
.menu { display: flex; gap: 4px; flex: 1; height: 100%; }
.menu a { display: flex; align-items: center; padding: 0 16px; text-decoration: none; color: var(--text); font-size: 17px; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.menu a:hover { color: var(--c); border-bottom-color: var(--c); }
.hdr-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); text-decoration: none; }
.icon-btn:hover { background: var(--bg-soft); color: var(--c); }
.mobile-menu { display: none; }

/* ---------- Barra avvisi ---------- */
.alert { background: #fff8e6; border-bottom: 1px solid #f1e2bd; font-size: 15px; }
.alert .wrap { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; }
.alert svg { color: #b97f00; flex: none; }
.alert a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.alert a:hover { text-decoration: underline; }

/* ---------- Bottoni ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border-radius: 6px; font: inherit; font-size: 17px; font-weight: 600; text-decoration: none; cursor: pointer; border: 0; }
.btn-accent { background: var(--accent); color: #1d1d1d; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-primary { background: var(--c); color: #fff; }
.btn-primary:hover { background: var(--c-dark); }
.btn-white { background: #fff; color: var(--c); }
.btn-white:hover { background: #e9eef7; }

/* ---------- Hero: pannello colore a sinistra, foto a destra, ricerca sopra la foto ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: clamp(460px, 42vw, 580px); background: var(--c); }
.hero-panel { background: var(--c); color: #fff; display: flex; align-items: center; justify-content: flex-end; }
.hero-text { width: 100%; max-width: 640px; padding: 56px 48px 56px var(--gutter); }
.hero h1 { font-size: clamp(36px, 3.4vw, 54px); font-weight: 300; line-height: 1.08; letter-spacing: -.01em; margin-bottom: 18px; }
.hero p { font-size: clamp(18px, 1.4vw, 21px); font-weight: 300; line-height: 1.45; opacity: .92; margin: 0 0 30px; }
.hero-photo { position: relative; overflow: hidden; background: #c9ced6; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 35%; }
.track-card { position: absolute; z-index: 2; left: 40px; bottom: 40px; width: min(480px, calc(100% - 80px)); background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px 22px; }
.track-card h2 { font-size: 26px; font-weight: 400; margin-bottom: 16px; }
.track-form { display: flex; }
.track-form input { flex: 1; min-width: 0; border: 1px solid #aeb6c1; border-right: 0; border-radius: 6px 0 0 6px; padding: 0 16px; height: 58px; font: inherit; font-size: 19px; text-transform: uppercase; letter-spacing: .03em; background: #fff; }
.track-form input::placeholder { text-transform: none; letter-spacing: 0; color: #7d8590; }
.track-form input:focus { outline: none; border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.track-form button { width: 64px; height: 58px; border: 0; border-radius: 0 6px 6px 0; background: var(--accent); color: #1d1d1d; cursor: pointer; display: grid; place-items: center; flex: none; }
.track-form button:hover { background: var(--accent-dark); }
.track-card .more { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--text); }
.track-card .more:hover { color: var(--c); }

/* ---------- Sezioni ---------- */
.section { padding: clamp(56px, 6vw, 88px) 0; }
.section.soft { background: var(--bg-soft); }
.section-title { text-align: center; font-size: clamp(30px, 2.8vw, 38px); font-weight: 400; margin-bottom: clamp(28px, 3vw, 44px); }

/* Riquadri in evidenza (tinta piena, link in basso) */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.tile { display: flex; flex-direction: column; min-height: 250px; padding: 26px 26px 20px; border-radius: var(--radius); text-decoration: none; color: #fff; background: var(--c); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile h3 { font-size: 24px; font-weight: 400; margin-bottom: 10px; }
.tile p { margin: 0 0 18px; font-size: 16px; line-height: 1.5; }
.tile .go { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.28); }
.tile.dark { background: var(--dark); }
.tile.sand { background: var(--sand); color: #262626; }
.tile.sand .go { border-top-color: rgba(0,0,0,.15); }
.tile.light { background: #e6e9ed; color: var(--text); }
.tile.light .go { border-top-color: rgba(0,0,0,.12); }

/* Servizi con icona tonda */
.icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; text-align: center; }
.icons a { text-decoration: none; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.3; }
.icons .circle { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--c); box-shadow: 0 2px 10px rgba(16, 28, 48, .08); transition: background .15s, color .15s; }
.icons .circle svg { width: 38px; height: 38px; }
.icons a:hover .circle { background: var(--c); color: #fff; }
.icons a:hover { color: var(--c); }

/* Servizi (elenco con descrizione) */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.svc { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); padding: 28px; }
.svc .si { color: var(--c); margin-bottom: 14px; }
.svc .si svg { width: 40px; height: 40px; }
.svc h3 { font-size: 21px; font-weight: 600; margin-bottom: 8px; }
.svc p { margin: 0; color: var(--muted); font-size: 16px; }

/* Banda aziende */
.biz-box { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: 0 2px 14px rgba(16, 28, 48, .06); }
.biz-text { padding: clamp(28px, 4vw, 56px); }
.biz-text h2 { font-size: clamp(28px, 2.6vw, 36px); font-weight: 400; }
.biz-text p { color: var(--muted); font-size: 18px; margin: 0 0 20px; }
.biz-text ul { padding: 0; margin: 0 0 30px; list-style: none; }
.biz-text li { display: flex; gap: 12px; padding: 8px 0; font-size: 17px; }
.biz-text li svg { color: var(--c); flex: none; margin-top: 3px; }
.biz-photo { position: relative; min-height: 420px; background: #c9ced6; }
.biz-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* FAQ */
.faq { max-width: 900px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 20px 4px; font-size: 19px; }
.faq summary:hover { color: var(--c); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; margin-top: 7px; border-right: 2px solid var(--c); border-bottom: 2px solid var(--c); transform: rotate(45deg); transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 12px; }
.faq .ans { padding: 0 4px 22px; color: var(--muted); max-width: 72ch; }
.faq-contact { text-align: center; margin-top: 30px; color: var(--muted); }

/* Pulsante di aiuto fisso */
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 999px; background: var(--c); color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.help-fab:hover { background: var(--c-dark); }

/* Finestra «la tua spedizione» (codice ricordato) */
.trk-backdrop { position: fixed; inset: 0; background: rgba(15, 22, 35, .45); z-index: 90; }
.trk-dialog { position: fixed; z-index: 100; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; width: min(480px, calc(100% - 32px)); border: 0; border-radius: 10px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); font-family: var(--font); color: var(--text); }
.trk-dialog-label { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.trk-dialog h2 { font-size: 24px; font-weight: 600; margin: 0 0 12px; }
.trk-dialog-status { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.trk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.trk-green { background: #1f8a4c; } .trk-orange { background: #d9822b; } .trk-red { background: #c4372b; } .trk-grey { background: #6b7684; }
.trk-dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 14px; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.trk-dialog-forget { font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */
.ftr { background: #262a31; color: #c4c9d1; font-size: 15px; }
.ftr .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding: 60px 0 40px; }
.ftr h4 { color: #fff; font-size: 17px; font-weight: 600; margin: 0 0 14px; }
.ftr a { color: inherit; text-decoration: none; display: block; padding: 5px 0; }
.ftr a:hover { color: #fff; text-decoration: underline; }
.ftr .logo { display: inline-block; padding: 0; margin-bottom: 18px; }
.ftr .logo img { height: 40px; }
.ftr .legal > span:first-child { max-width: 900px; line-height: 1.6; }
.ftr .legal > span:first-child a { margin: 0; text-decoration: underline; }
.ftr .legal { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.ftr .legal a { display: inline; padding: 0; margin-left: 20px; }

/* ---------- Pagine legali ---------- */
.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 32px 0; }
.page-head h1 { font-size: clamp(30px, 3vw, 40px); font-weight: 400; margin: 0; }
.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: inherit; }
.legal-page { max-width: 860px; padding-top: 36px; padding-bottom: 72px; }
.legal-page p { font-size: 17px; max-width: 72ch; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .menu a { padding: 0 11px; }
  .hdr .wrap { gap: 28px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .icons { grid-template-columns: repeat(3, 1fr); row-gap: 32px; }
}
@media (max-width: 900px) {
  .menu, .util .tabs, .hdr-tools .icon-btn.hide-m { display: none; }
  .mobile-menu { display: block; }
  .hdr .wrap { height: 68px; justify-content: space-between; }
  .logo { font-size: 21px; }
  .logo img { height: 38px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-panel { justify-content: flex-start; }
  .hero-text { max-width: none; padding: 40px var(--gutter) 32px; }
  .hero-photo { min-height: 0; padding: 220px var(--gutter) var(--gutter); }
  .track-card { position: relative; left: auto; bottom: auto; width: 100%; }
  .biz-box { grid-template-columns: 1fr; }
  .biz-photo { min-height: 260px; order: -1; }
  .ftr .cols { grid-template-columns: 1fr 1fr; }
}
/* ---------- Telefono ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .util { display: none; }
  .alert { font-size: 14px; }
  .alert .wrap { justify-content: flex-start; padding-top: 8px; padding-bottom: 8px; }
  .alert span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-text { padding: 30px var(--gutter) 26px; }
  .hero p { margin-bottom: 22px; }
  .hero-photo { padding-top: 150px; }
  .track-card { padding: 20px 18px 16px; }
  .track-card h2 { font-size: 22px; }
  .track-form input { height: 54px; font-size: 17px; }
  .track-form button { height: 54px; width: 58px; }
  .tiles, .services { grid-template-columns: 1fr; gap: 14px; }
  .tile { min-height: 0; padding: 22px; }
  .tile h3 { font-size: 22px; }
  .icons { grid-template-columns: repeat(3, 1fr); gap: 22px 10px; }
  .icons .circle { width: 72px; height: 72px; }
  .icons .circle svg { width: 30px; height: 30px; }
  .icons a { font-size: 14px; }
  .svc { padding: 22px; }
  .biz-photo { min-height: 200px; }
  .faq summary { font-size: 17px; padding: 16px 2px; }
  .ftr .cols { grid-template-columns: 1fr; gap: 26px; padding-top: 44px; }
  .ftr .legal a { margin: 0 16px 0 0; }
  .help-fab span { display: none; }
  .help-fab { padding: 15px; }
}
.mobile-menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.mobile-menu nav a { display: block; padding: 16px var(--gutter); border-top: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
