/* 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: 26px; height: 26px; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2064%2064%22%3E%20%20%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23ff8a5c%22/%3E%20%20%3Cg%20fill%3D%22%23ffffff%22%3E%20%20%20%20%3Crect%20x%3D%2212%22%20y%3D%2227%22%20width%3D%2211%22%20height%3D%2223%22%20rx%3D%223%22/%3E%20%20%20%20%3Crect%20x%3D%2226.5%22%20y%3D%2215%22%20width%3D%2211%22%20height%3D%2235%22%20rx%3D%223%22/%3E%20%20%20%20%3Crect%20x%3D%2241%22%20y%3D%2233%22%20width%3D%2211%22%20height%3D%2217%22%20rx%3D%223%22/%3E%20%20%3C/g%3E%20%20%3Cg%20fill%3D%22%23ff8a5c%22%3E%20%20%20%20%3Crect%20x%3D%2230%22%20y%3D%2220%22%20width%3D%224%22%20height%3D%224%22%20rx%3D%221%22/%3E%20%20%20%20%3Crect%20x%3D%2230%22%20y%3D%2227%22%20width%3D%224%22%20height%3D%224%22%20rx%3D%221%22/%3E%20%20%3C/g%3E%20%20%3Ccircle%20cx%3D%2249%22%20cy%3D%2212%22%20r%3D%223.5%22%20fill%3D%22%23ffe8dc%22/%3E%3C/svg%3E") center/contain no-repeat; 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-top: 1.6rem; padding-bottom: 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; }

/* ---------- banner cambio lingua ---------- */
.banner-lingua {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: .9rem; z-index: 50;
  background: var(--carta); border: 2px solid var(--pesca-bg); border-radius: 99px;
  padding: .6rem .8rem .6rem 1.2rem; box-shadow: 0 8px 30px rgba(0,0,0,.15);
  font-size: .92rem; max-width: calc(100vw - 2rem);
}
.banner-lingua .bottone { padding: .5rem 1rem; font-size: .88rem; white-space: nowrap; }
.lingua-chiudi {
  border: 0; background: none; font-size: 1rem; cursor: pointer;
  color: var(--muto); padding: .3rem;
}

/* ---------- banner consenso cookie ---------- */
.banner-cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 1.2rem; flex-wrap: wrap;
  background: var(--carta); border-top: 2px solid var(--pesca-bg);
  padding: 1rem 1.3rem; box-shadow: 0 -6px 24px rgba(0,0,0,.10);
}
.banner-cookie p { margin: 0; font-size: .9rem; max-width: 42rem; color: var(--inchiostro); }
.banner-cookie-azioni { display: flex; gap: .6rem; flex: none; }
.banner-cookie .bottone { padding: .6rem 1.3rem; font-size: .9rem; }
/* il banner lingua sale sopra quello cookie se entrambi presenti */
.banner-cookie ~ .banner-lingua { bottom: 5.5rem; }

/* ---------- footer legale ---------- */
.footer-legale { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; justify-content: center;
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid rgba(0,0,0,.06); }
.footer-legale a { color: var(--accento-scuro); font-size: .82rem; font-weight: 600; text-decoration: none; }
.footer-legale a:hover { text-decoration: underline; }

/* ---------- header ordinato su mobile ---------- */
@media (max-width: 560px) {
  .sito-testa .riga { flex-wrap: wrap; justify-content: flex-start; gap: .5rem 1rem; }
  .sito-testa nav { width: 100%; gap: 1rem; }
}

/* ---------- bandiere lingua (SVG, funzionano anche su Windows) ---------- */
.bandiera {
  display: inline-block; height: .82em; border-radius: 2px; vertical-align: -.06em;
  margin-right: .4em; background-size: cover; background-position: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.bandiera-en { width: 1.5em; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2060%2030%27%3E%3CclipPath%20id%3D%27s%27%3E%3Cpath%20d%3D%27M0%2C0%20v30%20h60%20v-30%20z%27%2F%3E%3C%2FclipPath%3E%3CclipPath%20id%3D%27t%27%3E%3Cpath%20d%3D%27M30%2C15%20h30%20v15%20z%20v15%20h-30%20z%20h-30%20v-15%20z%20v-15%20h30%20z%27%2F%3E%3C%2FclipPath%3E%3Cg%20clip-path%3D%27url%28%23s%29%27%3E%3Cpath%20d%3D%27M0%2C0%20v30%20h60%20v-30%20z%27%20fill%3D%27%23012169%27%2F%3E%3Cpath%20d%3D%27M0%2C0%20L60%2C30%20M60%2C0%20L0%2C30%27%20stroke%3D%27%23fff%27%20stroke-width%3D%276%27%2F%3E%3Cpath%20d%3D%27M0%2C0%20L60%2C30%20M60%2C0%20L0%2C30%27%20clip-path%3D%27url%28%23t%29%27%20stroke%3D%27%23C8102E%27%20stroke-width%3D%274%27%2F%3E%3Cpath%20d%3D%27M30%2C0%20v30%20M0%2C15%20h60%27%20stroke%3D%27%23fff%27%20stroke-width%3D%2710%27%2F%3E%3Cpath%20d%3D%27M30%2C0%20v30%20M0%2C15%20h60%27%20stroke%3D%27%23C8102E%27%20stroke-width%3D%276%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
.bandiera-it { width: 1.2em; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%203%202%27%3E%3Crect%20width%3D%273%27%20height%3D%272%27%20fill%3D%27%23fff%27%2F%3E%3Crect%20width%3D%271%27%20height%3D%272%27%20fill%3D%27%23008C45%27%2F%3E%3Crect%20width%3D%271%27%20height%3D%272%27%20x%3D%272%27%20fill%3D%27%23CD212A%27%2F%3E%3C%2Fsvg%3E"); }
