/* Toolopoli — stile "Morbido e amichevole"
   Palette pastello, angoli arrotondati, ogni tool ha la sua tinta. */

:root {
  --sfondo: #fff8f3;
  --carta: #ffffff;
  --inchiostro: #33302e;
  --muto: #8a827b;
  --linea: #f0e4da;
  --accento: #ff8a5c;
  --accento-scuro: #d95f2b;

  /* tinte pastello dei tools */
  --pesca-bg: #ffe8dc;   --pesca: #d95f2b;
  --verde-bg: #e2f3e8;   --verde: #2f8a57;
  --blu-bg: #e5edff;     --blu: #4467d1;
  --rosa-bg: #fdeef3;    --rosa: #c9497e;
  --giallo-bg: #fff4d6;  --giallo: #b07d1a;
  --lilla-bg: #eae4ff;   --lilla: #6a4fc9;

  --raggio: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--sfondo);
  color: var(--inchiostro);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.6;
}

.contenitore { max-width: 62rem; margin: 0 auto; padding: 0 1.1rem; }

a { color: var(--accento-scuro); }

/* ---------- header ---------- */
.sito-testa { padding: 1rem 0; }
.sito-testa .riga { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: 1.15rem; color: var(--inchiostro); text-decoration: none;
}
.logo-punto { width: 22px; height: 22px; border-radius: 50%; background: var(--accento); flex: none; }
.sito-testa nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.sito-testa nav a { color: var(--muto); text-decoration: none; font-size: .92rem; font-weight: 600; }
.sito-testa nav a:hover { color: var(--accento-scuro); }

/* ---------- hero homepage ---------- */
.hero { text-align: center; padding: 2.8rem 0 2rem; }
.hero h1 {
  font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1.15;
  margin: 0 0 .7rem; text-wrap: balance;
}
.hero p { color: var(--muto); max-width: 34rem; margin: 0 auto; font-size: 1.02rem; }

.cerca {
  display: block; width: 100%; max-width: 26rem; margin: 1.6rem auto 0;
  padding: .85rem 1.3rem; font-size: 1rem; color: var(--inchiostro);
  background: var(--carta); border: 2px solid var(--pesca-bg); border-radius: 99px;
  outline: none;
}
.cerca:focus { border-color: var(--accento); }
.cerca::placeholder { color: #b3a89f; }

/* ---------- griglia tools ---------- */
.griglia {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem; padding: 1.6rem 0 2.5rem;
}
.tool-card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.2rem 1.2rem 1.3rem; border-radius: var(--raggio);
  text-decoration: none; color: var(--inchiostro);
  border: 2px solid transparent;
  transition: transform .12s ease, border-color .12s ease;
}
.tool-card:hover { transform: translateY(-3px); border-color: rgba(0,0,0,.08); }
.tool-card svg { width: 26px; height: 26px; }
.tool-card .nome { font-weight: 700; font-size: 1.02rem; }
.tool-card .desc { font-size: .85rem; color: #78716c; }
.tool-card.nascosta { display: none; }

.t-pesca  { background: var(--pesca-bg); }  .t-pesca svg  { color: var(--pesca); }
.t-verde  { background: var(--verde-bg); }  .t-verde svg  { color: var(--verde); }
.t-blu    { background: var(--blu-bg); }    .t-blu svg    { color: var(--blu); }
.t-rosa   { background: var(--rosa-bg); }   .t-rosa svg   { color: var(--rosa); }
.t-giallo { background: var(--giallo-bg); } .t-giallo svg { color: var(--giallo); }
.t-lilla  { background: var(--lilla-bg); }  .t-lilla svg  { color: var(--lilla); }

/* ---------- pagina tool ---------- */
.pagina-tool { padding: 1.6rem 0 2rem; }
.pagina-tool h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 .4rem; text-wrap: balance; }
.sottotitolo { color: var(--muto); margin: 0 0 1.6rem; max-width: 40rem; }

.scatola {
  background: var(--carta); border-radius: var(--raggio);
  padding: 1.5rem; border: 2px solid var(--linea);
  max-width: 40rem;
}
.scatola + .scatola { margin-top: 1rem; }

.campo { margin-bottom: 1rem; }
.campo label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.campo input[type="number"], .campo input[type="text"], .campo select, .campo textarea {
  width: 100%; padding: .65rem .8rem; font-size: .95rem; font-family: inherit;
  border: 2px solid var(--linea); border-radius: 12px; color: var(--inchiostro);
  background: #fffdfb; outline: none;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--accento); }
.campo input[type="range"] { width: 100%; accent-color: var(--accento); }
.campo textarea { min-height: 11rem; resize: vertical; }

.bottone {
  display: inline-block; padding: .8rem 1.6rem; font-size: 1rem; font-weight: 700;
  font-family: inherit; color: #fff; background: var(--accento);
  border: 0; border-radius: 99px; cursor: pointer; text-decoration: none;
}
.bottone:hover { background: var(--accento-scuro); }
.bottone:disabled { opacity: .5; cursor: default; }
.bottone.secondario { background: var(--pesca-bg); color: var(--accento-scuro); }

/* zona caricamento file */
.zona-file {
  border: 2px dashed var(--accento); border-radius: var(--raggio);
  background: var(--pesca-bg); padding: 2.2rem 1.2rem; text-align: center;
  cursor: pointer; color: var(--accento-scuro); font-weight: 600;
}
.zona-file.trascina { background: #ffdcc8; }
.zona-file p { margin: .3rem 0 0; font-weight: 400; font-size: .85rem; color: var(--muto); }

.risultato { margin-top: 1.2rem; display: none; }
.risultato.visibile { display: block; }
.risultato img { max-width: 100%; border-radius: 12px; border: 2px solid var(--linea); }
.nota-risultato { font-size: .9rem; color: var(--muto); margin: .6rem 0; }
.nota-risultato strong { color: var(--verde); }

.privacy-nota {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; color: var(--muto); margin-top: 1rem;
}

/* statistiche (contatore parole ecc.) */
.statistiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .8rem; margin-top: 1rem; }
.stat { border-radius: 14px; padding: .9rem; text-align: center; }
.stat .numero { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; display: block; }
.stat .etichetta { font-size: .78rem; color: var(--muto); }

/* ---------- sezione descrittiva SEO ---------- */
.spiegazione { max-width: 40rem; padding: 1.8rem 0 0; }
.spiegazione h2 { font-size: 1.25rem; margin: 1.4rem 0 .5rem; }
.spiegazione p { color: #5f5852; margin: 0 0 .8rem; }

/* ---------- box affiliato ---------- */
.box-affiliato {
  max-width: 40rem; margin-top: 2.2rem;
  background: var(--giallo-bg); border-radius: var(--raggio); padding: 1.3rem 1.5rem;
}
.box-affiliato h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
.box-affiliato p { font-size: .9rem; color: #6b6157; margin: 0 0 .8rem; }
.aff-link { display: flex; flex-wrap: wrap; gap: .6rem; }
.aff-link a {
  background: #fff; border-radius: 99px; padding: .45rem 1rem;
  font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--accento-scuro);
  border: 1.5px solid #f3e3bd;
}
.aff-link a:hover { border-color: var(--accento); }

/* ---------- footer ---------- */
.sito-piede {
  margin-top: 3rem; padding: 2rem 0 2.5rem;
  background: var(--pesca-bg); border-radius: 28px 28px 0 0;
}
.sito-piede p { margin: 0 0 .5rem; font-size: .88rem; color: #6b6157; }
.sito-piede a { color: var(--accento-scuro); font-weight: 600; }
.disclaimer { font-size: .76rem !important; color: #9c8f83 !important; margin-top: 1rem !important; }

@media (prefers-reduced-motion: reduce) {
  .tool-card { transition: none; }
}

/* ---------- homepage per categorie ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.3rem; }
.chips a {
  background: var(--carta); border: 1.5px solid var(--pesca-bg); border-radius: 99px;
  padding: .4rem .95rem; font-size: .85rem; font-weight: 600;
  color: var(--accento-scuro); text-decoration: none;
}
.chips a:hover { border-color: var(--accento); }
.categoria { padding-top: 1.2rem; }
.titolo-categoria {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.3rem; margin: 1rem 0 .2rem; scroll-margin-top: 1rem;
}
.titolo-categoria svg { width: 24px; height: 24px; color: var(--accento); }
.titolo-categoria .conta { font-size: .8rem; font-weight: 600; color: var(--muto); }
.nessun-risultato { display: none; text-align: center; color: var(--muto); padding: 1.5rem 0; }
