/* =====================================================================
   AMIPLAY - stile "Campo"
   ===================================================================== */
:root {
  --verde: #0E5A35;
  --verde-scuro: #08381F;
  --verde-tenue: #DCEBE1;
  --lime: #D4F04A;
  --sfondo: #EEF3EF;
  --carta: #FFFFFF;
  --testo: #10251A;
  --tenue: #4D6B5A;
  --bordo: #D5E0D8;
  --rosso: #B42318;
  --rosso-tenue: #FDECEA;
  --blu-tenue: #E8F0FE;
  --ambra-tenue: #FFF6DB;
  --raggio: 14px;
  --ombra: 0 1px 2px rgba(16, 37, 26, .08);
  --titoli: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --corpo: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
a, button, select, label { -webkit-tap-highlight-color: rgba(14, 90, 53, .12); }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0;
  background: var(--sfondo);
  color: var(--testo);
  font-family: var(--corpo);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}
body.con-nav { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
a { color: var(--verde); }
a:hover { color: var(--verde-scuro); }
img, svg { flex: none; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* --- Testata verde ---------------------------------------------------- */
.testata {
  background: var(--verde);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 48px, rgba(255,255,255,0) 48px 96px);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.testata-riga { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo {
  font-family: var(--titoli); font-weight: 800; font-size: 30px; letter-spacing: .5px;
  color: #fff; text-decoration: none; line-height: 1;
}
.logo:hover { color: #fff; }
.logo span { color: var(--lime); }
.testata-titolo {
  flex: 1; margin: 0; font-family: var(--titoli); font-weight: 700; font-size: 24px;
  text-transform: uppercase; letter-spacing: .3px; line-height: 1.05;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.testata-sotto { font-size: 15px; opacity: .92; }
.btn-tondo {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.35);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; position: relative; flex: none;
}
.btn-tondo:hover { color: #fff; background: rgba(255,255,255,.1); }
.pallino {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--lime); color: var(--testo); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* filtri nella testata */
.barra-filtri {
  position: relative;
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none;
}
.barra-filtri::-webkit-scrollbar { display: none; }
.barra-filtri .filtri, .barra-filtri .filtri-sel { flex-wrap: nowrap; flex: none; }
.chip { white-space: nowrap; }
.filtri { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid rgba(255,255,255,.45); color: #fff; text-decoration: none; font-size: 14px;
  padding: 0 12px; border-radius: 16px; min-height: 34px; display: inline-flex; align-items: center;
}
@media (hover: hover) { .chip:hover { color: #fff; background: rgba(255,255,255,.1); } }
.chip-attivo, .chip-attivo:hover { background: var(--lime) !important; border-color: var(--lime); color: var(--testo) !important; font-weight: 600; }
.chip { gap: 6px; -webkit-tap-highlight-color: transparent; }
.chip svg { margin-left: -2px; }
.filtri-sel { display: flex; gap: 8px; flex-wrap: wrap; }
.sel-chip { position: relative; }
.sel-chip select {
  appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.45); border-radius: 16px; min-height: 34px; padding: 0 30px 0 12px;
  font: inherit; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.sel-chip select option { color: var(--testo); }

.schede-tab { display: flex; gap: 4px; overflow-x: auto; margin: 0 -16px -14px; padding: 0 12px; }
.schede-tab a {
  color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; padding: 10px 12px 12px;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.schede-tab a.attivo { color: #fff; border-bottom-color: var(--lime); }

/* --- Contenuto ------------------------------------------------------------ */
.contenuto { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sezione {
  font-family: var(--titoli); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--verde); margin: 8px 0 0;
}
.titoletto { font-family: var(--titoli); font-weight: 700; font-size: 21px; margin: 0 0 8px; line-height: 1.15; }
.scheda {
  background: var(--carta); border-radius: var(--raggio); padding: 14px; box-shadow: var(--ombra);
  display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; min-width: 0;
}
.scheda > * { margin-top: 0; margin-bottom: 0; }
.scheda-larga { padding: 18px; }
.scheda-link { text-decoration: none; color: inherit; flex-direction: row; align-items: center; gap: 12px; }
.scheda-link:hover { color: inherit; box-shadow: 0 2px 8px rgba(16,37,26,.14); }
.vuoto { text-align: center; padding: 22px 16px; color: var(--tenue); }
.vuoto .titoletto { color: var(--testo); }
.riquadro-invito { border: 2px dashed var(--verde-tenue); }
.cresce { flex: 1; min-width: 0; }
.centrato { text-align: center; }
.testo-tenue { color: var(--tenue); font-size: 15px; }
.piccolo { font-size: 13px; }
.nota { color: var(--tenue); font-size: 14px; margin: 0; }
.facoltativo { color: var(--tenue); font-weight: 400; font-size: 13px; }
.titolo-scheda { font-weight: 600; font-size: 16px; }
.testo-lungo p { line-height: 1.55; }

/* --- Annunci --------------------------------------------------------------- */
.annuncio-testa { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.annuncio-cat { font-family: var(--titoli); font-weight: 700; font-size: 21px; line-height: 1.1; }
.annuncio-cat span { font-weight: 600; color: var(--tenue); }
.annuncio-cat.grande { font-size: 26px; }
.annuncio-km { font-weight: 600; font-size: 14px; color: var(--verde); white-space: nowrap; }
.annuncio-soc { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.annuncio-piede { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.per-chi { color: var(--verde); font-weight: 600; font-size: 13px; }
.riga-nostra { justify-content: space-between; }
.contatore {
  background: var(--lime); color: var(--testo); font-weight: 700; font-size: 13px; padding: 4px 10px;
  border-radius: 12px; white-space: nowrap;
}
.contatore.stato-in_verifica { background: var(--ambra-tenue); }
.contatore.stato-sospesa { background: var(--rosso-tenue); color: var(--rosso); }
.stemma {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  color: #fff; font-weight: 700; font-family: var(--titoli); letter-spacing: .3px; flex: none;
}
.elenco-date { margin: 4px 0 0; padding-left: 20px; }
.elenco-date li { margin: 2px 0; }
.note-annuncio { background: var(--sfondo); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.dato { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--bordo); font-size: 15px; }
.dato-colonna { flex-direction: column; gap: 2px; }
.dato-etichetta { color: var(--tenue); flex: none; }
.dato-valore { text-align: right; }

/* proposte e partite */
.proposta-riga.stato-rifiutata, .proposta-riga.stato-ritirata, .proposta-riga.stato-decaduta { opacity: .6; }
.stato-proposta { align-self: flex-start; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 12px; background: var(--ambra-tenue); }
.stato-proposta.stato-accettata { background: var(--lime); }
.stato-proposta.stato-rifiutata, .stato-proposta.stato-decaduta, .stato-proposta.stato-ritirata { background: var(--rosso-tenue); color: var(--rosso); }
.sfida { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 0; }
.sfida-lato { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: 15px; }
.sfida-lato .testo-tenue { font-size: 13px; }
.sfida-vs { font-family: var(--titoli); font-weight: 800; font-size: 26px; color: var(--verde); }
.partita { gap: 14px; }
.partita-data {
  width: 58px; flex: none; background: var(--verde); color: #fff; border-radius: 10px; padding: 6px 0;
  display: flex; flex-direction: column; align-items: center; line-height: 1.1; text-transform: uppercase; font-size: 12px;
}
.partita-data strong { font-family: var(--titoli); font-size: 28px; color: var(--lime); }
.partita-cat { font-family: var(--titoli); font-weight: 700; font-size: 17px; color: var(--verde); text-transform: uppercase; letter-spacing: .3px; }
.partita-squadre { font-weight: 600; }
.partita-annullata { opacity: .55; }
.da-fare { color: var(--verde); font-weight: 700; }

/* chat */
.chat { gap: 10px; }
.msg { max-width: 85%; align-self: flex-start; }
.msg-mio { align-self: flex-end; }
.msg-testo { background: var(--sfondo); border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.msg-mio .msg-testo { background: var(--verde-tenue); border-radius: 12px 12px 4px 12px; }
.msg-info { font-size: 12px; color: var(--tenue); margin-top: 2px; }
.msg-mio .msg-info { text-align: right; }
.chat-invio { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--bordo); padding-top: 10px; }
.chat-invio textarea { flex: 1; }

.persona { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.scheda.persona { flex-direction: row; }
.persona + .persona { border-top: 1px solid var(--bordo); padding-top: 8px; }
.menu-persona { position: relative; }
.menu-persona summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--tenue); }
.menu-persona summary::-webkit-details-marker { display: none; }
.menu-persona[open] {
  position: absolute; right: 16px; left: 16px; z-index: 5; background: var(--carta); padding: 12px;
  border-radius: var(--raggio); box-shadow: 0 8px 24px rgba(16,37,26,.2);
}
.persona { position: relative; }
.notifica.non-letta { border-left: 4px solid var(--lime); }
.passi { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.numeri { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.numeri div { background: var(--carta); border-radius: 12px; padding: 10px 6px; text-align: center; box-shadow: var(--ombra); }
.numeri strong { display: block; font-family: var(--titoli); font-size: 26px; color: var(--verde); }
.numeri span { font-size: 12px; color: var(--tenue); }

/* --- Moduli -------------------------------------------------------------------- */
.modulo { display: flex; flex-direction: column; gap: 12px; }
.modulo label, .scheda > label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number],
input[type=date], input[type=time], select, textarea {
  font: inherit; font-weight: 400; color: var(--testo); background: #fff; width: 100%;
  border: 1.5px solid var(--bordo); border-radius: 10px; min-height: 46px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(14,90,53,.15); }
input[type=color] { width: 100%; height: 46px; border: 1.5px solid var(--bordo); border-radius: 10px; padding: 4px; background: #fff; }
.riga-campi { display: flex; gap: 10px; flex-wrap: wrap; }
.riga-campi > label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 15px; }
.riga-campi .cresce { flex: 1 1 140px; }
.riga-campi .stretto { flex: 0 0 76px; }
.allinea-fondo { align-items: flex-end; }
.spunta { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; cursor: pointer; min-height: 32px; }
.spunta input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--verde); flex: none; }
fieldset.gruppo { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.gruppo legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 6px; }
fieldset[disabled] { opacity: .85; }
.scelte { display: flex; gap: 8px; flex-wrap: wrap; }
.scelta { flex: 1 1 0; min-width: 80px; cursor: pointer; }
.scelta input { position: absolute; opacity: 0; pointer-events: none; }
.scelta span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 10px; text-align: center;
  border: 1.5px solid var(--bordo); border-radius: 10px; font-weight: 600; background: #fff;
}
.scelta input:checked + span { border-color: var(--verde); background: var(--verde); color: #fff; }
.scelta input:focus-visible + span { box-shadow: 0 0 0 3px rgba(14,90,53,.25); }
.gruppo-data { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--bordo); }
.gruppo-data + .gruppo-data { padding-top: 4px; }
.posizione { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--sfondo); border-radius: 10px; }
.campo-link { font-size: 14px !important; background: var(--sfondo) !important; }
details.scheda:not([open]) { gap: 0; }
details.scheda > summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details.scheda[open] > summary { margin-bottom: 8px; }
.separatore { display: flex; align-items: center; gap: 10px; color: var(--tenue); font-size: 14px; margin: 6px 0; }
.separatore::before, .separatore::after { content: ''; flex: 1; height: 1px; background: var(--bordo); }

/* --- Bottoni ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1.5px solid transparent; font: inherit; font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-pieno { width: 100%; min-height: 50px; font-size: 16px; }
.btn-primario { background: var(--lime); color: var(--testo); font-family: var(--titoli); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .3px; }
.btn-primario:hover { background: #C6E33A; color: var(--testo); }
.btn-verde { background: var(--verde); color: #fff; }
.btn-verde:hover { background: var(--verde-scuro); color: #fff; }
.btn-scuro { background: var(--testo); color: #fff; }
.btn-scuro:hover { background: #000; color: #fff; }
.btn-chiaro { background: #fff; color: var(--verde); border-color: var(--bordo); }
.btn-chiaro:hover { border-color: var(--verde); color: var(--verde-scuro); }
.btn-testo { background: transparent; color: var(--tenue); }
.btn-testo:hover { color: var(--rosso); }
.btn-mini { min-height: 34px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--lime); color: var(--testo); font: inherit; font-weight: 700; cursor: pointer; }
.riga-bottoni { display: flex; gap: 8px; flex-wrap: wrap; }
.riga-bottoni > .btn, .riga-bottoni > form { flex: 1 1 auto; }
.riga-bottoni > form .btn { width: 100%; }

.fab {
  position: fixed; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 10;
  height: 54px; padding: 0 20px; border-radius: 27px; background: var(--lime); color: var(--testo);
  font-family: var(--titoli); font-weight: 800; font-size: 19px; text-transform: uppercase; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 6px 16px rgba(16,37,26,.25);
}
.fab:hover { color: var(--testo); background: #C6E33A; }
@media (min-width: 700px) { .fab { right: calc(50% - 300px); } }

/* --- Avvisi ------------------------------------------------------------------------ */
.avviso { border-radius: 12px; padding: 10px 14px; font-size: 15px; margin: 0; }
.avviso-ok { background: var(--verde-tenue); color: var(--verde-scuro); }
.avviso-errore { background: var(--rosso-tenue); color: #7A1A12; }
.avviso-info { background: var(--ambra-tenue); color: #5C4400; }
.barra-aggiorna {
  position: fixed; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); z-index: 50;
  background: var(--testo); color: #fff; border-radius: 12px; padding: 10px 12px; display: flex; gap: 12px;
  align-items: center; justify-content: space-between; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 15px;
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--testo); color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 15px;
}

/* --- Menu in basso ------------------------------------------------------------------- */
.menu {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--bordo);
  display: flex; justify-content: space-around; align-items: center;
  height: calc(72px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.menu a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; min-height: 52px; justify-content: center;
  text-decoration: none; color: var(--tenue); font-size: 12px;
}
.menu a.attivo { color: var(--verde); font-weight: 700; }

/* occhietto delle password */
.campo-password { position: relative; display: block; }
.campo-password input { padding-right: 52px; }
.occhio {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  border: 0; background: transparent; color: var(--tenue); display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 10px;
}
.occhio:hover { color: var(--verde); }

/* filtri su sfondo chiaro (area amministratore) */
.filtri-chiari .chip { color: var(--verde); border-color: var(--bordo); background: #fff; }
.filtri-chiari .chip-attivo { background: var(--verde); color: #fff; border-color: var(--verde); }
details > summary { cursor: pointer; }

/* pagina "Perché Amiplay" */
.presenta { gap: 12px; }
.presenta-titolo { font-family: var(--titoli); font-weight: 800; font-size: 30px; line-height: 1.05; text-transform: uppercase; color: var(--verde); margin: 0; }
.passi-grandi { margin: 0; padding: 0; list-style: none; counter-reset: passo; display: flex; flex-direction: column; gap: 14px; }
.passi-grandi li { counter-increment: passo; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
.passi-grandi li::before {
  content: counter(passo); grid-row: span 2; width: 40px; height: 40px; border-radius: 20px; background: var(--lime);
  color: var(--testo); font-family: var(--titoli); font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.passi-grandi strong { font-size: 17px; }
.passi-grandi span { color: var(--tenue); font-size: 15px; }
.vantaggio h3 { margin: 0; font-family: var(--titoli); font-size: 21px; display: flex; align-items: center; gap: 8px; color: var(--verde); }
.vantaggio ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* versione dimostrativa */
.barra-demo { background: var(--lime); color: var(--testo); text-align: center; font-size: 13px; font-weight: 600; padding: 6px 12px; }

.numeri-perche { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.numeri-perche strong { font-size: 32px; }

/* invito a installare */
.banner-riga { display: flex; align-items: center; gap: 10px; }
.banner-riga img { border-radius: 10px; }
.btn-x { width: 36px; height: 36px; border: 0; background: transparent; color: var(--tenue); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 18px; flex: none; }
