/* ================= DESIGN SYSTEM: LIGHT MINIMAL (BIANCO, ANTRACITE, ROSSO) ================= */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-elevated: #f9fafb;
  --accent: #e53935;
  --accent-glow: rgba(229, 57, 53, 0.18);
  --accent-dim: rgba(229, 57, 53, 0.10);
  --gold: #d97706;
  --info: #181b20;
  --danger: #dc2626;
  --text: #181b20;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-light: #d1d5db;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  color: var(--text);
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 115px 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: -0.025em; font-weight: 800; color: var(--text); }
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.05);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }

.home-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 124px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.04);
  transition: transform 0.14s ease, border-color 0.2s;
}
.home-tile:active { transform: scale(0.96); border-color: var(--accent); }

.tile-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}

.tile-title { font-size: 15px; font-weight: 800; color: var(--text); }
.tile-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}
.stat-val { font-size: 20px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-top: 3px; }
/* ================= PULSANTI & INPUT ================= */
label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

input, select, textarea {
  width: 100%;
  background: var(--surface-elevated);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
  width: 100%;
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: #ffffff;
  border: none;
  padding: 15px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px -4px rgba(229, 57, 53, 0.45);
  transition: transform 0.14s ease;
}
.btn:active { transform: scale(0.97); }

.btn-sec {
  width: 100%;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-light);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-sec:active { transform: scale(0.97); background: var(--bg); }

.btn-gold {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn-danger {
  width: 100%;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.smart-suggestion {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.5;
}

.badge-ss {
  display: inline-block;
  background: #181b20;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

/* ================= FLUSSO GUIDATO WORKOUT ================= */
.progress-segments { display: flex; gap: 6px; margin-bottom: 14px; }
.progress-seg { flex: 1; height: 5px; border-radius: 99px; background: #d1d5db; transition: all 0.25s ease; }
.progress-seg.done { background: var(--accent); opacity: 0.4; }
.progress-seg.active { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.preview-es-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
.preview-es-row.dimmed { opacity: 0.48; background: #f9fafb; }
.preview-es-row.current {
  opacity: 1;
  border: 2px solid var(--accent);
  box-shadow: 0 6px 18px rgba(229, 57, 53, 0.14);
  cursor: pointer;
}

.preview-es-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.preview-es-row.current .preview-es-num { background: var(--accent); color: #ffffff; }

.serie-card-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.serie-card-btn:active { transform: scale(0.98); }
.serie-card-btn.done { border-color: var(--accent); background: #fef2f2; }

.badge-status { font-size: 11px; font-weight: 800; padding: 6px 10px; border-radius: 8px; }
.badge-status.todo { background: var(--bg); color: var(--muted); }
.badge-status.done { background: var(--accent); color: #ffffff; }

.big-input-box {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 12px 10px;
  text-align: center;
}
.big-input-box input {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--accent);
  margin: 4px 0 0 0;
  padding: 2px;
  font-variant-numeric: tabular-nums;
}

/* ================= TIMER FULLSCREEN & FLOATING NAV ================= */
.fullscreen-timer {
  position: fixed;
  inset: 0;
  background: #181b20;
  color: #ffffff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 20px 28px 20px;
  text-align: center;
}
.fullscreen-timer h3 { color: #ffffff; }
.fullscreen-timer .card { background: #232730; border-color: rgba(255,255,255,0.12); color: #ffffff; }

.timer-circle {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 5px solid var(--accent);
  background: rgba(229, 57, 53, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  box-shadow: 0 0 45px rgba(229, 57, 53, 0.3);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 27, 32, 0.65);
  backdrop-filter: blur(8px);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card { background: #ffffff; border-radius: 20px; padding: 20px; width: 100%; max-width: 460px; max-height: 85vh; overflow-y: auto; }

.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 492px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 22px;
  display: flex;
  justify-content: space-around;
  padding: 8px 6px;
  z-index: 900;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.nav-item .nav-icon { font-size: 18px; }
.nav-item.active { color: var(--accent); background: var(--accent-dim); }
.nav-item.vip.active { color: var(--gold); background: rgba(217, 119, 6, 0.12); }

canvas { width: 100% !important; display: block; }
