/* =============================================================================
   MyPT AI PWA - tema scuro, mobile-first
   ============================================================================= */
:root {
  --bg: #0e1117;
  --bg-soft: #161b24;
  --card: #1b2230;
  --card-2: #212a3a;
  --border: #2b3648;
  --text: #e6eaf2;
  --text-dim: #8b95a7;
  --accent: #4f8cff;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 16px;
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  overscroll-behavior-y: none;
}

body { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 40px); }

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  /* safe-area-inset-top: su iPhone con notch il contenuto dell'header
     (titolo + badge Readiness) scenderebbe sotto l'orologio/notch. */
  padding: calc(12px + var(--safe-top)) 16px calc(10px + var(--safe-bottom) * 0.3);
  background: rgba(14, 17, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-brand { display: flex; align-items: center; gap: 10px; }
/* Logo ufficiale MyPT AI nell'header (img quadrata arrotondata) */
.brand-logo {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px; object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 210, 255, .3);
}
.app-header h1 { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.header-sub { font-size: 11.5px; color: var(--text-dim); }

.pill {
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border);
}
.pill-green { background: rgba(34,197,94,.15); color: var(--green); border-color: rgba(34,197,94,.4); }
.pill-amber { background: rgba(245,158,11,.15); color: var(--amber); border-color: rgba(245,158,11,.4); }
.pill-red   { background: rgba(239,68,68,.15);  color: var(--red);   border-color: rgba(239,68,68,.4); }
.pill-neutral { color: var(--text-dim); }

/* ---------- main / tabs ---------- */
main { max-width: 560px; margin: 0 auto; padding: 16px 14px; }
.tab { display: none; animation: fadeIn .25s ease; }
.tab.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { font-size: 16px; margin-bottom: 10px; }
.card h3 { font-size: 14px; margin-bottom: 8px; color: var(--text-dim); }

.hidden { display: none !important; }
.hint { font-size: 12px; color: var(--text-dim); margin: 6px 0; }

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: 12px; padding: 12px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text); background: var(--card-2);
  transition: filter .15s, transform .05s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-warn { background: var(--amber); color: #111; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.spin {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: rot .7s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- readiness gauge ---------- */
.readiness-card { display: flex; flex-direction: column; align-items: center; padding: 10px 0 4px; }
.gauge-wrap { position: relative; }
.gauge-track { fill: none; stroke: var(--border); stroke-width: 14; }
.gauge-arc {
  fill: none; stroke-width: 14; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 100px 100px;
  transition: stroke-dasharray .8s cubic-bezier(.4,0,.2,1);
}
.gauge-value { font-size: 44px; font-weight: 800; fill: var(--text); text-anchor: middle; }
.gauge-label { font-size: 13px; fill: var(--text-dim); text-anchor: middle; }
.readiness-meta { display: flex; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-dim); }
.readiness-meta b { color: var(--text); display: block; font-size: 15px; }

.comp-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; font-size: 13px; }
.comp-row .comp-name { width: 124px; color: var(--text-dim); flex-shrink: 0; font-size: 11px; line-height: 1.25; }
.comp-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.comp-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s; }
.comp-row .comp-val { width: 38px; text-align: right; font-weight: 700; }

.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.meta-cell { background: var(--bg-soft); border-radius: 12px; padding: 10px 8px; text-align: center; }
.meta-cell .v { font-size: 15px; font-weight: 700; }
.meta-cell .k { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; }

.act-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.act-row:last-child { border-bottom: none; }
.act-row .tag {
  font-size: 10px; padding: 2px 8px; border-radius: 99px; background: var(--card-2);
  color: var(--accent); font-weight: 700;
}

/* ---------- workout ---------- */
textarea, input[type="text"], input[type="number"] {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 12px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; }
textarea:focus, input:focus { outline: none; border-color: var(--accent); }
.toggle-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.toggle-row input { width: 17px; height: 17px; accent-color: var(--amber); }

.workout-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.workout-head h3 { font-size: 15px; color: var(--text); margin: 0; }
.phase { border-left: 3px solid var(--accent); padding: 8px 10px; margin: 8px 0; background: var(--bg-soft); border-radius: 0 10px 10px 0; font-size: 13px; }
.phase .p-tag { font-weight: 700; color: var(--accent); text-transform: uppercase; font-size: 11px; }
.phase .p-detail { color: var(--text-dim); font-size: 12px; }
.sync-ok { color: var(--green); font-weight: 700; }
.sync-err { color: var(--red); font-weight: 600; }

/* ---------- sezione Allenamento: card stato Garmin / consiglio adattivo ---------- */
.garmin-cal {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border);
}
.garmin-cal .cal-icon { font-size: 22px; line-height: 1.3; }
.garmin-cal b { display: block; margin-bottom: 2px; }
.garmin-cal .p-detail { color: var(--text-dim); font-size: 12px; }
.garmin-cal.ok { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .35); }
.garmin-cal.empty { background: var(--bg-soft); }
.garmin-cal.warn { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .35); }
.badge {
  display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-ok { background: rgba(34, 197, 94, .15); color: var(--green); }
.advice-banner {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border); margin-bottom: 10px;
}
.advice-banner .advice-icon { font-size: 24px; line-height: 1.2; }
.advice-banner .advice-title { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.advice-banner p { font-size: 13px; color: var(--text); opacity: .9; }
.advice-banner.ok { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .35); }
.advice-banner.ok .advice-title { color: var(--green); }
.advice-banner.warn { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .4); }
.advice-banner.warn .advice-title { color: var(--red); }
.advice-banner.neutral { background: var(--bg-soft); }
.advice-banner.neutral .advice-title { color: var(--text-dim); }
.advice-workout {
  border: 1px dashed var(--border); border-radius: 12px;
  padding: 10px 12px; margin: 4px 0 10px;
}
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* ---------- body map (infortuni) ---------- */
/* ---------- INJURY LAB 3.0: Card Anatomiche Executive Neon ---------- */
.body-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.body-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px; border-radius: 16px; text-align: left; cursor: pointer;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  box-shadow: inset 0 0 24px rgba(255,255,255,.02);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.body-card:active { transform: scale(.97); }
/* bordo neon perimetrale in tinta con l'accent della card */
.body-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: linear-gradient(135deg, var(--card-accent), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; opacity: .85;
}
.body-card:hover {
  border-color: color-mix(in srgb, var(--card-accent) 40%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--card-accent) 18%, transparent);
}
.body-card-icon { font-size: 30px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--card-accent) 55%, transparent)); }
.body-card-txt b { font-size: 13.5px; display: block; color: var(--text); }
.body-card-txt small { font-size: 11px; color: var(--text-dim); line-height: 1.35; display: block; margin-top: 2px; }
.card-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.card-badge {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #0e1117; box-shadow: 0 0 9px currentColor;
}
.legend { display: flex; justify-content: center; gap: 14px; font-size: 11px; color: var(--text-dim); margin-top: 12px; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.dot-1 { background: #facc15; } .dot-3 { background: #f97316; } .dot-4 { background: #ef4444; }

.injury-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--border); font-size: 13.5px;
}
.injury-item:last-child { border-bottom: none; }
.injury-item .sev { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex-shrink: 0; }
.injury-item .inf { flex: 1; }
.injury-item .inf b { font-size: 14px; }
.injury-item .inf small { display: block; color: var(--text-dim); }
.injury-item .resolved { text-decoration: line-through; opacity: .55; }
.injury-item .del, .injury-item .edit {
  background: none; border: none; font-size: 18px; cursor: pointer; padding: 6px; color: var(--red);
}
.injury-item .edit { color: var(--text-dim); }
.item-actions { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }

/* ---------- INJURY LAB 2.0: impatto biomeccanico + referto ---------- */
.impact-badge {
  display: inline-block; padding: 8px 14px; border-radius: 10px; font-weight: 700;
  font-size: 13.5px; margin: 6px 0 4px;
}
.impact-stop   { background: rgba(239,68,68,.15);  color: var(--red);   border: 1px solid rgba(239,68,68,.4); }
.impact-reduce { background: rgba(245,158,11,.15); color: var(--amber); border: 1px solid rgba(245,158,11,.4); }
.impact-modify { background: rgba(167,139,250,.15); color: #a78bfa;      border: 1px solid rgba(167,139,250,.4); }
.impact-mild   { background: rgba(34,197,94,.12);  color: var(--green); border: 1px solid rgba(34,197,94,.35); }
.impact-chip {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}
.injury-item .inf { flex: 1; }
.report-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); font-size: 12px; padding: 4px 10px; margin-top: 6px;
  cursor: pointer;
}
.report-toggle:hover { border-color: var(--accent); color: var(--accent); }
.injury-report {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
}
.rep-diag { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.rep-block { font-size: 12.5px; color: var(--text-dim); margin: 5px 0; }
.rep-block ul { margin: 3px 0 0 16px; padding: 0; }
.rep-block li { margin: 2px 0; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-box {
  width: 100%; max-width: 480px; background: var(--card);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(22px + var(--safe-bottom));
  border: 1px solid var(--border); border-bottom: none;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.severity-picker { display: flex; gap: 8px; margin: 8px 0 12px; }
.severity-picker button {
  flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer;
  transition: all .12s;
}
.severity-picker button[data-s="1"], .severity-picker button[data-s="2"] { color: #facc15; border-color: rgba(250,204,21,.35); }
.severity-picker button[data-s="3"] { color: #f97316; border-color: rgba(249,115,22,.35); }
.severity-picker button[data-s="4"], .severity-picker button[data-s="5"] { color: #ef4444; border-color: rgba(239,68,68,.35); }
.severity-picker button.sel {
  background: currentColor; border-color: currentColor; color: #0e1117; font-weight: 800;
  box-shadow: 0 0 12px currentColor;
}
/* step della modale Injury Lab 3.0: parte esatta + severità + nota */
.modal-step {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .4px; margin: 12px 0 6px;
}
.part-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.part-chip {
  padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-align: left; transition: background .12s, border-color .12s, color .12s;
}
.part-chip.sel {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 10px rgba(79,140,255,.35);
}
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }

/* ---------- goals ---------- */
.segmented { display: flex; background: var(--bg-soft); border-radius: 12px; padding: 4px; margin: 10px 0; }
.seg-btn { flex: 1; border: none; background: transparent; color: var(--text-dim); padding: 10px; border-radius: 9px; font-weight: 700; font-size: 14px; cursor: pointer; }
.seg-btn.sel { background: var(--accent); color: #fff; }
.time-inputs { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.time-inputs input { text-align: center; font-size: 22px; font-weight: 700; padding: 10px 6px; }
.time-inputs span { font-size: 22px; color: var(--text-dim); font-weight: 700; }
.goal-result { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg-soft); font-size: 13px; text-align: center; }
.goal-result b { font-size: 18px; color: var(--green); }
.threshold-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.th-item { background: var(--bg-soft); border-radius: 12px; padding: 10px 4px; text-align: center; }
.th-val { display: block; font-size: 17px; font-weight: 800; color: var(--accent); }
.th-lab { font-size: 9.5px; color: var(--text-dim); }

/* ---------- tabella multisettimanale adattiva ---------- */
.day-picker { display: flex; gap: 6px; margin: 10px 0 14px; flex-wrap: wrap; }
.day-btn {
  flex: 1; min-width: 42px; padding: 10px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--text-dim); font-weight: 700; font-size: 12.5px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.day-btn.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.tbl-syncall { padding: 8px 12px; font-size: 12px; }
.tbl-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--border); font-size: 13.5px;
}
.tbl-row:last-child { border-bottom: none; }
.tbl-row.today { background: var(--bg-soft); border-radius: 12px; padding: 10px; border-bottom: none; }
.tbl-date { width: 78px; flex-shrink: 0; font-size: 11.5px; color: var(--text-dim); line-height: 1.3; padding-top: 1px; }
.tbl-date .today-tag { display: block; margin-top: 4px; text-align: center; }
.tbl-info { flex: 1; }
.tbl-info .p-detail { margin-top: 2px; }
.tbl-badges { margin-top: 4px; font-size: 10.5px; color: var(--accent); font-weight: 700; }
.tbl-row.rest .tbl-info b { color: var(--text-dim); }
.tbl-sync { padding: 7px 10px; font-size: 13px; flex-shrink: 0; }
.goal-date-label { display: block; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.goal-date-label small { color: var(--text-dim); opacity: .8; }

/* ---------- chat ---------- */
.tab-chat { display: flex; flex-direction: column; }
.chat-log { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 10px; }
.bubble { max-width: 84%; padding: 10px 13px; border-radius: 16px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.coach { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.workout { align-self: flex-start; background: var(--card); border: 1px solid var(--accent); border-bottom-left-radius: 5px; max-width: 94%; font-size: 13px; }
.bubble.warn { align-self: flex-start; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.5); color: #fca5a5; border-bottom-left-radius: 5px; }
.chat-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.chat-actions .btn { flex: 1; font-size: 12.5px; padding: 10px 8px; }
.chat-input-row { display: flex; gap: 8px; position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom)); background: var(--bg); padding: 8px 0; }
.chat-input-row input { flex: 1; }
.chat-input-row .btn { width: 46px; padding: 0; }

/* ---------- Onboarding / login (connetti Garmin) ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(56,189,248,.12), transparent),
              linear-gradient(160deg, #0e1117 0%, #0a0d13 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.login-box {
  width: 100%; max-width: 380px;
  background: rgba(22, 27, 38, .92);
  border: 1px solid rgba(56, 189, 248, .25);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(56,189,248,.06) inset;
  text-align: left;
}
/* Hero immagine onboarding: vincolata (logo ufficiale MyPT AI) */
.hero-img-constrained {
  max-width: 160px;
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px auto;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 210, 255, 0.25);
}
.login-box h2 {
  font-size: 21px; margin-bottom: 6px; text-align: center;
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* ===== LOCK TIPOGRAFIA ONBOARDING (regole immutabili) =====
   !important: nessun stile inline/JS può sovrascrivere la tipografia dell'onboarding */
.modal-title {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  text-align: center;
  margin-bottom: 8px;
}
.login-subtitle {
  font-size: 0.92rem !important;
  font-weight: 400 !important;
  color: #94a3b8 !important;
  text-align: center;
  line-height: 1.5 !important;
  margin-bottom: 20px;
}
.login-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-mid);
  margin: 14px 0 6px; letter-spacing: .3px;
}
.login-box input {
  width: 100%; padding: 12px 14px;
  background: rgba(10, 13, 20, .7);
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 12px;
  color: var(--text); font-size: 14px;
  text-align: left; letter-spacing: normal;
}
.login-box input:focus {
  border-color: rgba(56, 189, 248, .7);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .15);
  outline: none;
}
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; font-weight: 600; text-align: center; }
.login-err.amber { color: #fbbf24; } /* avviso rate limit (429): ambra, non rosso */
.login-note {
  font-size: 12px; color: var(--text-dim); margin-top: 16px;
  text-align: center; line-height: 1.5;
}
.login-box .btn { margin-top: 18px; }

/* ---------- Footer Privacy & GDPR ---------- */
.app-footer {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px;
  padding: 8px 12px calc(var(--safe-bottom) + 6px);
  font-size: 11px; z-index: 5;
  background: linear-gradient(transparent, var(--bg) 65%);
  pointer-events: none;
}
.app-footer .footer-link { pointer-events: auto; }
.footer-link {
  background: none; border: none; color: var(--text-dim);
  font-size: 11px; text-decoration: underline; cursor: pointer;
  padding: 4px 6px; font-family: inherit;
}
/* Firma del founder (link Instagram) */
.creator-sign {
  flex-basis: 100%; text-align: center;
  margin: 8px 0 0; padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: var(--text-dim); font-size: 10.5px;
  pointer-events: auto;
}
.creator-sign a {
  color: var(--accent); text-decoration: none; font-weight: 600;
}
.footer-link.danger { color: #f87171; }

/* ---------- Privacy / GDPR ---------- */
.privacy-body { text-align: left; font-size: 13px; color: var(--text-mid); line-height: 1.55; }
.privacy-body p { margin: 0 0 10px; }
.privacy-consent {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: rgba(56, 189, 248, .07); border: 1px solid rgba(56, 189, 248, .25);
  border-radius: 12px; padding: 10px 12px; margin-top: 14px;
  font-size: 12.5px; color: var(--text-mid); line-height: 1.45; cursor: pointer;
}
.privacy-consent input { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.privacy-consent a { color: var(--accent); text-decoration: underline; }
/* Documenti legali: contenuto scorrevole dentro la modale */
.legal-scroll { max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.legal-scroll h4 { margin: 14px 0 6px; color: var(--text); font-size: 13px; }
.legal-scroll h4:first-child { margin-top: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 26px);
  transform: translateX(-50%); z-index: 60;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  animation: fadeIn .2s ease;
}

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: rgba(14,17,23,.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  height: calc(var(--nav-h) + var(--safe-bottom));
}
.nav-btn {
  flex: 1; background: none; border: none; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; font-weight: 600; cursor: pointer; padding: 4px 0;
}
.nav-btn .nav-ico { font-size: 20px; filter: grayscale(.5); opacity: .8; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-ico { filter: none; opacity: 1; }
