/* Stile coerente con simonecastellan.com — minimale, monocromatico, luce. */
:root {
  --bg: #ffffff;
  --text: #3c4043;
  --ink: #1a1a1a;
  --muted: #5f6368;
  --muted-2: #68716d;
  --faint: #68716d;
  --pill: #f1f3f4;
  --pill-hover: #e6e8ea;
  --line: #c2c6cc;
  --line-soft: #dadce0;
  --err: #c5221f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

button, input, textarea, select { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  /* In orizzontale il notch mangia un lato: senza «env(safe-area-inset-left)»
     e «-right» la prima colonna di testo finisce sotto la tacca o sotto
     l'angolo tondo. Il «max()» tiene i 20px di sempre quando l'incavo non
     c'è — cioè su tutto quello che non è un iPhone ruotato (15/08/2026). */
  padding: 44px max(20px, env(safe-area-inset-right)) calc(72px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  text-align: center;
}

.card { width: 100%; max-width: 560px   /* il titolo a due voci vuole respiro: a 440px andava a capo */; }

header { margin-bottom: 30px; }
h1 { font-size: 26px; font-weight: 500; color: var(--ink); letter-spacing: -0.2px; }
.subtitle { font-size: 15px; color: var(--muted); margin-top: 8px; }

/* Campi */
.block { margin-bottom: 24px; text-align: left; }
.lbl {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.opz { text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 10.5px; }
.lbl.min { font-size: 10px; margin: 14px 0 0; color: var(--faint); }

/* Le tre righe che dicono a cosa serve: si leggono prima dei campi, quindi
   stanno sopra e non in fondo in grigio chiaro. */
.intro {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  text-align: left;
  margin: -12px 0 26px;
}

.num-row { display: flex; align-items: center; gap: 12px; }

/* Il contenitore porta la freccia: senza, un menu con appearance:none sembra
   una scritta e nessuno prova a toccarlo. */
.sel-wrap {
  position: relative;
  flex: 0 0 auto;
  max-width: 46%;
  border-bottom: 1px solid var(--line-soft);
}
.sel-wrap::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 7px; height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid var(--muted-2);
  border-bottom: 1.5px solid var(--muted-2);
  transform: rotate(45deg);
  pointer-events: none;
}
.sel-wrap:focus-within { border-bottom-color: var(--ink); }
.sel {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 18px 9px 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.sel:focus { outline: none; }

.txt {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;          /* sotto i 16 px iOS ingrandisce al focus */
  padding: 8px 0;
  border-radius: 0;
  -webkit-appearance: none;
  transition: border-color .15s ease;
}
.txt:focus { outline: none; border-bottom-color: var(--ink); }
.txt::placeholder { color: var(--faint); }

.area {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
  padding: 12px 13px;
  resize: vertical;
  -webkit-appearance: none;
  transition: border-color .15s ease;
}
.area:focus { outline: none; border-color: var(--ink); }
.area::placeholder { color: var(--faint); }

.err { margin-top: 8px; font-size: 12.5px; color: var(--err); line-height: 1.45; }

/* Frasi pronte */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  appearance: none;
  border: none;
  background: var(--pill);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.chip:hover { background: var(--pill-hover); color: var(--ink); }

/* Risultato */
.out { margin-top: 4px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.link-box {
  background: #fafbfc;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  min-height: 62px;
  display: flex;
  align-items: center;
}
.link-box.codice { min-height: 0; margin-top: 12px; }
.link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  word-break: break-all;
  white-space: pre-wrap;
}
.link.vuoto { color: var(--faint); }
.link b { font-weight: 700; }

.azioni { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  flex: 1 1 0;
  appearance: none;
  border: none;
  background: var(--pill);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.btn:hover:not(:disabled) { background: var(--pill-hover); }
.btn.primario { background: var(--ink); color: #fff; }
.btn.primario:hover:not(:disabled) { background: #000; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.largo { width: 100%; flex: none; margin-top: 12px; }

/* «Provalo» fa paura finché non si sa che non manda niente. */
.sotto-azioni {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--faint);
  text-align: left;
}

/* Blocco per chi ha un sito */
.extra { text-align: left; margin-top: 26px; }
.extra summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  padding: 6px 0;
}
.extra summary::-webkit-details-marker { display: none; }
.extra summary::before { content: "＋ "; color: var(--faint); }
.extra[open] summary::before { content: "− "; }
.extra summary:hover { color: var(--ink); }
.sm-hint { margin-top: 8px; font-size: 12px; line-height: 1.55; color: var(--faint); }

.hint {
  margin-top: 26px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--faint);
  text-align: left;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(56px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.site-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: #6b7075;
  letter-spacing: .2px;
}
.site-footer a { color: #6b7075; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.site-footer a:hover { color: var(--ink); }

.hidden { display: none !important; }

@media (max-width: 460px) {
  body { padding-top: 34px; }
  h1 { font-size: 22px; }
  .subtitle { font-size: 14px; }
  .sel { font-size: 13px; }
}


/* ————— La voce comune (12/08/2026) —————
   L'intestazione va a sinistra: la seconda riga del titolo finisce la frase
   della prima, e quella figura centrata si legge peggio. Il resto della
   pagina resta com'era. */
header { text-align: left; margin-bottom: 30px; }

/* Il link costruito è il risultato: si guarda quello e si copia. */
.out { color: var(--teal); }
/* «.btn.primario» e non «.primario»: la regola di sopra ha due classi e
   vincerebbe, lasciando il pulsante nero. Provato — restava nero. */
.btn.primario { background: var(--teal-l); color: var(--teal-scuro); }
.btn.primario:hover:not(:disabled) { background: var(--teal); }

/* ————— Il telefono in mano (15/08/2026) —————

   Il menu del prefisso stava a 14px, e sotto i 460px scendeva a 13. Sotto i
   16px Safari su iPhone ingrandisce la pagina appena lo tocchi: si apriva la
   tendina dei prefissi con la pagina già fuori squadra, e il numero da
   scrivere finiva mezzo fuori. 16px è la soglia, non una scelta di gusto.
   Il menu resta largo com'era: è il contenitore a decidere («max-width: 46%»).

   La riga «＋ Metti il pulsante nel tuo sito» era alta 27px: si apre con un
   dito, quindi deve essere alta come un dito. Cresce lo spazio, non il testo. */
@media (max-width: 560px), (pointer: coarse) {
  .sel { font-size: 16px; }
  .extra summary { padding: 13px 0; }
  /* Il campo del numero era alto 35 px: cresce l'imbottitura, non il testo,
     che sotto i 16 px farebbe ingrandire la pagina a iOS. */
  .txt { padding: 12px 0; min-height: 44px; }
}
