@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-upright-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bordeaux: #6F1616; --vino: #4A1414; --profondo: #270000;
  --rosa: #D88484; --cipria: #FFCBCB; --cipria-chiaro: #FFE9E7;
  --bg: #FBF7F3; --surface: #FFFFFF; --surface-2: #F7EFEA;
  --border: #EBDDD6; --border-strong: #D8C2B8;
  --text: #2A0B0B; --text-2: #4D2B29; --muted: #7D5B57;
  --f-allenare: #E3A6A2; --f-media: #B9666A; --f-forza: #6F1616;
  --raggio: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 "Manrope", system-ui, sans-serif; }
a { color: var(--bordeaux); }
h1, h2, h3 { font-family: "Cormorant", Georgia, serif; font-weight: 600; color: var(--vino); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 2.3rem; } h2 { font-size: 1.7rem; } h3 { font-size: 1.25rem; font-family: "Manrope", sans-serif; font-weight: 700; color: var(--text); }
p { margin: 0 0 .9em; }
.muted { color: var(--muted); }
.piccolo { font-size: .88rem; }

.testata { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.testata img { height: 42px; display: block; }
.testata .prodotto { font-family: "Cormorant", serif; font-size: 1.35rem; color: var(--vino); }
.contenitore { max-width: 860px; margin: 0 auto; padding: 28px 20px 64px; }
.largo { max-width: 1180px; }
.scheda { background: var(--surface); border: 1px solid var(--border); border-radius: var(--raggio); padding: 26px; margin-bottom: 18px; }

.bottone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--bordeaux); background: var(--bordeaux); color: #fff; font: 600 15px "Manrope", sans-serif; padding: 12px 22px; border-radius: 999px; cursor: pointer; text-decoration: none; transition: background .15s, opacity .15s; }
.bottone:hover { background: var(--vino); }
.bottone[disabled] { opacity: .4; cursor: not-allowed; }
.bottone.secondario { background: transparent; color: var(--bordeaux); }
.bottone.secondario:hover { background: var(--cipria-chiaro); }
.bottone.piccolo { padding: 7px 14px; font-size: 13px; }
.bottone.pericolo { border-color: #9b2c2c; color: #9b2c2c; background: transparent; }
.riga-bottoni { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

label.campo { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password] { width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; font: 16px "Manrope", sans-serif; background: #fff; color: var(--text); }
input:focus { outline: 2px solid var(--rosa); outline-offset: 1px; }
.due { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.scelte label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.scelte label:has(input:checked) { border-color: var(--bordeaux); background: var(--cipria-chiaro); }
.spunta { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: .93rem; }
.spunta input { margin-top: 4px; }
.errore { color: #9b2c2c; background: #fdecea; border-radius: 10px; padding: 10px 14px; margin-top: 14px; }
.nota { background: var(--surface-2); border-radius: 10px; padding: 12px 16px; font-size: .92rem; color: var(--text-2); }

/* questionario */
.avanzamento { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0 10px; }
.barra { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.barra > div { height: 100%; background: linear-gradient(90deg, var(--rosa), var(--bordeaux)); transition: width .3s; }
.domanda { padding: 18px 0; border-bottom: 1px solid var(--border); }
.domanda:last-child { border-bottom: 0; }
.domanda .testo { font-weight: 600; margin-bottom: 10px; }
.domanda .num { color: var(--muted); font-weight: 500; margin-right: 6px; }
.opzioni { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.opzioni button { border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); border-radius: 10px; padding: 9px 4px; font: 500 13px/1.25 "Manrope", sans-serif; cursor: pointer; min-height: 52px; }
.opzioni button:hover { border-color: var(--rosa); }
.opzioni button.scelta { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
@media (max-width: 640px) {
  .opzioni { grid-template-columns: 1fr; }
  .opzioni button { min-height: 0; text-align: left; padding: 11px 14px; font-size: 14px; }
  .due { grid-template-columns: 1fr; }
  h1 { font-size: 1.9rem; }
  .testata { padding: 14px 16px; } .testata img { height: 34px; }
  .scheda { padding: 20px 16px; }
}

/* area riservata */
table.elenco { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.elenco th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border-strong); }
table.elenco td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.etichetta { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.e-ok { background: #e6f2ea; color: #1f5f3a; } .e-attesa { background: var(--surface-2); color: var(--text-2); }
.e-cautela { background: #fff3d6; color: #7a5300; } .e-no { background: #fdecea; color: #9b2c2c; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 8px 8px 8px 14px; font-size: .9rem; word-break: break-all; }
.link-box span { flex: 1; }
.griglia-aziende { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.griglia-aziende .scheda { margin: 0; cursor: pointer; transition: border-color .15s; }
.griglia-aziende .scheda:hover { border-color: var(--rosa); }
.numeri { display: flex; gap: 22px; margin-top: 10px; }
.numeri b { display: block; font-size: 1.5rem; color: var(--bordeaux); }
.interruttore { display: flex; gap: 10px; align-items: center; margin: 8px 0; font-size: .93rem; }
.qr { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: inline-block; }
.qr img { display: block; width: 132px; height: 132px; }
.azioni-riga { display: flex; gap: 6px; flex-wrap: wrap; }
.avviso { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--profondo); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; }
.avviso.visibile { opacity: 1; }

/* report */
.report { max-width: 900px; margin: 0 auto; padding: 24px 20px 64px; }
.foglio { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 40px 46px; margin-bottom: 22px; }
.copertina { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--cipria); padding-bottom: 18px; margin-bottom: 22px; }
.copertina img { height: 54px; }
.copertina .tipo { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--rosa); font-weight: 700; }
.dati-persona { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: .9rem; color: var(--text-2); margin-top: 6px; }
.sintesi { font-size: 1.08rem; background: var(--cipria-chiaro); border-left: 4px solid var(--bordeaux); padding: 16px 20px; border-radius: 0 10px 10px 0; }
.grafico svg { width: 100%; height: auto; display: block; }
.legenda { display: flex; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); margin-top: 8px; }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.carte { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.carta { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; break-inside: avoid; }
.carta h4 { margin: 0 0 6px; font-size: 1rem; }
.fascia { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; color: #fff; white-space: nowrap; }
.fascia.allenare { background: var(--f-allenare); color: var(--profondo); } .fascia.media { background: var(--f-media); } .fascia.forza { background: var(--f-forza); }
.area-riga { display: grid; grid-template-columns: 210px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.area-riga:last-child { border-bottom: 0; }
.area-riga .nome { font-weight: 700; }
ol.azioni { padding-left: 0; list-style: none; counter-reset: a; }
ol.azioni li { counter-increment: a; position: relative; padding: 10px 0 10px 46px; border-bottom: 1px solid var(--border); break-inside: avoid; }
ol.azioni li::before { content: counter(a); position: absolute; left: 0; top: 8px; width: 32px; height: 32px; border-radius: 50%; background: var(--bordeaux); color: #fff; font-weight: 700; display: grid; place-items: center; }
.profilo-ruolo { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; break-inside: avoid; }
.profilo-ruolo.dichiarato { border-color: var(--rosa); background: var(--cipria-chiaro); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px; margin: 3px 4px 3px 0; background: #fff; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.come-leggere { font-size: .84rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 20px; }
.sezione { margin-top: 28px; break-inside: avoid-page; }
.sezione > h2 { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.barra-stampa { display: flex; justify-content: flex-end; gap: 10px; max-width: 900px; margin: 0 auto; padding: 16px 20px 0; }

@media (max-width: 700px) {
  .foglio { padding: 24px 18px; }
  .area-riga { grid-template-columns: 1fr; gap: 4px; }
  .copertina { flex-direction: column-reverse; }
}

@page { size: A4; margin: 14mm 13mm; }
@media print {
  body { background: #fff; font-size: 10pt; }
  h1 { font-size: 22pt; } h2 { font-size: 15pt; }
  .carte { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .carta { padding: 9px 11px; }
  .area-riga { padding: 7px 0; grid-template-columns: 170px 1fr; }
  .sezione { margin-top: 18px; }
  h2, h3, h4 { break-after: avoid; }
  ol.azioni li { padding: 7px 0 7px 40px; }
  .profilo-ruolo { padding: 9px 12px; margin-bottom: 7px; }
  .no-print, .testata, .barra-stampa { display: none !important; }
  .report { padding: 0; max-width: none; }
  .foglio { border: 0; padding: 0; margin: 0; }
  .sezione { break-inside: auto; }
  .salto { break-before: page; }
  .sintesi, .carta, .fascia, .barra > div, ol.azioni li::before, .profilo-ruolo.dichiarato { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
