/* =====================================================================
   Equalization Academy - Area riservata v3 (05/10/2026)
   Grafica del sito pubblico (sfondo a poligoni grigio scuro, logo bianco
   "college", testo bianco) + impaginazione tipo MyDAN (menu a pulsanti,
   riquadri bianchi con "Dettagli"). Mobile first, supporto arabo (RTL).
   ===================================================================== */
:root {
  --ink: #1e2329;
  --dark: #2b2f36;
  --dark-2: #3a3f47;
  --blue: #1d6fd1;
  --blue-soft: #e8f1fc;
  --teal: #00a8b5;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #1e2329;
  --muted: #66707c;
  --line: #e3e7ec;
  --ok: #1f8f61;
  --ok-soft: #e6f5ee;
  --warn: #b7790a;
  --warn-soft: #fdf3dd;
  --err: #c7392f;
  --err-soft: #fbe9e7;
  --radius: 10px;
  --shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 8px 24px rgba(0, 0, 0, .18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Noto Sans Arabic", "Noto Sans SC", "Noto Sans JP", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); }
body.bg-poly { background: var(--dark) url("../img/background.jpg") center / cover fixed no-repeat; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: .01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
h2 .chip, h3 .chip { vertical-align: middle; margin-inline-end: 4px; }
p { margin: 0 0 .75rem; }
.ico { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.warn-text { color: var(--warn); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; overflow-wrap: anywhere; }
.main, .card, .dcard { min-width: 0; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Icone colorate ---------- */
.chip { --c: #2f80ed; display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; color: #fff;
  background: var(--c);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 80%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 80%, #000) 100%);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--c) 45%, transparent); position: relative; }
h2 .chip, h3 .chip { width: 28px; height: 28px; border-radius: 8px; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: #dfe3e8; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.avatar.ini { display: inline-grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: .02em; }

/* ---------- Barra in alto ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px;
  background: rgba(24, 27, 32, .92); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar .brand { display: flex; align-items: center; }
.topbar .brand img { height: 40px; width: auto; max-width: 42vw; object-fit: contain; }
.who-box { display: none; align-items: center; gap: 10px; background: #fff; color: var(--ink); border-radius: 8px; padding: 6px 14px 6px 8px; font-size: .9rem; max-width: 40vw; }
.who-box span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-box em { font-style: normal; color: #c0392b; font-weight: 700; font-size: .8rem; margin-inline-start: 6px; }
.topbar .spacer { flex: 1; }
.toplinks { display: none; align-items: center; gap: 10px; font-size: .9rem; }
.toplinks a { color: #fff; opacity: .9; }
.toplinks .sep { opacity: .35; }
.tb-btn, .pub-top .tb-btn { display: inline-flex; align-items: center; gap: 6px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; padding: 7px 10px; font: inherit; font-size: .85rem; cursor: pointer; text-decoration: none; }
.tb-btn:hover { background: rgba(255,255,255,.2); text-decoration: none; }
.tb-btn.sq { padding: 7px 9px; }
.tb-btn.dark { color: var(--ink); background: #eef1f4; border-color: #dde2e7; }

/* ---------- Struttura ---------- */
.shell { display: block; flex: 1; }
.sidenav { display: none; }
.main { padding: 20px 14px 110px; max-width: 1180px; margin: 0 auto; }
.main > .page-head h1, .main > .page-head p, .main > .crumb, .main > p.muted, .main > p.small, .main > .page-head .muted { color: #fff; }
.main > .page-head h1 { text-transform: uppercase; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.main > .page-head p { opacity: .85; }
.main > p.muted, .main > p.small { opacity: .8; }

.bottomnav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: #fff;
  border-top: 1px solid var(--line); padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.15); }
.bottomnav a, .bottomnav button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; font-size: .68rem;
  color: var(--muted); text-decoration: none; padding: 2px; background: none; border: 0; cursor: pointer; }
.bottomnav a .chip { --c: inherit; }
.bottomnav .chip { width: 32px; height: 32px; border-radius: 10px; opacity: .78; }
.bottomnav a.on { color: var(--ink); font-weight: 700; }
.bottomnav a.on .chip { opacity: 1; transform: translateY(-2px); }
.bottomnav .bl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .dot { position: absolute; top: -3px; inset-inline-end: -3px; width: 10px; height: 10px; border-radius: 50%; background: #eb5757; border: 2px solid #fff; }

.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); }
.drawer-in { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(340px, 88vw); background: #f4f6f8; overflow-y: auto; padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; }

/* Pulsanti del menu laterale (stile MyDAN) */
.navbtn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none;
  font-weight: 650; font-size: .95rem; border: 1px solid #e3e7ec; box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: transform .12s, box-shadow .12s; }
.navbtn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.navbtn .chip { --c: inherit; }
.navbtn .lbl { flex: 1; min-width: 0; }
.navbtn .nb { background: #eb5757; color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 1px 8px; }
.navbtn.on { background: var(--c); border-color: var(--c); color: #fff; }
.navbtn.on .chip { background: rgba(255,255,255,.22); box-shadow: none; }
.navbtn.out { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); box-shadow: none; }
.drawer .navbtn.out { color: var(--ink); border-color: #cfd6dd; }

@media (min-width: 700px) {
  .who-box { display: flex; }
}
@media (min-width: 1000px) {
  .toplinks { display: flex; }
  .shell { display: grid; grid-template-columns: 272px 1fr; }
  .sidenav { display: flex; flex-direction: column; gap: 8px; padding: 22px 14px 30px; position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; }
  .sidenav .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.7); margin: 12px 6px 0; font-weight: 700; }
  .main { padding: 26px 30px 48px; margin: 0; max-width: 1200px; width: 100%; }
  .bottomnav { display: none; }
}

/* ---------- Piede di pagina ---------- */
.site-foot { background: rgba(20, 22, 27, .94); color: rgba(255,255,255,.78); font-size: .82rem; margin-top: auto; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.08); }
.sf-in { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.sf-logo { height: 34px; width: auto; opacity: .95; }
.sf-text { flex: 1; min-width: 220px; border-inline-start: 2px solid rgba(255,255,255,.25); padding-inline-start: 18px; line-height: 1.6; }
.sf-text strong { color: #fff; }
.sf-links a { color: rgba(255,255,255,.85); }
@media (min-width: 1000px) { .site-foot { padding-bottom: 20px; } }
.auth-page .site-foot { padding-bottom: 20px; }

/* ---------- Intestazione pagina ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }

/* ---------- Riquadri ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Riquadri stile MyDAN: titolo maiuscolo, sottotitolo colorato, colonne, pulsante "Dettagli" */
.dash { display: grid; gap: 18px; grid-template-columns: 1fr; margin-bottom: 18px; }
@media (min-width: 900px) { .dash { grid-template-columns: repeat(2, 1fr); } }
.dcard { background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 22px 24px 18px; display: flex; flex-direction: column; gap: 12px; }
.dash .wide { grid-column: 1 / -1; }
.dhead { display: flex; align-items: center; gap: 14px; }
.dhead > div { flex: 1; min-width: 0; }
.dhead h3 { margin: 0; text-transform: uppercase; letter-spacing: .03em; font-size: 1rem; font-weight: 800; }
.dsub { margin: 2px 0 0; font-weight: 700; color: var(--blue); font-size: .95rem; }
.dsub.ok { color: var(--ok); } .dsub.warn { color: #c0392b; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 18px; margin: 0; }
.cols dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #8a94a0; font-weight: 700; }
.cols dd { margin: 2px 0 0; font-size: .95rem; }
.dcard .more { margin-top: auto; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.btn.det { background: #3e64d6; text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; min-height: 34px; padding: 6px 18px; border-radius: 6px; }
.mini { margin: 0; padding-inline-start: 18px; font-size: .9rem; }

/* Numeri principali (centro) */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { --c: #2f80ed; display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 16px; color: var(--ink); text-decoration: none; border-top: 4px solid var(--c); min-width: 0; }
.kpi:hover { text-decoration: none; }
.kpi > .ico { color: var(--c); flex: none; }
.kpi b { display: block; font-size: 1.7rem; line-height: 1.1; font-weight: 800; }
.kpi.money b { font-size: 1.35rem; }
.kpi span { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.kpi small { display: block; font-size: .75rem; color: var(--muted); }
.kpi > div { min-width: 0; }

.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.stat .n { font-size: 1.9rem; font-weight: 700; line-height: 1.1; color: var(--ink); }
.stat .l { font-size: .85rem; color: var(--muted); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 10px; min-height: 112px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; color: var(--text); text-decoration: none; }
.tile .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.tile span { font-size: .82rem; color: var(--muted); }

.profile-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-card h1 { font-size: 1.4rem; }

/* ---------- Badge e avanzamento ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge.neutral { background: #eef1f5; color: #46556a; }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.warning { background: var(--warn-soft); color: var(--warn); }
.badge.success { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--err-soft); color: var(--err); }
.steps { display: flex; gap: 4px; margin: 4px 0; }
.steps i { flex: 1; height: 7px; border-radius: 4px; background: var(--line); }
.steps i.on { background: linear-gradient(90deg, var(--teal), #2f80ed); }
.steps-l { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #27ae60, #00a8b5); }

/* ---------- Elenchi e tabelle ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 11px 2px; color: inherit; text-decoration: none; }
a.row-link:hover { text-decoration: none; background: #f7f9fb; }
.row-link .t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link .s { font-size: .85rem; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: start; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #8a94a0; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th, .tbl td { overflow-wrap: normal; word-break: normal; }
.tbl th { white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Moduli (etichetta sul bordo, come MyDAN) ---------- */
.form { display: grid; gap: 16px; }
.form .two, .form .three { display: grid; gap: 16px; }
@media (min-width: 680px) { .form .two { grid-template-columns: 1fr 1fr; } .form .three { grid-template-columns: 2fr 1fr 1fr; } }
.field { position: relative; }
.field > label, .field > .flabel { position: absolute; top: -9px; inset-inline-start: 10px; z-index: 1; background: #fff; padding: 0 5px; font-size: .78rem; font-weight: 600; color: #5b6673; line-height: 1.2; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field.radio-field > .flabel { position: static; display: block; background: none; padding: 0 0 4px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; font-style: italic; }
.input, select.input, textarea.input { width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: #fff; border: 1px solid #c9d1da; border-radius: 6px; padding: 12px 12px; min-height: 48px; }
textarea.input { min-height: 100px; resize: vertical; }
.input:focus { outline: 3px solid rgba(29,111,209,.18); border-color: var(--blue); }
.input:user-valid { border-color: #2e9e6a; }
.input[disabled] { background: #f3f5f7; color: #8a94a0; }
input[type=file].input { padding: 9px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.radios { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 0; }
.radio { display: inline-flex; align-items: center; gap: 6px; color: #1f7a54; cursor: pointer; }
.radio input { width: 18px; height: 18px; accent-color: #1f7a54; }
.segmented { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.segmented label { flex: 1; min-width: 110px; position: static; background: none; padding: 0; font-size: inherit; color: inherit; white-space: normal; max-width: none; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; text-align: center; padding: 10px 12px; border: 1px solid #c9d1da; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.segmented input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.fsec { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 16px; }
.fsec:first-of-type { border-top: 0; padding-top: 4px; }
.fsec h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15rem; }
.fsec h2 .ico { color: var(--teal); }
.fsec > p { margin: -8px 0 0; }
.pw { position: relative; }
.pw .input { padding-inline-end: 46px; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #6b7783; cursor: pointer; padding: 6px; }
.pw-rules { font-size: .82rem; font-style: italic; color: #4c5662; margin-top: -6px; }
.pw-rules p { margin: 0 0 2px; }
.pw-rules ul { margin: 0; padding-inline-start: 20px; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::marker { content: "✓  "; }
.consent { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; cursor: pointer; }
.consent strong { color: #1f7a54; font-weight: 600; }
.consent.req strong { color: #c0392b; }
.switch { position: relative; flex: none; width: 46px; height: 24px; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; border: 1.5px solid #1f7a54; background: #fff; transition: background .15s; }
.consent.req .switch i { border-color: #c0392b; }
.switch i::after { content: "✕"; position: absolute; inset-inline-end: 6px; top: 3px; font-size: .62rem; font-weight: 700; font-style: normal; color: #555; }
.switch i::before { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 15px; height: 15px; border-radius: 50%; background: #b9c0c7; transition: transform .15s; }
.switch input:checked + i { background: #1f7a54; border-color: #1f7a54; }
.switch input:checked + i::after { content: "✓"; inset-inline-end: auto; inset-inline-start: 6px; color: #fff; }
.switch input:checked + i::before { background: #fff; transform: translateX(22px); }
[dir=rtl] .switch input:checked + i::before { transform: translateX(-22px); }
.switch input:focus-visible + i { outline: 3px solid rgba(29,111,209,.3); }

/* Scelta dell'istruttore */
.ins-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.ins-tools .input { flex: 1; min-width: 200px; }
.ins-list { display: grid; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px; }
@media (min-width: 760px) { .ins-list { grid-template-columns: 1fr 1fr; } }
.ins-card { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; background: #fff; position: relative; }
.ins-card:hover { border-color: #b7c4d3; }
.ins-card input { position: absolute; opacity: 0; }
.ins-card:has(input:checked) { border-color: var(--teal); background: #effafb; box-shadow: 0 0 0 3px rgba(0,168,181,.15); }
.ins-card:has(input:checked)::after { content: "✓"; position: absolute; top: 8px; inset-inline-end: 10px; color: #fff; background: var(--teal); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.ins-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ins-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); }
.ins-bio { font-size: .85rem; color: #46505b; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Richieste */
.req-card.pending { border-inline-start: 5px solid #f2c94c; }
.req-card.accepted { border-inline-start: 5px solid #27ae60; }
.req-card.rejected { border-inline-start: 5px solid #eb5757; opacity: .85; }
.req-top { display: flex; gap: 14px; align-items: flex-start; }
.req-top h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.req-top p { margin: 0 0 4px; }
.quote { margin: 8px 0 0; padding: 8px 12px; border-inline-start: 3px solid var(--teal); background: #f4f8fa; border-radius: 4px; font-size: .92rem; }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.req-actions .input { flex: 1; min-width: 200px; min-height: 44px; padding: 8px 12px; }

/* Workshop e documenti */
.ws-grid, .doc-grid { display: grid; gap: 12px; }
@media (min-width: 900px) { .ws-grid, .doc-grid { grid-template-columns: 1fr 1fr; } }
.ws-card, .doc-card { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; margin: 0; }
.ws-card:hover { text-decoration: none; transform: translateY(-1px); }
.ws-card.past { opacity: .72; }
.ws-card h3, .doc-card h3 { margin: 0 0 2px; }
.ws-card p { margin: 0; }
.ws-date { flex: none; width: 60px; text-align: center; border-radius: 8px; background: linear-gradient(160deg, #e67e22, #c0560e); color: #fff; padding: 6px 0; }
.ws-date b { display: block; font-size: 1.5rem; line-height: 1; }
.ws-date span { font-size: .72rem; }
.fee-list { margin: 0 0 12px; padding-inline-start: 20px; }

/* Grafici 3D */
.chart-card h2 { display: flex; align-items: center; gap: 8px; }
.chart { width: 100%; height: auto; filter: drop-shadow(0 5px 8px rgba(0,0,0,.22)); }
.chart .lbl { fill: #2b323a; }
.chart .val { fill: #46505b; font-weight: 600; }
.chart .axis { stroke: #c9d1da; }
.pie3d { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.pie3d svg { width: 250px; height: 195px; flex: none; max-width: 100%; filter: drop-shadow(0 8px 10px rgba(0,0,0,.28)); }
.legend { flex: 1; min-width: 180px; display: grid; gap: 4px; }
.legend.row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.lg { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.lg i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.lg span { flex: 1; }
.lg b { font-weight: 600; color: var(--muted); white-space: nowrap; }

/* ---------- Pulsanti ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap; background: var(--blue); color: #fff; }
.btn:hover { text-decoration: none; filter: brightness(.94); }
.btn.navy { background: linear-gradient(160deg, #2b2f36, #14171b); }
.btn.ghost { background: #fff; color: var(--text); border-color: #c9d1da; }
.btn.ok { background: var(--ok); }
.btn.danger { background: #fff; color: var(--err); border-color: #efc4bf; }
.btn.wa { background: #1f9d55; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn.lg { min-height: 52px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head .btn { box-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* ---------- Avvisi ---------- */
.alert { display: flex; gap: 10px; align-items: center; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: .95rem; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.alert ul { margin: 0; padding-inline-start: 18px; }
.alert-ok { background: #e3f4ea; color: #145c3f; }
.alert-err { background: #fbe4e1; color: #8a241c; }
.alert-warn { background: #fdf0d3; color: #7a5206; }
.alert-info { background: #e3eefb; color: #164f95; }
.alert-link { text-decoration: none; }
.alert-link span { flex: 1; }
.alert-link:hover { text-decoration: none; filter: brightness(.97); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .ico { color: #b4c0cf; margin-bottom: 6px; }
.code-chip { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; background: #f3f5f8; border: 1px dashed #b9c6d6; border-radius: 6px; padding: 2px 8px; color: var(--ink); }
.summary { background: var(--bg); border-radius: 8px; padding: 14px; display: grid; gap: 6px; }
.summary .line { display: flex; justify-content: space-between; }
.summary .total { font-size: 1.15rem; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- Pagine di accesso e registrazione ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; color: #fff; background: rgba(24,27,32,.6); }
.auth-top img.logo2 { height: 52px; width: auto; }
.auth-box { flex: 1; display: flex; justify-content: center; padding: 26px 14px 40px; }
.auth-col { width: 100%; max-width: 460px; }
.auth-box.wide .auth-col { max-width: 980px; }
.auth-title { color: #fff; font-size: 1.9rem; font-weight: 800; text-transform: uppercase; text-shadow: 0 2px 8px rgba(0,0,0,.35); margin: 0 0 14px; }
.auth-card { width: 100%; background: #fff; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.35); padding: 26px 20px; }
.auth-card.wide, .auth-card.xwide { max-width: none; }
.auth-card h1 { font-size: 1.4rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (min-width: 640px) { .auth-card { padding: 34px 36px; } }

/* ---------- Negozio ---------- */
.products { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.product .ph { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #dfe5ec, #f5f7f9); display: grid; place-items: center; color: #9fb0c6; }
.product .ph img { width: 100%; height: 100%; object-fit: cover; }
.product .bd { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product .pr { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.product form { margin-top: auto; }
.qty { width: 74px; text-align: center; }
.pub-top { background: rgba(24,27,32,.92); color: #fff; }
.pub-top .in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.pub-top img { height: 40px; width: auto; max-width: 46vw; }
.pub-top a { color: #fff; }
.pub-main { max-width: 1100px; width: 100%; margin: 0 auto; padding: 22px 16px 60px; flex: 1; }
.pub-main > .page-head h1, .pub-main > .page-head p { color: #fff; }

/* ---------- Varie ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-block: 0 14px; padding-inline: 26px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
details.more summary { cursor: pointer; color: var(--blue); font-weight: 650; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
.install-banner { display: none; }
.install-banner.show { display: flex; }

/* ---------- Selettore lingua ---------- */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; cursor: pointer; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu .lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 50; min-width: 160px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 6px; }
.lang-menu .lang-list a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .95rem; }
.lang-menu .lang-list a:hover { background: var(--bg); }
.lang-menu .lang-list a.on { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.lang-auth { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: .9rem; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); }
.lang-auth:hover { background: rgba(255,255,255,.12); }

/* ---------- Arabo: lettura da destra a sinistra ---------- */
[dir=rtl] .ico[class*=arrow], [dir=rtl] .crumb .ico { transform: scaleX(-1); }
[dir=rtl] .ins-card:has(input:checked)::after { inset-inline-end: 10px; }

/* ---------- Finestra di conferma (es. registrazione completata) ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(10,12,16,.6); display: grid; place-items: center; padding: 20px; }
.modal-box { background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.4); padding: 30px 26px 24px; max-width: 440px; width: 100%; text-align: center; }
.modal-box h2 { font-size: 1.35rem; margin: 12px 0 8px; }
.modal-box p { color: var(--muted); margin-bottom: 20px; }
.modal-ok { width: 74px; height: 74px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #34c77b, #1f8f61); box-shadow: 0 6px 18px rgba(31,143,97,.4); }

/* ---------- Negozio: filtri per categoria e miniature ---------- */
.chips-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fchip { background: rgba(255,255,255,.92); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: .88rem; font-weight: 600; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.fchip:hover { text-decoration: none; background: #fff; }
.fchip.on { background: var(--teal); color: #fff; }
.pthumb { width: 52px; height: 52px; flex: none; border-radius: 8px; overflow: hidden; background: #eef1f4; display: grid; place-items: center; color: #9aa5b1; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.product .actions select.input { min-height: 42px; padding: 8px 10px; }

/* ---------- Contratto (PDF nella pagina) ---------- */
.pdf-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #f3f5f8; }
.price-old { text-decoration: line-through; color: var(--muted); font-weight: 500; font-size: .92rem; margin-inline-end: 6px; }
.disc-badge { display: inline-block; background: #eb5757; color: #fff; border-radius: 6px; padding: 1px 7px; font-size: .75rem; font-weight: 700; margin-inline-start: 6px; vertical-align: middle; }

.discount-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.disc-input { display: flex; align-items: center; gap: 6px; }
.disc-input .input { width: 96px; text-align: center; }
.disc-input span { font-weight: 700; }
.flow { margin: 0 0 10px; padding-inline-start: 22px; display: grid; gap: 6px; }
.segmented .combo span small{font-weight:600;opacity:.85;margin-left:4px}
.sess-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px;margin-bottom:18px}
.sess p{margin:.4em 0}
.sess-free{font-weight:700;color:#27ae60}
.teacher-mini{display:flex;align-items:center;gap:12px;margin-bottom:6px}
.lang-chips{display:flex;flex-wrap:wrap;gap:8px;padding-top:18px}
.lchip{display:inline-flex;cursor:pointer}
.lchip input{position:absolute;opacity:0;pointer-events:none}
.lchip span{padding:6px 12px;border:1px solid #c9d2e0;border-radius:999px;font-size:.9rem;background:#fff;color:#33415c;transition:.15s}
.lchip input:checked+span{background:#00a8b5;border-color:#00a8b5;color:#fff;font-weight:600}
.lchip input:focus-visible+span{outline:2px solid #2f80ed;outline-offset:2px}
.ins-langs{display:block;font-size:.85rem;color:#33415c;margin-top:2px}
.ins-tools .ins-lang{max-width:240px}

/* 3.0.6 - telefono: tabelle scorrevoli in orizzontale (righe leggibili) e scheda profilo a capo */
.profile-card .grow { flex: 1 1 260px; min-width: 0; }
@media (max-width: 700px) {
  .table-wrap { margin: 0 -4px; padding-bottom: 4px; background:
      linear-gradient(to right, var(--card, #fff) 30%, rgba(255,255,255,0)) left / 24px 100% no-repeat local,
      linear-gradient(to left, var(--card, #fff) 30%, rgba(255,255,255,0)) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), transparent) left / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), transparent) right / 10px 100% no-repeat scroll; }
  .table-wrap table.tbl { min-width: 640px; }
  .tbl td.small { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---- 3.0.7: tipi di kit, tessera iscritto ---- */
.kit-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.kit-type { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line, #dfe5ec); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; }
.kit-type input { margin-top: 4px; accent-color: #2f80ed; }
.kit-type strong { display: block; font-size: 1.02rem; }
.kit-type strong em { font-style: normal; color: #2f80ed; margin-left: 6px; }
.kit-type small { display: block; color: #5d6b7e; line-height: 1.45; margin-top: 3px; }
.kit-type:has(input:checked) { border-color: #2f80ed; box-shadow: 0 0 0 3px rgba(47,128,237,.15); }
.kit-type:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.member-card { max-width: 560px; border-radius: 18px; padding: 18px 20px; margin: 0 0 18px; color: #fff; background: linear-gradient(135deg, #0b2545 0%, #0e7c86 100%); box-shadow: 0 14px 34px rgba(11,37,69,.35); }
.member-card.off { background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%); }
.member-card .mc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.member-card .mc-top img { height: 38px; }
.member-card .mc-badge { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.18); border-radius: 999px; padding: 4px 10px; }
.member-card .mc-body { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.member-card .mc-body > div:nth-child(2) { flex: 1; min-width: 160px; }
.member-card .mc-name { font-size: 1.3rem; font-weight: 700; }
.member-card .mc-num { font-family: ui-monospace, monospace; opacity: .85; }
.member-card .mc-until { margin-top: 4px; font-weight: 600; }
.member-card .mc-qr { width: 112px; height: 112px; background: #fff; border-radius: 10px; padding: 4px; }
.member-card .mc-qr svg { width: 100%; height: 100%; display: block; }
.section-title { font-size: 1.15rem; font-weight: 700; color: #fff; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.video-admin li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; }
.video-admin li.off { opacity: .6; }
.video-admin .thumb img { width: 168px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; background: #000; }
.video-admin .form { display: flex; flex-direction: column; gap: 8px; }
.video-admin .mono { word-break: break-all; }
@media (max-width: 700px) { .video-admin li { flex-direction: column; } .video-admin .thumb img { width: 100%; } }
@media (max-width: 560px) {
  .pub-top .in { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .pub-top .in > div[style*="flex:1"] { flex-basis: 100%; height: 0; }
  .pub-top img { height: 34px; }
  .pub-top .tb-btn { padding: 6px 9px; font-size: .9rem; }
}
