/* ==========================================================================
   GTL Precision — design system
   Industrial / dark / technical. Plain, readable CSS.

   Structure:
     1. Design tokens (colors, fonts, spacing) — change the look here
     2. Base / reset
     3. Layout helpers (.container)
     4. Header + navigation
     5. Buttons
     6. Hero
     7. Sections, cards, steps, CTA
     8. Footer
     9. Responsive (mobile menu)
    10. Motion (entrance + scroll reveal + micro-interactions)
   ========================================================================== */

/* 1. DESIGN TOKENS --------------------------------------------------------- */
:root {
  /* Colors */
  --bg:         #0f1216;   /* page background — deep charcoal */
  --bg-elev:    #161b22;   /* raised surfaces (header, cards) */
  --bg-elev-2:  #1b212a;   /* alternating section background */
  --line:       #272e38;   /* borders / hairlines */
  --text:       #e6e9ee;   /* main text — soft silver */
  --muted:      #98a3b1;   /* secondary text */
  --accent:     #3d8bff;   /* electric blue — the precision accent */
  --accent-2:   #6fa8ff;   /* lighter accent for hovers */
  --accent-dim: rgba(61, 139, 255, 0.12);

  /* Fonts */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  /* Spacing + shape */
  --radius: 10px;
  --container: 1120px;

  /* Motion. One easing curve for everything, so the whole site moves the same
     way: quick at the start, gently settling at the end. */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --speed: 0.45s;
}

/* 2. BASE / RESET ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; font-weight: 700; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--text); }

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

.muted { color: var(--muted); }

/* Visible keyboard focus for accessibility. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link — hidden until a keyboard user tabs to it. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* 3. LAYOUT HELPERS -------------------------------------------------------- */
.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}
.narrow { max-width: 640px; }

/* A little uppercase label used above headings. */
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

/* 4. HEADER + NAVIGATION --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 18, 22, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
/* main.js adds .is-scrolled once the page is scrolled: the bar becomes more
   solid and casts a shadow, so it separates from the content underneath. */
.site-header.is-scrolled {
  background: rgba(15, 18, 22, 0.96);
  box-shadow: 0 10px 30px -20px #000;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.brand__mark { color: var(--accent); font-size: 1.2rem; }
.brand__logo { height: 40px; width: auto; display: block; }
.brand:hover { color: var(--text); }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav__link {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.15s ease, background 0.2s ease;
}
.site-nav__link:hover { color: var(--text); background: var(--bg-elev); }
.site-nav__link.is-active { color: var(--text); background: var(--accent-dim); }

/* IT | EN language switch, last item of the navigation. */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.5rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.lang-switch__on,
.lang-switch__off {
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
}
.lang-switch__on { color: var(--text); background: var(--accent-dim); }
.lang-switch__off { color: var(--muted); transition: color 0.15s ease, background 0.2s ease; }
.lang-switch__off:hover { color: var(--text); background: var(--bg-elev); }

/* Hamburger button — hidden on desktop, shown on mobile via the media query. */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 8px;
  cursor: pointer;
}
.nav-toggle__bar {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease-out), opacity 0.15s ease;
}
/* Menu open: the three bars fold into an X. aria-expanded is already set by
   main.js for screen readers, so we reuse it here instead of a second class. */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 4b. CLOSURE NOTICE ------------------------------------------------------- */
/* Strip under the header: shown only while a closure is on or coming up. */
.notice {
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.notice__inner {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.7rem 0;
}
.notice__tag {
  flex: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}
.notice__text { margin: 0; color: var(--muted); }
.notice__text strong { color: var(--text); }

/* Closed right now: amber, so it stands out from a merely planned closure. */
.notice--now { background: rgba(233, 178, 60, 0.1); border-bottom-color: rgba(233, 178, 60, 0.35); }
.notice--now .notice__tag { color: #e9b23c; border-color: rgba(233, 178, 60, 0.5); }

/* 5. BUTTONS --------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s ease,
              background 0.15s ease, border-color 0.15s ease;
}
/* Hover lifts the button a little; clicking pushes it back down. */
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); transition-duration: 0.05s; }
.btn:disabled, .btn[disabled] { transform: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }

/* 6. HERO ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
/* Faint blueprint grid + a soft glow behind the hero text. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at 30% 0%, #000 40%, transparent 100%);
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero__title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.hero__lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 0.4rem;
}
.hero__lead--it { font-style: italic; opacity: 0.8; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.8rem 0 2.5rem;
}

/* Technical spec strip under the hero. */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec-strip li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  background: var(--bg-elev);
}
.spec-strip__value { font-family: var(--mono); font-size: 1rem; color: var(--text); }
.spec-strip__label { font-size: 0.8rem; color: var(--muted); }

/* 7. SECTIONS / CARDS / STEPS / CTA --------------------------------------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section--alt { background: var(--bg-elev-2); border-block: 1px solid var(--line); }
.section__title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0 0 0.5rem; }
.section__intro { margin: 0 0 2rem; }
.lead { font-size: 1.15rem; }

/* Card grid (What we do). */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.9);
}
.card__title { margin: 0 0 0.5rem; font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0 0 1rem; }
.card__link { font-family: var(--mono); font-size: 0.9rem; }

/* Steps (How it works). */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.step__num {
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--accent);
}
.step__title { margin: 0.3rem 0 0.4rem; font-size: 1.15rem; }
.step p { margin: 0; }

/* Call-to-action band. */
.cta { padding: clamp(3rem, 7vw, 5rem) 0; text-align: center; }
.cta__inner { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.cta__title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0; }
.cta .btn { margin-top: 1.2rem; }

/* 8. FOOTER ---------------------------------------------------------------- */
.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  padding: 2.75rem 0 2.25rem;
  margin-top: 2rem;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.3fr;
  gap: 1.75rem 2rem;
  align-items: start;
}
.site-footer__logo { height: 46px; width: auto; display: block; margin-bottom: 0.7rem; }
.site-footer__brand p { margin: 0; max-width: 32ch; }
.site-footer__heading {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 0.7rem;
}
.site-footer__col ul { list-style: none; margin: 0; padding: 0; }
.site-footer__col li { margin-bottom: 0.4rem; }
.site-footer__col a { color: var(--muted); font-size: 0.95rem; }
.site-footer__col a:hover { color: var(--text); }
.site-footer__meta {
  grid-column: 1 / -1;
  margin: 0.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

/* 8b. CAPABILITIES PAGE ---------------------------------------------------- */
/* Smaller hero for inner pages. */
.hero--sub { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); }

/* Machine spec panel. */
.spec-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec-panel li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
  background: var(--bg-elev);
}
.spec-panel__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.spec-panel__value { font-size: 1.15rem; font-weight: 600; }
.spec-panel__note { font-size: 0.85rem; color: var(--muted); }

/* Filter tabs. */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filter-tab {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-elev);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.filter-tab:hover { color: var(--text); border-color: var(--accent); }
.filter-tab.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }

/* Materials grid + cards. */
.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}
.material-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
}
.material-card[hidden] { display: none; }   /* toggled by the filter tabs */
.material-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.material-card__name { margin: 0; font-size: 1.15rem; }
.material-card p { margin: 0; }

.badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
}

/* Simple notes list ("Good to know"). */
.notes-list { margin: 0 0 1.5rem; padding-left: 1.2rem; }
.notes-list li { margin-bottom: 0.5rem; color: var(--muted); }
.notes-list strong { color: var(--text); }

/* 8c. STOCK BADGES · CONTACT · BUTTON ROW ---------------------------------- */
/* Availability badges (Capabilities page). */
.badge--stock { color: #58d68a; background: rgba(88, 214, 138, 0.14); }
.badge--order { color: #e9b23c; background: rgba(233, 178, 60, 0.14); }

.stock-legend { margin-top: 1.5rem; line-height: 2.1; }
.stock-legend .badge { margin: 0 0.35rem 0 0; }

/* Contact page cards. */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.3rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}
a.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.9);
}
.contact-card--static { cursor: default; }
.contact-card__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.contact-card__value { color: var(--text); font-size: 1.05rem; word-break: break-word; }

.contact-extra { margin-top: 2rem; }
.privacy-note {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  font-size: 0.9rem;
  max-width: 60ch;
}

/* A row of buttons side by side. */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.5rem; }

/* 8d. FORMS (quote page) --------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.form__row { display: flex; flex-direction: column; gap: 0.4rem; }
.form__grid { display: grid; grid-template-columns: 1fr 160px; gap: 1.25rem; }
.form__label { font-size: 0.9rem; font-weight: 600; }
.form__input {
  font: inherit;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  width: 100%;
}
.form__input::placeholder { color: var(--muted); opacity: 0.7; }
.form__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form__input.is-error { border-color: #e5484d; }
textarea.form__input { resize: vertical; min-height: 120px; }
.form__hint { font-size: 0.8rem; color: var(--muted); }
.form__error { font-size: 0.82rem; color: #ff7a7d; }
.form__check { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; color: var(--muted); font-size: 0.95rem; }
.form__check input { margin-top: 0.2rem; flex: none; }

/* Closure warning above the quote form. */
.closure-warn {
  margin: 0 0 1.75rem;
  padding: 0.9rem 1.1rem;
  background: rgba(233, 178, 60, 0.1);
  border: 1px solid rgba(233, 178, 60, 0.35);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
}
.closure-warn strong { color: var(--text); }

/* Availability note under the material picker on the quote form. */
.stock-note { margin: 0.15rem 0 0; font-size: 0.88rem; color: var(--muted); }
.stock-note .badge { margin-right: 0.35rem; }
.stock-note [hidden] { display: none; }

/* Honeypot field: visually hidden, off-screen (only bots see/fill it). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 8e. ADMIN ---------------------------------------------------------------- */
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.admin-bar__inner { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.admin-bar__tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.admin-bar__nav { display: flex; align-items: center; gap: 0.4rem 1.1rem; margin-left: auto; flex-wrap: wrap; }
.admin-bar__nav a { color: var(--muted); font-size: 0.95rem; }
.admin-bar__nav a:hover { color: var(--text); }
.admin-bar__logout { margin: 0; }
.btn--sm { padding: 0.4rem 0.85rem; font-size: 0.88rem; }

.admin-foot { border-top: 1px solid var(--line); padding: 1.5rem 0; margin-top: 2rem; }

/* Dashboard stat cards reuse .card; this is the big number. */
.card__stat { font-size: 2.2rem; font-weight: 700; margin: 0 0 0.15rem; }

/* Login screen. */
.login { min-height: 82vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login__card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.login__logo { height: 54px; width: auto; display: block; margin: 0 auto 1rem; }
.login__title { font-size: 1.4rem; margin: 0 0 1.25rem; }
.login .form { text-align: left; }
.login__back { display: inline-block; margin-top: 1.25rem; font-size: 0.9rem; color: var(--muted); }

/* Admin quotes table (scrolls sideways on small screens). */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 720px; }
.admin-table th,
.admin-table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg-elev-2);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .nowrap { white-space: nowrap; color: var(--muted); }
.admin-table .wrap { max-width: 340px; }

/* Admin: page head with an action button; table actions; danger button. */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.inline { display: inline; }
.btn--danger { background: transparent; color: #ff7a7d; border-color: var(--line); margin-left: 0.4rem; }
.btn--danger:hover { border-color: #e5484d; color: #ff9a9c; }

/* Thickness line on the public material cards. */
.material-card__thick { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); margin: 0.5rem 0 0; }

/* 8f. ORDERS / TRACKING ---------------------------------------------------- */
.mt-lg { margin-top: 2.5rem; }
code {
  font-family: var(--mono);
  background: var(--bg-elev-2);
  padding: 0.08rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
}

/* Payment box (order tracking page). */
.pay-box {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}
.pay-box__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; }
.pay-box__label { color: var(--muted); font-size: 0.9rem; }
.pay-box__amount { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; }
.pay-box__how { margin: 1rem 0 0.5rem; }
.pay-box__methods { margin: 0; padding-left: 1.2rem; }
.pay-box__methods li { margin-bottom: 0.3rem; }
/* "Put this code in the payment reference" — set apart so it isn't missed. */
.pay-box__causale {
  margin: 1rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.pay-box__causale strong { color: var(--accent); font-family: var(--mono); }
/* "I check payments by hand" — reassurance, so it sits quieter than the rest. */
.pay-box__manual { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }

/* Progress tracker (vertical, dots + connecting line). */
.progress { list-style: none; margin: 0 0 2rem; padding: 0; }
.progress__step { position: relative; padding: 0 0 1.2rem 2rem; color: var(--muted); }
.progress__step::before {
  content: '';
  position: absolute;
  left: 7px; top: 0.5rem;
  width: 2px; height: 100%;
  background: var(--line);
}
.progress__step:last-child { padding-bottom: 0; }
.progress__step:last-child::before { display: none; }
.progress__dot {
  position: absolute;
  left: 0; top: 0.2rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--bg);
  z-index: 1;
}
.progress__step.is-done { color: var(--text); }
.progress__step.is-done .progress__dot { border-color: var(--accent); background: var(--accent); }

/* Checkbox list (admin order stages). */
.check-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; border: 0; }
.form__check--box { margin-top: 0.35rem; }

/* 8g. PHOTOS / SHIPPING / DANGER ZONE -------------------------------------- */
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1.25rem; }

/* Read-only key/value list (preventivo detail). */
.data-list { display: grid; gap: 0.5rem; margin: 0.5rem 0 0; }
.data-list > div { display: flex; gap: 0.75rem; align-items: baseline; }
.data-list__k { color: var(--muted); flex: 0 0 120px; }

/* Description shown as a read-only block, preserving line breaks. */
.desc-box {
  white-space: pre-wrap;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin: 0.4rem 0 0;
}

/* Disabled buttons (e.g. "Crea ordine" before payment). */
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Admin: the optional English half of a form, boxed off from the Italian one. */
.lang-box {
  margin: 0;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.lang-box__legend {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 0 0.5rem;
}
/* The flex gap already spaces things out; kill the paragraphs' own margins. */
.lang-box > p { margin: 0; }

/* Machine form: 3-up number inputs (X/Y/Z) + a save confirmation. */
.form__grid--3 { grid-template-columns: repeat(3, 1fr); }
.form__ok { color: #58d68a; font-weight: 600; margin: 0 0 1.25rem; }

/* Short single-sentence hero leads: let them use the full width so they stay
   on one line on wide screens (they still wrap on narrow screens). */
.hero__lead--1line { max-width: none; }

/* Admin nav divider between order-management and site-management links. */
.admin-bar__sep { width: 1px; align-self: stretch; min-height: 1.1rem; background: var(--line); }

/* "Chi sono": the whole block is written by the admin, so the spacing has to
   work for any mix of paragraphs, headings and lists. */
.about-text > :first-child { margin-top: 0; }
.about-text .section__title { margin-top: 2.2rem; }

/* Dashboard group labels + admin sub-headings + gallery category headings. */
.admin-group-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 2.2rem 0 1rem;
}
.admin-group-title:first-of-type { margin-top: 0.5rem; }
.section__subtitle { font-size: 1.05rem; margin: 1.6rem 0 0.7rem; }
.gallery__cat { font-size: 1.15rem; margin: 1.6rem 0 0.7rem; }

/* File picker. */
.form__file { color: var(--muted); font-size: 0.9rem; }
.form__file::file-selector-button {
  font: inherit;
  margin-right: 0.8rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}
.form__file::file-selector-button:hover { border-color: var(--accent); }

/* Admin photo thumbnails, each with a delete button in the corner. */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.8rem; margin: 0.5rem 0 0; }
.photo { position: relative; margin: 0; }
.photo img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.photo__del { position: absolute; top: 6px; right: 6px; margin: 0; }
.photo__del-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 18, 22, 0.82);
  color: #ff9a9c;
  font-size: 1.15rem; line-height: 1;
  cursor: pointer;
}
.photo__del-btn:hover { background: #e5484d; color: #fff; }

/* Customer-facing photo gallery. Hovering zooms the photo inside its frame:
   the frame clips the overflow, so only the picture moves. */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; margin: 0.5rem 0 2rem; }
.gallery__item {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.gallery__item:hover { border-color: var(--accent); }
.gallery__item img {
  width: 100%; height: 140px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out);
}
.gallery__item:hover img { transform: scale(1.06); }

/* Shipping / tracking box on the customer page. */
.track-box { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 0 0 2rem; }
.track-box__label { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.track-box__num { font-family: var(--mono); margin: 0 0 0.8rem; }

/* Danger zone (delete order). */
.danger-zone { border: 1px solid rgba(229, 72, 77, 0.4); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.danger-zone .section__title { margin-top: 0; }

/* Completed orders are dimmed in the admin table. */
.admin-table tr.is-complete td { opacity: 0.6; }

/* 9. RESPONSIVE (mobile menu) ---------------------------------------------- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  /* Menu is hidden by default on mobile; main.js toggles ".is-open". */
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 66px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 1.25rem 1rem;
  }
  .site-nav.is-open { display: block; animation: nav-drop 0.22s var(--ease-out); }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .site-nav__link { padding: 0.7rem 0.8rem; }

  /* Language switch sits under the menu items, not beside them. */
  .lang-switch {
    margin: 0.4rem 0 0;
    padding: 0.6rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .spec-strip { grid-template-columns: repeat(2, 1fr); }
  .site-footer__inner { grid-template-columns: 1fr; }
  .form__grid { grid-template-columns: 1fr; }
}

/* 10. MOTION ---------------------------------------------------------------
   Three kinds of movement, all small on purpose:
     a) the hero fades up as soon as the page opens;
     b) .reveal elements fade up the first time you scroll to them;
     c) a few micro-interactions (progress dots, form focus).
   Everything is switched off further down for visitors who asked their system
   to reduce motion.
   ------------------------------------------------------------------------- */

/* The one movement used everywhere: come up a little while fading in. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes dot-pop {
  0%   { transform: scale(0.4); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* a) HERO ENTRANCE — each line starts a beat after the one above it.
   "backwards" makes the element already invisible during the delay, so nothing
   flashes before its turn. */
.hero__inner > * { animation: rise-in 0.6s var(--ease-out) backwards; }
.hero__inner > *:nth-child(1) { animation-delay: 0.05s; }
.hero__inner > *:nth-child(2) { animation-delay: 0.13s; }
.hero__inner > *:nth-child(3) { animation-delay: 0.21s; }
.hero__inner > *:nth-child(4) { animation-delay: 0.29s; }
.hero__inner > *:nth-child(5) { animation-delay: 0.37s; }

/* The blueprint grid behind the hero fades in on its own, a touch slower. */
.hero::before { animation: fade-in 1.2s ease backwards 0.1s; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* b) SCROLL REVEAL — only when JavaScript is running (see the <script> in
   header.ejs). Without it these rules never apply and everything is visible
   from the start. main.js adds .is-visible when the element scrolls into view,
   and --reveal-delay staggers the items of a same row.
   Once the animation is over main.js drops both classes, so the element goes
   back to being a completely normal element — otherwise this rule would keep
   overriding the hover effects of cards and buttons. */
.js .reveal { opacity: 0; }
.js .reveal.is-visible {
  /* written property by property (instead of the "animation:" shortcut) so the
     delay can come from a variable without any ambiguity */
  animation-name: rise-in;
  animation-duration: var(--speed);
  animation-timing-function: var(--ease-out);
  animation-delay: var(--reveal-delay, 0s);
  animation-fill-mode: both; /* stay hidden during the delay, stay put at the end */
}

/* c) MICRO-INTERACTIONS */
/* Order tracking: the dots of the completed steps pop in one after the other.
   The first delay leaves room for the list itself to fade in. */
.progress__step.is-done .progress__dot {
  animation-name: dot-pop;
  animation-duration: 0.4s;
  animation-timing-function: var(--ease-out);
  animation-fill-mode: backwards;
  animation-delay: 0.2s;
}
.progress__step:nth-child(2).is-done .progress__dot { animation-delay: 0.28s; }
.progress__step:nth-child(3).is-done .progress__dot { animation-delay: 0.36s; }
.progress__step:nth-child(4).is-done .progress__dot { animation-delay: 0.44s; }
.progress__step:nth-child(5).is-done .progress__dot { animation-delay: 0.52s; }

/* The line joining two completed steps turns blue, so the finished part of the
   tracker reads as one continuous bar. ":has(+ …)" = "only if the step right
   after this one is also done", otherwise the line would run into a step that
   hasn't happened yet. */
.progress__step.is-done:has(+ .progress__step.is-done)::before { background: var(--accent); }

/* Form fields: the focus ring grows in instead of snapping on. */
.form__input { transition: border-color 0.15s ease, box-shadow 0.2s ease; }

/* REDUCED MOTION — respect the system setting: no movement, nothing hidden. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
