/* ============================================================
   TF Travel Fit — style.css
   Mobile-first. Torres Fitness brand.
   Primary: #8EA5CF   Secondary: #131730
   ============================================================ */

:root {
  --tf-blue: #8EA5CF;
  --tf-dark: #131730;
  --tf-dark-mid: #1e2545;
  --tf-blue-light: #b3c5e0;
  --tf-blue-pale: #e8eef7;
  --tf-white: #ffffff;
  --tf-gray: #6b7280;
  --tf-gray-light: #f3f4f6;
  --tf-border: #dde3ee;
  --tf-success: #22c55e;
  --tf-warn: #f59e0b;

  --radius: 12px;
  --radius-sm: 8px;
  --spacing: 16px;
  --max-w: 520px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--tf-gray-light);
  color: var(--tf-dark);
  min-height: 100vh;
  overscroll-behavior: none;
}

/* ---- SCREENS ---- */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: block;
}
.screen-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--spacing) 80px;
}

/* ---- SCREEN HEADER ---- */
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--tf-border);
  margin-bottom: 24px;
}
.screen-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tf-dark);
  flex: 1;
}
.btn-back {
  background: none;
  border: none;
  color: var(--tf-blue);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   SCREEN 1 — WELCOME
   ============================================================ */
#screen-welcome {
  background: var(--tf-dark);
  color: var(--tf-white);
  display: flex;
  flex-direction: column;
}
#screen-welcome.active { display: flex; }
#screen-welcome .screen-inner {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 0;
}

.welcome-header {
  padding: 28px var(--spacing) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tf-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tf-logo-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
}
.tf-logo-mark {
  background: var(--tf-blue);
  color: var(--tf-dark);
  font-weight: 900;
  font-size: 1rem;
  padding: 4px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.tf-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tf-blue-light);
  letter-spacing: 0.3px;
}

.hotel-name {
  font-size: 0.8rem;
  color: var(--tf-blue-light);
  font-weight: 500;
  text-align: right;
  max-width: 160px;
}

.welcome-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px var(--spacing) 32px;
}

.welcome-headline {
  font-size: clamp(2.4rem, 10vw, 3.5rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--tf-white);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.welcome-sub {
  font-size: 1rem;
  color: var(--tf-blue-light);
  line-height: 1.5;
  margin-bottom: 36px;
}

.weight-input-group {
  margin-bottom: 28px;
}
.weight-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--tf-blue-light);
  margin-bottom: 8px;
}
.weight-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.weight-row input {
  background: var(--tf-dark-mid);
  border: 1.5px solid var(--tf-blue);
  border-radius: var(--radius-sm);
  color: var(--tf-white);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 12px 14px;
  width: 120px;
  outline: none;
}
.weight-row input:focus { border-color: var(--tf-blue-light); }
.weight-unit {
  color: var(--tf-blue-light);
  font-size: 0.9rem;
}

.welcome-footer {
  padding: 20px var(--spacing) 28px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(142, 165, 207, 0.5);
}

/* ============================================================
   SCREEN 2 — FILTER
   ============================================================ */
.filter-section {
  margin-bottom: 32px;
}
.filter-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tf-dark);
  margin-bottom: 12px;
}
.filter-note {
  font-size: 0.85rem;
  color: var(--tf-gray);
  margin-bottom: 12px;
}

/* Goal Grid */
.goal-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.goal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--tf-white);
  border: 2px solid var(--tf-border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.goal-card:hover { border-color: var(--tf-blue); }
.goal-card.selected {
  border-color: var(--tf-blue);
  background: var(--tf-blue-pale);
}
.goal-icon { font-size: 1.5rem; flex-shrink: 0; }
.goal-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--tf-dark);
}
.goal-detail {
  display: block;
  font-size: 0.8rem;
  color: var(--tf-gray);
  margin-top: 2px;
}

/* Equipment toggles */
.equipment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.equip-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--tf-white);
  border: 2px solid var(--tf-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.equip-toggle:has(input:checked) {
  border-color: var(--tf-blue);
  background: var(--tf-blue-pale);
}
.equip-toggle input { display: none; }
.equip-label { flex: 1; }
.equip-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--tf-dark);
}
.equip-note {
  font-size: 0.75rem;
  color: var(--tf-gray);
}
.equip-check {
  font-size: 1rem;
  color: var(--tf-blue);
  opacity: 0;
  transition: opacity 0.15s;
}
.equip-toggle:has(input:checked) .equip-check { opacity: 1; }
.equip-toggle:has(input:disabled) { opacity: 0.7; cursor: default; }

.filter-cta { padding-top: 8px; }

/* Variation picker */
.variation-picker {
  margin-top: 24px;
}
.variation-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tf-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.variation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.variation-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--tf-white);
  border: 2px solid var(--tf-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.variation-card:hover { border-color: var(--tf-blue); }
.variation-card.selected {
  border-color: var(--tf-blue);
  background: var(--tf-blue-pale);
}
.var-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.var-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--tf-dark);
}
.var-dur {
  font-size: 0.8rem;
  color: var(--tf-gray);
  font-weight: 500;
  flex-shrink: 0;
}
.var-fmt {
  display: inline-block;
  background: var(--tf-dark);
  color: var(--tf-blue-light);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 5px;
}
.var-desc {
  font-size: 0.8rem;
  color: var(--tf-gray);
  line-height: 1.4;
  margin-top: 4px;
}
.var-sub-note {
  font-size: 0.75rem;
  color: var(--tf-blue);
  font-style: italic;
  margin: 4px 0 2px;
}
.no-match-msg {
  font-size: 0.9rem;
  color: var(--tf-gray);
  text-align: center;
  padding: 20px 0 8px;
}

/* ============================================================
   SCREEN 3 — WORKOUT
   ============================================================ */
.workout-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.workout-header .btn-back { align-self: flex-start; }
.workout-meta { width: 100%; }
.workout-meta h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.workout-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.workout-duration-badge {
  display: inline-block;
  background: var(--tf-blue-pale);
  color: var(--tf-blue);
  border: 1px solid var(--tf-blue);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
}

/* Calorie badge */
.calorie-badge {
  display: inline-block;
  background: var(--tf-dark);
  color: var(--tf-blue-light);
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
  padding: 4px 14px;
}

/* Equipment sub note — shown in workout header when subs are active */
.workout-sub-note {
  font-size: 0.8rem;
  color: var(--tf-blue);
  font-style: italic;
  margin-top: 6px;
}

/* Timer — always shown, universal countdown */
.timer-container {
  background: var(--tf-dark);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  text-align: center;
  color: var(--tf-white);
}
.timer-display {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--tf-white);
  line-height: 1;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.timer-display.running { color: var(--tf-blue-light); }
.timer-display.warning { color: var(--tf-warn); }
.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-timer {
  background: var(--tf-blue);
  color: var(--tf-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 24px;
  cursor: pointer;
  min-width: 80px;
}
.btn-timer-secondary {
  background: var(--tf-dark-mid);
  color: var(--tf-white);
}

/* Part containers */
.part-container {
  margin-bottom: 32px;
}
.part-header {
  margin-bottom: 14px;
}
.part-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.part-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--tf-dark);
}
.part-desc {
  font-size: 0.85rem;
  color: var(--tf-gray);
  line-height: 1.4;
  margin-bottom: 4px;
}
.part-meta {
  font-size: 0.78rem;
  color: var(--tf-blue);
  font-weight: 600;
  margin-bottom: 4px;
}

/* Set stepper */
.set-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--tf-border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.stepper-btn {
  background: var(--tf-white);
  border: none;
  color: var(--tf-blue);
  font-size: 1.1rem;
  font-weight: 700;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
.stepper-btn:hover { background: var(--tf-blue-pale); }
.stepper-num {
  min-width: 32px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--tf-dark);
  background: var(--tf-white);
  padding: 0 4px;
  line-height: 32px;
  border-left: 1px solid var(--tf-border);
  border-right: 1px solid var(--tf-border);
}

/* Part B timer hint */
.timer-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid rgba(142, 165, 207, 0.4);
  border-radius: var(--radius-sm);
  color: var(--tf-blue);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  margin-top: 6px;
  margin-bottom: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.timer-hint:hover {
  background: var(--tf-blue-pale);
  border-color: var(--tf-blue);
}

/* Exercise cards — compact row layout */
.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exercise-card {
  background: var(--tf-white);
  border: 1.5px solid var(--tf-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.exercise-card.rest-card {
  background: var(--tf-dark-mid);
  border-color: var(--tf-dark);
}

/* Name left, N × reps right */
.ex-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}
.exercise-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--tf-dark);
  flex: 1;
  min-width: 0;
}
.exercise-card.rest-card .exercise-name { color: var(--tf-white); }
.ex-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tf-blue);
  white-space: nowrap;
  flex-shrink: 0;
}

/* EMOM minute badge */
.ex-min-badge {
  display: inline-block;
  background: var(--tf-dark);
  color: var(--tf-blue-light);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-bottom: 5px;
}

.exercise-cue {
  font-size: 0.8rem;
  color: var(--tf-gray);
  line-height: 1.4;
  margin-bottom: 3px;
}
.exercise-scale {
  font-size: 0.75rem;
  color: var(--tf-blue);
  font-style: italic;
  line-height: 1.4;
}
.exercise-scale::before { content: "Scale: "; font-weight: 600; }

/* Video slot */
.video-slot {
  background: var(--tf-gray-light);
  border: 1.5px dashed var(--tf-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 8px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--tf-gray);
  display: none; /* hidden in v1 — placeholder only */
}

/* Email capture */
.email-capture-section {
  background: var(--tf-blue-pale);
  border: 1.5px solid var(--tf-blue);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 24px;
}
.email-heading {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tf-dark);
  margin-bottom: 4px;
}
.email-sub {
  font-size: 0.82rem;
  color: var(--tf-gray);
  margin-bottom: 12px;
}
.email-row {
  display: flex;
  gap: 8px;
}
.email-input {
  flex: 1;
  border: 1.5px solid var(--tf-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  background: var(--tf-white);
}
.email-input:focus { border-color: var(--tf-blue); }
.btn-email {
  background: var(--tf-blue);
  color: var(--tf-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
}
.email-confirm {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--tf-success);
  font-weight: 600;
}

/* Timer duration input */
.timer-edit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(142, 165, 207, 0.15);
}
.timer-adj-label {
  font-size: 0.75rem;
  color: rgba(142, 165, 207, 0.55);
  font-weight: 500;
}
.timer-mins-input {
  background: var(--tf-dark-mid);
  border: 1.5px solid rgba(142, 165, 207, 0.4);
  border-radius: 8px;
  color: var(--tf-white);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  width: 68px;
  padding: 6px 8px;
  outline: none;
  -moz-appearance: textfield;
}
.timer-mins-input::-webkit-inner-spin-button,
.timer-mins-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.timer-mins-input:focus { border-color: var(--tf-blue); }


/* Restart button */
.btn-restart {
  display: block;
  width: 100%;
  background: transparent;
  color: rgba(142, 165, 207, 0.6);
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.3px;
}
.btn-restart:hover { color: var(--tf-blue); }

/* Workout footer */
.workout-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

/* ============================================================
   SCREEN 4 — RECOVERY
   ============================================================ */
.recovery-intro {
  font-size: 0.9rem;
  color: var(--tf-gray);
  margin-bottom: 20px;
}
.recovery-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recovery-card {
  background: var(--tf-white);
  border: 1.5px solid var(--tf-border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.recovery-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tf-dark);
  margin-bottom: 3px;
}
.recovery-duration {
  display: inline-block;
  background: var(--tf-blue-pale);
  color: var(--tf-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.recovery-cue {
  font-size: 0.82rem;
  color: var(--tf-gray);
  line-height: 1.4;
}

/* ============================================================
   SCREEN 5 — REVIEW
   ============================================================ */
.review-form { padding-top: 8px; }
.review-section { margin-bottom: 28px; }
.review-question {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tf-dark);
  margin-bottom: 12px;
}
.optional {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--tf-gray);
}

.radio-group {
  display: flex;
  gap: 10px;
}
.radio-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tf-white);
  border: 2px solid var(--tf-border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.radio-card:has(input:checked) {
  border-color: var(--tf-blue);
  background: var(--tf-blue-pale);
}
.radio-card input { display: none; }

.emoji-scale {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.emoji-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--tf-white);
  border: 2px solid var(--tf-border);
  border-radius: var(--radius);
  padding: 12px 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.emoji-option:has(input:checked) {
  border-color: var(--tf-blue);
  background: var(--tf-blue-pale);
}
.emoji-option input { display: none; }
.emoji { font-size: 1.4rem; }
.emoji-label { font-size: 0.68rem; color: var(--tf-gray); font-weight: 500; }

.review-note {
  width: 100%;
  border: 1.5px solid var(--tf-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--tf-dark);
  resize: vertical;
  min-height: 80px;
  outline: none;
}
.review-note:focus { border-color: var(--tf-blue); }

/* Thanks screen */
.review-thanks {
  text-align: center;
  padding: 40px 0;
}
.thanks-icon { font-size: 3rem; margin-bottom: 16px; }
.review-thanks h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.review-thanks p {
  color: var(--tf-gray);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.thanks-sub { font-size: 0.9rem; }
.btn-block { display: block; margin-top: 24px; text-align: center; }

/* ============================================================
   SHARED BUTTONS
   ============================================================ */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--tf-blue);
  color: var(--tf-dark);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 800;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: background 0.15s;
}
.btn-primary:disabled {
  background: var(--tf-border);
  color: var(--tf-gray);
  cursor: not-allowed;
}
.btn-primary:not(:disabled):hover { background: var(--tf-blue-light); }

.btn-secondary {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--tf-gray);
  border: 1.5px solid var(--tf-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--tf-gray); }

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

/* Smooth scroll within screens */
html { scroll-behavior: smooth; }

/* Scrollable body on small screens */
body { overflow-y: auto; }

/* ============================================================
   TABLET / DESKTOP POLISH (max-width locks at 520px anyway)
   ============================================================ */
@media (min-width: 600px) {
  .screen-inner { padding-top: 12px; }
  .welcome-headline { font-size: 3.5rem; }
  .timer-display { font-size: 4rem; }
}
