/* =========================================================================
   AcquarioLab — Design System
   Palette sobria (neutri + bianco + grigio scuro), accent blu + verde acqua,
   forme arrotondate, ombre appena percettibili, molta aria bianca.
   ========================================================================= */

:root {
  /* Neutri caldi */
  --bg:          #FAF8F5;
  --bg-2:        #F4F0EA;
  --surface:     #FFFFFF;
  --ink:         #2B2A28;
  --ink-soft:    #565250;
  --muted:       #8C867E;
  --line:        #ECE7E0;
  --line-strong: #DED8CF;

  /* Accent acquatici: blu + verde acqua */
  --accent:        #15A39B; /* verde acqua / teal */
  --accent-strong: #0E7C77; /* teal profondo */
  --accent-soft:   #3FC4B4; /* acquamarina chiaro */
  --accent-tint:   #E5F4F2;
  --accent-tint-2: #CFE9E6;

  /* Blu di supporto (gradient hero, dettagli) */
  --blue:        #2E86C1;
  --blue-strong: #1F6699;
  --blue-tint:   #E7F1F8;

  /* Stati */
  --ok:        #4F7D5B;
  --ok-tint:   #EAF2EC;
  --warn:      #B9842A;
  --warn-tint: #FAF1DD;
  --danger:    #B5503C;
  --danger-tint:#FBE9E4;
  --info:      #46708C;
  --info-tint: #E8F0F4;

  /* Raggi */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --pill: 999px;

  /* Ombre subtili */
  --shadow-xs: 0 1px 2px rgba(43, 42, 40, 0.04);
  --shadow-sm: 0 2px 8px rgba(43, 42, 40, 0.05);
  --shadow:    0 8px 28px rgba(43, 42, 40, 0.07);

  /* Tipografia */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;

  /* Spaziature generose */
  --space-1: 0.5rem;
  --space-2: 0.875rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;

  --maxw: 1100px;
}

/* ----------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- tipografia */
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1rem; color: var(--ink-soft); }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }
small, .small { font-size: 0.85rem; }
.muted { color: var(--muted); }

/* ----------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-3); }
.section { padding-block: var(--space-6); }
.section--tight { padding-block: var(--space-5); }
.stack > * + * { margin-top: var(--space-3); }
.center { text-align: center; }
.grid { display: grid; gap: var(--space-3); }

/* ------------------------------------------------------------------- nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 245, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: var(--space-3); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; }
.nav-links { display: flex; gap: var(--space-1); align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--ink-soft); padding: 0.5rem 0.85rem; border-radius: var(--pill);
  font-size: 0.95rem; font-weight: 500; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--accent-tint); color: var(--accent-strong); text-decoration: none; }
.nav-links a.active { color: var(--accent-strong); background: var(--accent-tint); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0.45rem 0.6rem; cursor: pointer; color: var(--ink); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: var(--space-2); box-shadow: var(--shadow-sm);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.8rem 1rem; border-radius: var(--r-sm); }
}

/* ------------------------------------------------------------------ hero */
.hero {
  background:
    radial-gradient(120% 120% at 88% -10%, var(--accent-tint) 0%, rgba(229,244,242,0) 55%),
    radial-gradient(90% 90% at 5% 110%, var(--blue-tint) 0%, rgba(231,241,248,0) 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--line);
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent-tint); color: var(--accent-strong);
  padding: 0.35rem 0.85rem; border-radius: var(--pill);
  font-size: 0.85rem; font-weight: 600; margin-bottom: var(--space-3);
}
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: var(--space-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--space-5); align-items: center; }
.hero-media { display: block; }
.hero-media img { width: 100%; height: auto; border-radius: var(--r-xl); filter: drop-shadow(0 18px 40px rgba(14,124,119,0.16)); }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .hero-media { order: -1; max-width: 420px; margin: 0 auto; }
}

/* banner decorativo in cima ai tool */
.tool-banner { width: 100%; height: 110px; object-fit: cover; border-radius: var(--r-lg);
  margin-bottom: var(--space-3); box-shadow: var(--shadow-xs); }
@media (max-width: 600px) { .tool-banner { height: 80px; } }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1;
  padding: 0.9rem 1.5rem; border-radius: var(--pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--accent) 100%);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { box-shadow: var(--shadow); color: #fff; }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn--block { width: 100%; }
.btn--lg { padding: 1.05rem 1.8rem; font-size: 1.05rem; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}
.card--pad-sm { padding: var(--space-3); }

/* griglia degli strumenti */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.tool-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  color: inherit;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-tint-2); text-decoration: none; }
.tool-card .icon {
  width: 52px; height: 52px; border-radius: var(--r); display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent-strong);
}
.tool-card .icon svg { width: 28px; height: 28px; }
.tool-card h3 { margin: 0; }
.tool-card p { margin: 0; font-size: 0.97rem; }
.tool-card .more { margin-top: auto; color: var(--accent-strong); font-weight: 600; font-size: 0.95rem; }
.tool-card .tag { align-self: flex-start; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--accent); color: #fff; padding: 0.2rem 0.55rem; border-radius: var(--pill); }

/* --------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--space-3); }
.field > label { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.field .hint { font-size: 0.82rem; color: var(--muted); }
.input, .select, select, input[type="number"], input[type="text"] {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 0.7rem 0.85rem; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, select:focus, input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon {
  display: inline-flex; align-items: center; padding: 0 0.85rem;
  background: var(--bg-2); border: 1px solid var(--line-strong); border-left: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--muted); font-size: 0.9rem; white-space: nowrap;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }

/* segmented control / radio pill */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.segmented label {
  cursor: pointer; padding: 0.5rem 0.9rem; border-radius: var(--pill);
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); transition: all .15s;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + label,
.segmented label.checked { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-strong); }

/* ----------------------------------------------------------- result panel */
.result {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-4); box-shadow: var(--shadow-xs);
}
.result .big-number { font-size: clamp(2.4rem, 7vw, 3.4rem); font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.result .big-number .unit { font-size: 1rem; font-weight: 600; color: var(--muted); margin-left: 0.35rem; }
.metric-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.6rem 0; border-bottom: 1px dashed var(--line); }
.metric-row:last-child { border-bottom: none; }
.metric-row .label { color: var(--ink-soft); }
.metric-row .value { font-weight: 700; }

/* gauge a barra per lo stocking */
.gauge { height: 16px; border-radius: var(--pill); background: var(--bg-2); overflow: hidden; position: relative; }
.gauge > span { display: block; height: 100%; border-radius: var(--pill); transition: width .5s ease; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.gauge.is-ok > span    { background: linear-gradient(90deg, #7FB089, var(--ok)); }
.gauge.is-warn > span  { background: linear-gradient(90deg, #E0B45E, var(--warn)); }
.gauge.is-danger > span{ background: linear-gradient(90deg, #D88068, var(--danger)); }

/* ------------------------------------------------------------- callouts */
.note { border-radius: var(--r); padding: var(--space-3); border: 1px solid var(--line); background: var(--surface); }
.note + .note { margin-top: var(--space-2); }
.note--ok     { background: var(--ok-tint);     border-color: #CBE0D1; }
.note--warn   { background: var(--warn-tint);   border-color: #ECDDB6; }
.note--danger { background: var(--danger-tint); border-color: #ECC9C0; }
.note--info   { background: var(--info-tint);   border-color: #C7DBE6; }
.note strong { color: var(--ink); }
.note p:last-child { margin-bottom: 0; }
.note-title { font-weight: 700; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.45rem; }

/* badge / pill */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600;
  padding: 0.25rem 0.6rem; border-radius: var(--pill); background: var(--bg-2); color: var(--ink-soft); }
.badge--ok { background: var(--ok-tint); color: var(--ok); }
.badge--warn { background: var(--warn-tint); color: var(--warn); }
.badge--danger { background: var(--danger-tint); color: var(--danger); }

/* tabelle */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); }
.table th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: none; }

/* ------------------------------------------------- stock list / stepper */
.stock-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.stock-item:last-child { border-bottom: none; }
.stock-info { display: flex; flex-direction: column; line-height: 1.3; }
.stepper { display: inline-flex; align-items: center; gap: 0.25rem; background: var(--bg-2);
  border-radius: var(--pill); padding: 0.2rem; }
.stepper .step { width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface); color: var(--ink); font-size: 1.2rem; line-height: 1; box-shadow: var(--shadow-xs);
  display: grid; place-items: center; transition: background .12s, color .12s; }
.stepper .step:hover { background: var(--accent-tint); color: var(--accent-strong); }
.stepper .qty { min-width: 1.8rem; text-align: center; font-weight: 700; }

/* timeline del ciclo dell'azoto */
.steps { display: grid; gap: var(--space-2); counter-reset: step; }
.step-card { display: flex; gap: var(--space-3); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--space-3); box-shadow: var(--shadow-xs); }
.step-card .num { counter-increment: step; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent-strong); font-weight: 800; display: grid; place-items: center; }
.step-card .num::before { content: counter(step); }
.step-card h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.step-card p { margin: 0; font-size: 0.95rem; }

/* checklist stampabile */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0; border-bottom: 1px dashed var(--line); color: var(--ink-soft); }
.checklist li::before { content: ""; flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px;
  border: 2px solid var(--line-strong); border-radius: 6px; }
.checklist li:last-child { border-bottom: none; }

/* chip rimovibili (specie selezionate) */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--accent-tint);
  color: var(--accent-strong); border-radius: var(--pill); padding: 0.35rem 0.4rem 0.35rem 0.85rem;
  font-size: 0.9rem; font-weight: 600; }
.chip button { width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(14,124,119,0.12); color: var(--accent-strong); font-size: 1rem; line-height: 1;
  display: grid; place-items: center; }
.chip button:hover { background: var(--accent); color: #fff; }

/* fattori (chip) */
.factors { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.factor { background: var(--bg-2); border-radius: var(--r-sm); padding: 0.5rem 0.7rem; flex: 1 1 auto; min-width: 110px; }
.factor .k { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.factor .v { font-weight: 700; }

/* --------------------------------------------------------------- prose */
.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--space-4); }
.prose h3 { margin-top: var(--space-3); }
.prose ul, .prose ol { color: var(--ink-soft); padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }

/* breadcrumb */
.breadcrumb { font-size: 0.88rem; color: var(--muted); margin-bottom: var(--space-2); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-strong); }

/* ------------------------------------------------------------- footer */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: var(--space-5) 0 var(--space-4); margin-top: var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-4); }
.footer-grid h4 { font-size: 0.95rem; margin-bottom: var(--space-2); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a { color: var(--ink-soft); font-size: 0.95rem; }
.footer-bottom { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* utilità */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-0 { margin-bottom: 0; }
.wrap { flex-wrap: wrap; }

/* layout a due colonne per i tool (form + risultato) */
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
@media (max-width: 860px) { .tool-layout { grid-template-columns: 1fr; } }
.sticky-result { position: sticky; top: 88px; }
@media (max-width: 860px) { .sticky-result { position: static; } }

@media print {
  .site-header, .site-footer, .adsbygoogle, .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .card, .result, .note { box-shadow: none; border-color: #ccc; }
}
