:root {
  --bg: #FFFFFF;
  --card: #F4F4F5;
  --green: #68B42E;
  --text: #09090B;
  --white: #FFFFFF;
  --muted: #71717A;
  --border: #E4E4E7;
  --accent-glow: rgba(104,180,46,0.15);
  --font-title: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  width: 100%;
  padding-bottom: 110px;
  position: relative;
}

/* radial glows - disabled for white theme */
.radial-glow {
  display: none;
}

.glow-1 {
  display: none;
}

.glow-2 {
  display: none;
}

.app {
  width: 100%;
  max-width: 480px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

header {
  text-align: center;
  margin: 10px 0 20px 0;
  width: 100%;
}

.logo-box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-box img {
  max-height: 70px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.08));
}

/* PANEL */
.panel {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  color: var(--text);
}

.small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* INPUTS & SELECTS */
input, select {
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 0 16px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder {
  color: #A1A1AA;
}

/* BUTTONS */
button {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
}

.btn-dark {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
  font-family: var(--font-body);
  font-weight: 600;
}
.btn-dark:hover {
  background: #ECECED;
}

.btn-clean {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  height: 34px;
  padding: 0 14px;
  width: auto;
  border-radius: 10px;
  box-shadow: none;
  font-family: var(--font-body);
}

.btn-logout-danger {
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.06);
  color: #ef4444;
}

.btn-red {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: #ef4444;
  box-shadow: none;
  font-family: var(--font-title);
  font-weight: 800;
}
.btn-red:hover {
  background: rgba(239,68,68,0.14);
}

.btn-white {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}

.btn-timer {
  background: var(--card);
  border: 1.5px solid var(--green);
  color: var(--text);
  box-shadow: none;
}

.btn-green-modal {
  background: var(--green);
  color: var(--white);
  font-weight: 800;
  border: none;
  width: 100%;
  height: 48px;
  border-radius: 12px;
}

/* APP BOTTOM NAVIGATION */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 80px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 12px);
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #A1A1AA;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bottom-nav .nav-item .nav-icon-wrapper {
  padding: 6px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.bottom-nav .nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  transition: all 0.2s ease;
}

.bottom-nav .nav-item.active {
  color: var(--green);
}

.bottom-nav .nav-item.active .nav-icon-wrapper {
  background: rgba(104,180,46,0.1);
  color: var(--green);
}

.bottom-nav .nav-item.active svg {
  transform: translateY(-1px);
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

.coach-badge {
  font-size: 11px;
  background: rgba(104,180,46,0.1);
  border: 1px solid rgba(104,180,46,0.3);
  color: var(--green);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 800;
  text-transform: uppercase;
  font-family: var(--font-title);
}

/* HORIZONTAL SELECTORS (PREMIUM PILLS) */
.premium-selectors {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.horizontal-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.horizontal-scroll::-webkit-scrollbar {
  display: none;
}

.scroll-pill {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scroll-pill:hover {
  background: #ECECED;
}

.scroll-pill.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  font-weight: 800;
}

/* CARDS */
.workout-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 2px 8px rgba(0,0,0,0.02);
  transition: transform 0.2s, border-color 0.2s;
}

.workout-card.premium-card {
  background: var(--white);
}

.premium-card-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
}

.workout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.workout-title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
}

.workout-details {
  font-size: 12px;
  color: var(--muted);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  background: var(--card);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.set-matrix-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FAFAFA;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 14px;
  transition: all 0.2s ease;
}

.set-row.completed {
  background: rgba(104,180,46,0.08);
  border-color: rgba(104,180,46,0.35);
}

.set-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  width: 45px;
}

.set-row input {
  height: 38px;
  margin: 0;
  font-size: 14px;
  padding: 0 10px;
  text-align: center;
  border-radius: 8px;
  border-width: 1px;
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}

.set-row button {
  height: 38px;
  margin: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  width: 44px;
  background: var(--green);
  color: var(--white);
  box-shadow: none;
}

.set-row.completed button {
  background: transparent;
  border: 1.5px solid var(--green);
  color: var(--green);
}

/* TIMER RECUPERO */
.timer-container {
  display: none;
  text-align: center;
  margin: 12px 0;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
}

.timer-time {
  font-size: 42px;
  font-weight: 900;
  color: var(--green);
  font-family: monospace;
  letter-spacing: 2px;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 8px;
}

.timer-controls button {
  height: 34px;
  width: 56px;
  margin: 0;
  font-size: 12px;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

/* CREDITI PREMIUM CARD */
.premium-credit-card {
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(104,180,46,0.08) 0%, var(--white) 100%);
  border: 1px solid rgba(104,180,46,0.2);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.premium-credit-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 120px;
  height: 120px;
  background: var(--green);
  opacity: 0.06;
  border-radius: 50%;
  filter: blur(30px);
}

/* SLOTS */
.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 48vh;
  overflow-y: auto;
  padding-bottom: 12px;
}

.slot-card {
  width: 100%;
  min-height: 64px;
  padding: 14px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
  color: var(--text);
}

.slot-libero {
  border: 1.5px solid var(--green);
  color: var(--green);
  background: rgba(104,180,46,0.04);
}

.slot-libero.selezionato {
  background: var(--green);
  color: var(--white);
}

.slot-libero.selezionato span {
  color: var(--white) !important;
}

.slot-attuale {
  border: 1.5px solid var(--green);
  background: rgba(104,180,46,0.1);
}

.slot-attuale.selezionato {
  background: #ef4444;
  border-color: #ef4444;
  color: var(--white);
}

.slot-spostabile {
  border: 1.5px solid var(--text);
  background: var(--white);
}

.slot-spostabile.selezionato {
  background: var(--text);
  color: var(--white);
}

.slot-spostabile.selezionato span {
  color: var(--white) !important;
}

/* OVERLAYS & STATUS */
#risultato {
  margin-top: 10px;
  padding: 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}

#loaderOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255,255,255,0.96);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#loaderOverlay h3 {
  color: var(--green);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 1px;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content.glass {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  color: var(--text);
}

/* WIZARD QUESTIONNAIRE */
.questionario-modal {
  max-width: 440px;
  text-align: left;
  border-radius: 24px !important;
}

.step-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.step-progress {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--green);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.step-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.step-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.quest-container h2 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 18px;
  line-height: 1.35;
  color: var(--text);
}

.quest-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  padding: 16px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-card:hover {
  background: var(--card);
}

.option-card.selected {
  border-color: var(--green);
  background: rgba(104,180,46,0.08);
  color: var(--green);
}

/* WIZARD NO CARD BOX */
.no-card-box {
  padding: 30px 10px;
  text-align: center;
}

.card-glow-border {
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 30px 24px;
  position: relative;
  overflow: hidden;
}

.ai-spark-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.no-card-content h3 {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.no-card-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* CUSTOM FILE UPLOAD */
.custom-file-upload {
  margin-top: 8px;
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.custom-file-upload input[type="file"] {
  height: auto;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 12px;
}
