/* ═══════════════════════════════════════════════════════════════════════════
   SLIM4 CORE APP - STYLES
   Design System basado en plantilla Figma fitness
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   CSS VARIABLES (Design Tokens)
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Colors - Primary */
  --color-primary: #EA7E41;
  --color-primary-hover: #d86f35;
  --color-primary-light: rgba(234, 126, 65, 0.1);
  
  /* Colors - Accent (Pink/Rose from Figma) */
  --color-accent: #DC7D85;
  --color-accent-dark: #C65468;
  --color-accent-light: #ED9C9B;
  
  /* Colors - Success */
  --color-success: #4CAF50;
  --color-success-light: #81C784;
  
  /* Colors - Info */
  --color-info: #4D81E7;
  
  /* Colors - Background */
  --bg-dark: #1A1C1E;
  --bg-light: #F6F6F6;
  --bg-card: #FFFFFF;
  --bg-card-dark: rgba(245, 245, 245, 0.1);
  
  /* Colors - Text */
  --text-primary: #1A1C1E;
  --text-secondary: #6C7278;
  --text-muted: #ACB5BB;
  --text-light: #FFFFFF;
  --text-on-dark: #DCE4E8;
  
  /* Typography */
  --font-primary: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Fraunces', serif;
  
  /* Font Sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  
  /* Border Radius */
  --radius-sm: 7px;
  --radius-md: 13px;
  --radius-lg: 16px;
  --radius-xl: 70px;
  --radius-full: 100px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 24px 64px -10px rgba(0, 0, 0, 0.15);
  --shadow-button: 0 14px 44px rgba(0, 0, 0, 0.25);
  
  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 44px);
  --safe-bottom: env(safe-area-inset-bottom, 34px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-light);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--bg-light);
}

/* ─────────────────────────────────────────────────────────────────────────────
   UTILITIES
   ───────────────────────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.view {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HEADER BAR
   ───────────────────────────────────────────────────────────────────────────── */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  padding-top: calc(var(--safe-top) + var(--space-sm));
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-light);
}

.header-bar-overlay {
  background: transparent;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(245, 245, 245, 0.1);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.header-btn:active {
  transform: scale(0.95);
}

.header-btn-light {
  color: var(--text-light);
}

.header-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.32px;
}

.header-title-light {
  color: var(--text-light);
}

/* ─────────────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────────────── */
.btn-primary {
  background: rgb(101, 163, 13);
  color: var(--text-light);
  border: none;
  border-radius: 8px;
  padding: var(--space-lg) var(--space-2xl);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.32px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-button);
  width: 100%;
  text-align: center;
}

.btn-primary:active {
  transform: scale(0.98);
  background: rgb(85, 138, 10);
}

.btn-large {
  padding: var(--space-xl) var(--space-2xl);
  font-size: var(--text-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: var(--space-md);
  font-size: var(--text-base);
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.btn-secondary:active {
  color: var(--color-primary);
}

.btn-skip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-light);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save {
  background: var(--color-primary);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-save-full {
  width: 100%;
  margin-top: var(--space-sm);
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIEW: HOME
   ───────────────────────────────────────────────────────────────────────────── */
#view-home {
  display: flex;
  flex-direction: column;
}

.home-hero {
  background: linear-gradient(135deg, rgb(7, 89, 133) 0%, rgb(5, 70, 105) 100%);
  padding: calc(var(--safe-top) + var(--space-3xl)) var(--space-xl) var(--space-3xl);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.home-hero-icon {
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 180px;
  height: 180px;
  opacity: 0.15;
  color: var(--text-light);
  z-index: 0;
}

.home-hero-content {
  position: relative;
  z-index: 1;
}

.home-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--text-light);
  line-height: 1.1;
  letter-spacing: -1.92px;
  margin-bottom: var(--space-md);
}

.home-subtitle {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin-bottom: var(--space-lg);
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.2);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-light);
  font-weight: 600;
}

.badge-icon {
  width: 16px;
  height: 16px;
  color: var(--text-light);
}

.home-content {
  padding: var(--space-2xl) var(--space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home-description {
  margin-bottom: var(--space-2xl);
}

.description-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.description-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.6;
}

.home-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-card);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: 2px solid rgba(7, 89, 133, 0.3);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 89, 133, 0.1);
  border-radius: var(--radius-sm);
  color: rgb(7, 89, 133);
}

.feature-icon i,
.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-text {
  display: flex;
  flex-direction: column;
}

.feature-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.feature-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.home-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-bottom: var(--safe-bottom);
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIEW: WEEKS LIST
   ───────────────────────────────────────────────────────────────────────────── */
.weeks-container {
  padding: var(--space-xl);
  padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
}

.weeks-intro {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.weeks-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.month-group {
  margin-bottom: var(--space-lg);
}

.month-weeks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.month-label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 900;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: -0.5px;
  margin-bottom: var(--space-md);
  padding-left: var(--space-sm);
}

.week-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.week-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.week-card-indicator {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-light);
  flex-shrink: 0;
}

/* Colores por fase (resto de semanas) */
.week-card-indicator.phase-adaptacion { background: var(--color-accent-light); }
.week-card-indicator.phase-intensificacion { background: var(--color-accent); }
.week-card-indicator.phase-consolidacion { background: var(--color-accent-dark); }
.week-card-indicator.phase-definicion { background: var(--color-primary); }

/* Colores específicos por semana (todas las 16 semanas) - deben ir después para sobrescribir */
.week-card-indicator.week-1 { background: rgb(56, 189, 248) !important; }
.week-card-indicator.week-2 { background: rgb(14, 165, 233) !important; }
.week-card-indicator.week-3 { background: rgb(2, 132, 199) !important; }
.week-card-indicator.week-4 { background: rgb(3, 105, 161) !important; }
.week-card-indicator.week-5 { background: rgb(6, 182, 212) !important; }
.week-card-indicator.week-6 { background: rgb(8, 145, 178) !important; }
.week-card-indicator.week-7 { background: rgb(14, 116, 144) !important; }
.week-card-indicator.week-8 { background: rgb(21, 94, 117) !important; }
.week-card-indicator.week-9 { background: rgb(163, 230, 53) !important; }
.week-card-indicator.week-10 { background: rgb(132, 204, 22) !important; }
.week-card-indicator.week-11 { background: rgb(101, 163, 13) !important; }
.week-card-indicator.week-12 { background: rgb(77, 124, 15) !important; }
.week-card-indicator.week-13 { background: rgb(251, 113, 133) !important; }
.week-card-indicator.week-14 { background: rgb(244, 63, 94) !important; }
.week-card-indicator.week-15 { background: rgb(225, 29, 72) !important; }
.week-card-indicator.week-16 { background: rgb(190, 18, 60) !important; }

.week-card-content {
  flex: 1;
  min-width: 0;
}

.week-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.week-card-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.week-card-progress {
  display: flex;
  gap: 4px;
  margin-top: var(--space-sm);
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-light);
}

.progress-dot.completed {
  background: var(--color-success);
}

.week-card-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.week-card-check {
  flex-shrink: 0;
}

.check-icon {
  width: 28px;
  height: 28px;
  color: var(--color-success);
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIEW: WEEK DETAIL
   ───────────────────────────────────────────────────────────────────────────── */
.week-detail-hero {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  padding: calc(var(--safe-top) + 60px) var(--space-xl) var(--space-2xl);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: relative;
  min-height: 220px;
  overflow: hidden;
}

.week-detail-hero-number {
  position: absolute;
  bottom: -30px;
  right: -20px;
  font-family: var(--font-display);
  font-size: 180px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  line-height: 1;
  z-index: 0;
  pointer-events: none;
}

.week-detail-hero-content {
  position: relative;
  z-index: 1;
}

.week-detail-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--text-light);
  line-height: 1.1;
  letter-spacing: -0.96px;
  margin-bottom: var(--space-md);
}

.week-detail-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.meta-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-light);
  font-weight: 600;
}

.meta-info {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
}

.week-detail-content {
  padding: var(--space-2xl) var(--space-xl);
  padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
}

.slimform-info {
  margin-bottom: var(--space-2xl);
}

.info-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.slimform-settings {
  display: flex;
  gap: var(--space-md);
}

.setting-item {
  flex: 1;
  background: var(--bg-card);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.setting-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.setting-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.workouts-section {
  margin-top: var(--space-2xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 900;
  color: var(--text-primary);
}

.section-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.workouts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.workout-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.workout-card:active {
  transform: scale(0.98);
}

.workout-card-status {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.workout-card-status.completed {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--text-light);
}

.workout-card-status.completed i,
.workout-card-status.completed svg {
  width: 14px;
  height: 14px;
}

.workout-card-content {
  flex: 1;
}

.workout-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.workout-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.workout-card-thumbnail {
  width: 70px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.thumbnail-play {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}

.thumbnail-play i,
.thumbnail-play svg {
  width: 14px;
  height: 14px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIEW: WORKOUT PREVIEW
   ───────────────────────────────────────────────────────────────────────────── */
.workout-preview-content {
  padding: var(--space-xl);
  padding-bottom: 120px;
}

.slimform-card {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #2a2d30 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.slimform-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.slimform-icon {
  width: 20px;
  height: 20px;
  color: var(--week-color, var(--color-primary));
}

.slimform-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-light);
}

.slimform-card-body {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.slimform-setting {
  flex: 1;
  background: var(--bg-card-dark);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
}

.slimform-setting-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.slimform-setting-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-light);
}

.slimform-note {
  font-size: var(--text-sm);
  color: var(--text-light);
  line-height: 1.5;
  opacity: 0.9;
  margin: 0;
}

.workout-tip {
  padding: var(--space-md);
  background: var(--week-color-light, rgba(234, 126, 65, 0.1));
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--week-color, var(--color-primary));
}

.exercises-preview {
  margin-top: var(--space-2xl);
}

.exercises-preview-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.exercises-preview-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.exercise-preview-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.exercise-preview-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--week-color-light, var(--color-primary-light));
  color: var(--week-color, var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.exercise-preview-info {
  flex: 1;
}

.exercise-preview-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.exercise-preview-duration {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.workout-preview-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-xl);
  padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
  background: linear-gradient(transparent, var(--bg-light) 20%);
  max-width: 430px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIEW: WORKOUT SESSION (Timer)
   ───────────────────────────────────────────────────────────────────────────── */

/* Fixed viewport ONLY for workout session - no scroll */
#view-workout-session {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 1000;
}

.workout-session-bg {
  background: var(--bg-dark);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.workout-session-visual {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  padding-top: 50px;
  width: 100%;
}

.exercise-placeholder {
  width: 100%;
  max-width: 500px;
  max-height: 40vh;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.exercise-placeholder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exercise-placeholder video.mirrored {
  transform: scaleX(-1);
}

.placeholder-icon {
  opacity: 0.5;
  color: var(--text-light);
}

.placeholder-icon i,
.placeholder-icon svg {
  width: 80px;
  height: 80px;
}

.workout-session-controls {
  flex: 0 0 auto;
  padding: var(--space-sm) var(--space-lg);
  padding-bottom: calc(var(--safe-bottom) + var(--space-lg));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.timer-display {
  font-size: 64px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: -2px;
  margin-bottom: 0;
}

.exercises-progress-mini {
  width: 100%;
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.exercise-mini-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.exercise-mini-label {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.exercise-mini-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.exercise-mini-progress.completed {
  background: var(--week-color, var(--color-primary));
}

.exercise-mini-progress.active {
  background: var(--week-color, var(--color-primary));
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.session-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-md);
}

.stat-card {
  flex: 1;
  background: var(--bg-card-dark);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-light);
}

.pause-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.pause-btn:active {
  transform: scale(0.95);
}

.session-instruction {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  max-width: 100%;
  padding: var(--space-xs) var(--space-sm);
  margin-top: var(--space-xs);
  line-height: 1.3;
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Rest step styling */
.workout-session-bg.rest-mode {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.workout-session-bg.rest-mode .placeholder-icon {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIEW: WORKOUT COMPLETE
   ───────────────────────────────────────────────────────────────────────────── */
#view-workout-complete {
  background: linear-gradient(135deg, var(--color-success) 0%, #388E3C 100%);
}

.complete-content {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
}

.complete-icon {
  margin-bottom: var(--space-2xl);
  color: var(--text-light);
}

.complete-icon i,
.complete-icon svg {
  width: 80px;
  height: 80px;
}

.complete-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: var(--space-sm);
}

.complete-subtitle {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-3xl);
}

.complete-stats {
  display: flex;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.complete-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.complete-stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-light);
}

.complete-stat-label {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.7);
}

.complete-actions {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.complete-actions .btn-primary {
  background: var(--text-light);
  color: var(--color-success);
}

.complete-actions .btn-secondary {
  color: rgba(255, 255, 255, 0.8);
}

/* ─────────────────────────────────────────────────────────────────────────────
   VIEW: PROGRESS
   ───────────────────────────────────────────────────────────────────────────── */
.progress-header {
  background: var(--bg-dark);
  padding-bottom: var(--space-2xl);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: relative;
}

.progress-hero-stats {
  padding: var(--space-xl);
  padding-top: calc(var(--safe-top) + 80px);
  display: flex;
  justify-content: center;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-light);
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.hero-stat-trend {
  font-size: var(--text-xs);
  color: var(--color-success);
  margin-top: var(--space-xs);
}

.progress-content {
  padding: var(--space-2xl) var(--space-xl);
  padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.quick-stat-card {
  background: var(--bg-card);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.quick-stat-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.quick-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

.chart-section {
  margin-bottom: var(--space-2xl);
}

.chart-container {
  background: var(--bg-card);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  height: 200px;
}

.weeks-timeline {
  margin-bottom: var(--space-2xl);
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.timeline-week {
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  text-align: center;
}

.timeline-week-number {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.timeline-week-dots {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg-light);
}

.timeline-dot.completed {
  background: var(--color-success);
}

.register-section {
  margin-top: var(--space-2xl);
}

.register-form {
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--bg-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-light);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--bg-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-light);
  min-height: 80px;
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.input-with-btn {
  display: flex;
  gap: var(--space-sm);
}

.input-with-btn .form-input {
  flex: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   WELCOME VIDEO SCREEN
   ───────────────────────────────────────────────────────────────────────────── */
.welcome-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.video-preloader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.5s ease-out;
}

.video-preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

.preloader-gif {
  width: 112px;
  height: auto;
  max-width: 60%;
  margin-bottom: var(--space-md);
}

.preloader-text {
  color: #1a1a1a;
  font-size: var(--text-lg);
  font-weight: 600;
  text-align: center;
}

.welcome-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.welcome-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xl);
  transform: translateY(-150px);
}

.welcome-title {
  font-family: 'Fraunces', serif !important;
  font-weight: 900 !important;
  font-size: 60px !important;
  line-height: 0.95 !important;
  color: white !important;
  text-align: center !important;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  padding: var(--space-2xl) !important;
  margin: 0 !important;
  opacity: 0;
  animation: fadeIn 2s ease-in-out 1s forwards;
}

.welcome-start-btn {
  font-family: var(--font-primary) !important;
  font-size: var(--text-base) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border-radius: var(--radius-md) !important;
  transition: all 0.2s ease !important;
  opacity: 0;
  animation: fadeIn 1.5s ease-in-out 3s forwards;
  background: transparent !important;
  border: 0.5px solid white !important;
  color: white !important;
  padding: var(--space-md) var(--space-xl) !important;
  width: auto !important;
  min-width: auto !important;
}

.welcome-start-btn:active {
  background: rgba(255, 255, 255, 0.1) !important;
}

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

@media (max-width: 768px) {
  .welcome-title {
    font-size: 48px !important;
    padding: var(--space-lg) !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   AUTH SCREENS (LOGIN)
   ───────────────────────────────────────────────────────────────────────────── */
#view-login {
  background: var(--bg-dark);
  min-height: 100vh;
}

.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--space-2xl);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.auth-back {
  position: absolute;
  top: var(--space-xl);
  left: var(--space-xl);
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-back:active {
  opacity: 0.7;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-title-small {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 32px;
  color: var(--text-light);
  margin: 0 0 var(--space-sm) 0;
}

.auth-subtitle-small {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.auth-error {
  padding: var(--space-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: var(--text-sm);
  text-align: center;
}
