/* Componenti UI dell'app (plain CSS, senza dipendere dal processing @apply
   del CDN Tailwind). Specificità di classe normale (0,1,0): batte il preflight
   Tailwind sugli elementi (button/input) e perde solo contro `!important` e
   utility più specifiche usate nei template (es. !p-0 sulle card-tabella). */

/* Palette condivisa con la vetrina (landing.css): una sola identità visiva. */
:root {
  --navy: #0b2939;
  --ink: #172c37;
  --teal: #0b7185;
  --mint: #4ad1af;
  --paper: #fbfcfa;
  --pale: #eff6f5;
  --line: #d8e5e4;
  --muted: #596e78;
}

/* ---- campi di input ---- */
.field {
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid var(--line);
  background-color: #ffffff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ink);
  background-clip: padding-box;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.field:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(74, 209, 175, 0.3);
}
select.field {
  appearance: auto;
}
textarea.field {
  min-height: 3.5rem;
  resize: vertical;
}

.field-checkbox {
  height: 1rem;
  width: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--line);
  accent-color: var(--teal);
}

.label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* ---- bottoni ----
   Le varianti sono autosufficienti: i template usano `btn-primary`/`btn-ghost`
   da soli (senza `btn`), quindi la base (forma, padding, tipografia) è
   applicata anche direttamente alle varianti, sempre a specificità (0,1,0). */
.btn,
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}
.btn:disabled,
.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background-color: var(--mint);
  color: var(--navy);
}
.btn-primary:hover {
  background-color: #7fe3c9;
}
.btn-ghost {
  border-color: var(--line);
  background-color: #ffffff;
  color: var(--ink);
}
.btn-ghost:hover {
  background-color: var(--pale);
}

/* ---- card ---- */
.card {
  border-radius: 0.75rem;
  background-color: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05), 0 0 0 1px var(--line);
}

.document-body p {
  text-align: justify;
}

/* ---- anteprima dei file caricati (solo contenuto) ----
   Il file Word/Excel caricato dal consulente si mostra come HTML ristretto:
   testo, tabelle, elenchi. Non riproduce il layout (lo dichiara l'avviso in
   `anteprima_copia_operativa.html`), ma deve restare leggibile: questi stili
   sono locali, così l'anteprima non dipende dal `prose` del CDN Tailwind né
   dalla rete. Il preflight di Tailwind azzera margini, bordi delle tabelle e
   pallini degli elenchi: qui si ripristinano esplicitamente. */
.anteprima-file {
  overflow-x: auto; /* tabelle larghe: scroll, non sfondamento della card */
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background-color: #ffffff;
  padding: 1.25rem 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink);
}
.anteprima-file > :first-child {
  margin-top: 0;
}
.anteprima-file > :last-child {
  margin-bottom: 0;
}
.anteprima-file p {
  margin: 0.5rem 0;
}
.anteprima-file h1,
.anteprima-file h2,
.anteprima-file h3,
.anteprima-file h4 {
  margin: 1.25rem 0 0.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
}
.anteprima-file h2 {
  font-size: 1.25rem;
}
.anteprima-file h3 {
  font-size: 1.1rem;
}
.anteprima-file h4 {
  font-size: 1rem;
}
.anteprima-file ul,
.anteprima-file ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  list-style-position: outside;
}
.anteprima-file ul {
  list-style-type: disc;
}
.anteprima-file ol {
  list-style-type: decimal;
}
.anteprima-file li {
  margin: 0.15rem 0;
}
.anteprima-file table {
  width: 100%;
  margin: 0.75rem 0;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.anteprima-file th,
.anteprima-file td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
.anteprima-file th {
  background-color: var(--pale);
  font-weight: 600;
  color: var(--navy);
}
.anteprima-file tbody tr:nth-child(even) {
  background-color: #fafcfb;
}
