/* ==========================================================================
   Giampaolo S.r.l. — design tokens & system
   Trasporto e deposito autovetture dal 1980
   ========================================================================== */

:root {
  /* colour */
  --asphalt: #1b1e22;
  --asphalt-soft: #262a30;
  --steel: #4b535c;
  --steel-line: #d8dade;
  --targa-blue: #0c3c87;
  --targa-blue-dark: #092c63;
  --signal-amber: #e7a400;
  --cloud: #f2f3f5;
  --paper: #ffffff;

  /* type */
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* rhythm */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 6px;
  --shadow-card: 0 1px 2px rgba(27, 30, 34, 0.06), 0 8px 24px -12px rgba(27, 30, 34, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cloud: #f2f3f5;
    --paper: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--asphalt);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.6em;
  color: var(--asphalt);
}

h1 { font-size: clamp(2.7rem, 6.2vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); }

p { margin: 0 0 1.1em; color: var(--steel); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--targa-blue);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}
a:hover { color: var(--targa-blue-dark); }

:focus-visible {
  outline: 3px solid var(--signal-amber);
  outline-offset: 2px;
}

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

.container {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--cloud { background: var(--cloud); }
.section--asphalt { background: var(--asphalt); color: var(--paper); }
.section--asphalt h1, .section--asphalt h2, .section--asphalt h3 { color: var(--paper); }
.section--asphalt p { color: #c7ccd3; }

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head--center { max-width: 44rem; margin-inline: auto; text-align: center; }

/* -------------------------------------------------------------------------
   Signature element — the "targa" tag, styled after the Italian
   number-plate's EU identification band. Used as an eyebrow / label
   wherever content needs a short, factual tag: sections, stats, badges.
   ------------------------------------------------------------------------- */
.plate {
  display: inline-flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(27, 30, 34, 0.08);
  margin-bottom: 1.1rem;
  font-family: var(--font-mono);
}
.plate__band {
  background: var(--targa-blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.32rem 0.5rem;
  display: flex;
  align-items: center;
  letter-spacing: 0.05em;
}
.plate__code {
  background: var(--paper);
  border: 1px solid var(--steel-line);
  border-left: none;
  color: var(--asphalt);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 0.32rem 0.65rem;
  display: flex;
  align-items: center;
}
.section--asphalt .plate__code {
  background: var(--asphalt-soft);
  border-color: #3a3f46;
  color: #f2f3f5;
}

/* stat tags built from the same plate motif */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 4vw, 3rem);
}
.stat {
  min-width: 8rem;
}
.stat__value {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 700;
  color: var(--signal-amber);
  line-height: 1;
}
.stat__label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #c7ccd3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--signal-amber);
  color: var(--asphalt);
}
.btn--primary:hover { background: #f2b31c; color: var(--asphalt); }
.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.btn--ghost:hover { border-color: #fff; color: #fff; }
.btn--outline {
  background: transparent;
  border-color: var(--asphalt);
  color: var(--asphalt);
}
.btn--outline:hover { background: var(--asphalt); color: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* -------------------------------------------------------------------------
   Cards / grids
   ------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(1.1rem, 2.4vw, 1.75rem);
}
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grid--contact { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }

.card {
  background: var(--paper);
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: 0.5rem; }
.card p { margin-bottom: 0; font-size: 0.95rem; }

.card--dark {
  background: var(--asphalt-soft);
  border-color: #3a3f46;
}
.card--dark h3, .card--dark strong { color: #fff; }
.card--dark p { color: #c7ccd3; }

/* client badges (mission page) */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--asphalt);
}

/* -------------------------------------------------------------------------
   Timeline (chi siamo) — a real chronological sequence
   ------------------------------------------------------------------------- */
.timeline {
  border-left: 2px solid var(--steel-line);
  margin-left: 0.4rem;
  padding-left: clamp(1.25rem, 3vw, 2.25rem);
}
.timeline__item {
  position: relative;
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(1.25rem, 3vw, 2.25rem) - 6px);
  top: 0.35rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--signal-amber);
  box-shadow: 0 0 0 4px var(--cloud);
}
.timeline__year {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--targa-blue);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.3rem;
}

/* -------------------------------------------------------------------------
   Contact cards
   ------------------------------------------------------------------------- */
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 2rem 2.1rem;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  background: var(--paper);
}
.contact-card__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--steel);
}
.contact-card__value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--asphalt);
  text-decoration: none;
  overflow-wrap: break-word;
}
.contact-card__value:hover { color: var(--targa-blue); }

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--asphalt);
  color: #fff;
  overflow: hidden;
  padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(3.5rem, 8vw, 6rem);
}
.hero__lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    100deg,
    transparent 0,
    transparent 78px,
    rgba(255, 255, 255, 0.05) 78px,
    rgba(255, 255, 255, 0.05) 82px
  );
  animation: hero-drift 26s linear infinite;
}
@keyframes hero-drift {
  from { background-position-x: 0; }
  to { background-position-x: -1600px; }
}
.hero__content { position: relative; max-width: 60rem; }
.hero h1, .hero h2, .hero h3 { color: #fff; }
.hero__logo {
  display: block;
  height: clamp(4.5rem, 11vw, 8rem);
  width: auto;
  margin-bottom: 1.75rem;
}
.hero p.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: #c7ccd3;
  max-width: 48rem;
}

/* -------------------------------------------------------------------------
   Page hero (interior pages — shorter, no stat row)
   ------------------------------------------------------------------------- */
.page-hero {
  background: var(--asphalt);
  color: #fff;
  padding-block: clamp(3.5rem, 9vw, 5.5rem) clamp(2.5rem, 6vw, 3.5rem);
}
.page-hero h1, .page-hero h2, .page-hero h3 { color: #fff; }
.page-hero p { color: #c7ccd3; max-width: 38rem; }

/* -------------------------------------------------------------------------
   Map / address
   ------------------------------------------------------------------------- */
.map-frame {
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.map-frame iframe { width: 100%; height: 380px; border: 0; display: block; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--asphalt);
  color: #9aa1a9;
  padding-block: 2.5rem;
  font-size: 0.85rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: #c7ccd3; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.footer-link-button {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #c7ccd3;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-link-button:hover { color: #fff; }

/* -------------------------------------------------------------------------
   Cookie consent banner
   ------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  background: var(--asphalt);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.25rem var(--gutter);
  transform: translateY(110%);
  transition: transform 0.25s ease;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}
.cookie-banner--visible { transform: translateY(0); }
.cookie-banner__row {
  max-width: 1180px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.cookie-banner p {
  color: #c7ccd3;
  margin: 0;
  max-width: 42rem;
  font-size: 0.88rem;
}
.cookie-banner a { color: #fff; }
.cookie-banner__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   Consent-gated embed placeholder (Google Maps)
   ------------------------------------------------------------------------- */
.map-placeholder {
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
  text-align: center;
  background: var(--cloud);
}
.map-placeholder p { max-width: 26rem; margin-inline: auto 1.25rem; }

/* -------------------------------------------------------------------------
   Legal pages
   ------------------------------------------------------------------------- */
.legal-body h2 { margin-top: 2.25rem; font-size: 1.3rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body ul { color: var(--steel); padding-left: 1.25rem; }
.legal-body li { margin-bottom: 0.5rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--steel-line);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--steel);
  width: 40%;
  background: var(--cloud);
}
.data-placeholder {
  color: var(--targa-blue-dark);
  background: #fdf3d9;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* -------------------------------------------------------------------------
   Login (Area riservata)
   ------------------------------------------------------------------------- */
.login-card {
  max-width: 30rem;
  margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

.login-tabs__radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.login-tabs__nav {
  display: flex;
  gap: 1.75rem;
  margin-bottom: 1.85rem;
  border-bottom: 1px solid var(--steel-line);
}

.login-tabs__label {
  cursor: pointer;
  padding: 0 0 0.85rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  font-weight: 500;
  color: var(--steel);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

#mode-password:checked ~ .login-tabs__nav .login-tabs__label--password,
#mode-code:checked ~ .login-tabs__nav .login-tabs__label--code {
  color: var(--asphalt);
  border-bottom-color: var(--targa-blue);
}

.login-panel { display: none; }
#mode-password:checked ~ .login-panel--password { display: block; }
#mode-code:checked ~ .login-panel--code { display: block; }

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--steel);
  margin-bottom: 0.45rem;
}
.field input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--steel-line);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--asphalt);
  background: var(--paper);
}
.field input:focus-visible {
  outline: none;
  border-color: var(--targa-blue);
  box-shadow: 0 0 0 3px rgba(12, 60, 135, 0.14);
}
.field input.field__code {
  font-family: var(--font-mono);
  letter-spacing: 0.5em;
  text-align: center;
  font-size: 1.1rem;
}
.field small { display: block; margin-top: 0.5rem; font-size: 0.8rem; color: var(--steel); }

.login-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.1rem;
  font-size: 0.85rem;
}

.form-alert {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.form-alert--error {
  background: #fdecea;
  border: 1px solid #f3c2bd;
  color: #8a2a20;
}
.form-alert--info {
  background: var(--cloud);
  border: 1px solid var(--steel-line);
  color: var(--asphalt);
}
.form-alert--success {
  background: #e8f3ec;
  border: 1px solid #b9dcc6;
  color: #1e5631;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* -------------------------------------------------------------------------
   Responsive helpers
   ------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .stat-row { gap: 1.5rem; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}

/* -------------------------------------------------------------------------
   Area riservata — dashboard shell (usata solo da DashboardMainLayout/Dashboard,
   non condivisa con il resto del sito)
   ------------------------------------------------------------------------- */
.dashboard {
  display: flex;
  min-height: 100vh;
  background: var(--cloud);
}
.dashboard__sidebar {
  width: 15rem;
  flex-shrink: 0;
  background: var(--asphalt);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
}
.dashboard__brand { display: block; margin-bottom: 2rem; }
.dashboard__brand img { height: 2.2rem; width: auto; }
.dashboard__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.dashboard__nav-link {
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  color: #c7ccd3;
  text-decoration: none;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}
.dashboard__nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.dashboard__nav-link--sub { padding-left: 1.6rem; font-size: 0.76rem; }
.dashboard__nav-sub { display: flex; flex-direction: column; }
.dashboard__nav-status {
  padding: 0.65rem 0.85rem;
  color: #8f97a1;
  font-size: 0.78rem;
  font-style: italic;
}
.dashboard__nav-status--error { color: var(--signal-amber); }
.dashboard__nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.dashboard__nav-caret {
  transition: transform 0.15s ease;
  font-size: 0.9rem;
}
.dashboard__nav-caret--open { transform: rotate(90deg); }
.dashboard__nav-icon { margin-right: 0.55rem; font-size: 0.95em; width: 1.1em; text-align: center; }
.dashboard__username { display: block; margin-bottom: 0.6rem; font-size: 0.85rem; color: #c7ccd3; }
.dashboard__logout {
  align-self: flex-start;
  margin-bottom: 2rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.dashboard__logout:hover { border-color: #fff; }
.dashboard__content { flex: 1; padding: clamp(1.5rem, 4vw, 3rem); }

@media (max-width: 720px) {
  .dashboard { flex-direction: column; }
  .dashboard__sidebar { width: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 1rem; }
  .dashboard__nav { flex-direction: row; flex-wrap: wrap; }
}

/* -------------------------------------------------------------------------
   Dashboard — pagine di gestione (es. Listini). Usa i token del design
   system esistente, non condiviso col resto del sito.
   ------------------------------------------------------------------------- */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.dash-header h1 { margin-bottom: 0.3rem; }
.dash-header p { margin: 0; }

.dash-panel {
  background: var(--paper);
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  max-width: 32rem;
}
.dash-panel h2 { font-size: 1.05rem; margin-bottom: 1rem; }

.field--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--asphalt);
  cursor: pointer;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--steel-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.dash-table th {
  text-align: left;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--steel);
  background: var(--cloud);
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--steel-line);
}
.dash-table td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--steel-line);
  vertical-align: middle;
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.dash-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.dash-pill--active { background: #e8f3ec; color: #1e5631; }
.dash-pill--inactive { background: var(--cloud); color: var(--steel); }

.btn--small { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
.btn--danger { border-color: #c0392b; color: #c0392b; }
.btn--danger:hover { background: #c0392b; color: #fff; }
