/* ==========================================================================
   RETO 28 DÍAS CALISTENIA - LATAM DESIGN SYSTEM
   Mobile-First, Ultra High-Converting Dark Theme
   ========================================================================== */

:root {
  --brand: #E96A2D;
  --brand-light: #FF8547;
  --brand-deep: #A34313;
  --brand-glow: rgba(233, 106, 45, 0.35);
  --bg-dark: #000000;
  --bg-card: #121212;
  --bg-card-hover: #1c1c1c;
  --border-card: rgba(255, 255, 255, 0.1);
  --border-focus: #E96A2D;
  --text-main: #FFFFFF;
  --text-muted: #9E9E9E;
  --text-dim: #6E6E6E;
  --green-success: #22C55E;
  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

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

html, body {
  min-height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
  line-height: 1.4;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-dark);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Header & Progress Bar */
.q-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 18px 8px;
}

.q-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 38px;
}

.q-back-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.2s;
  padding: 0;
}

.q-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.q-back-btn svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}

.q-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.q-step-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.5px;
}

.q-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.q-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #E96A2D, #FF8547);
  width: 5%;
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--brand-glow);
}

/* Main Content Area */
.q-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 100px;
}

/* Typography */
.q-eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.q-title {
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 8px;
}

.q-title span.brand {
  color: var(--brand);
}

.q-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 20px;
}

/* Option Cards (Gender, Body Types, Goals) */
.q-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.q-cards-grid.single-col {
  grid-template-columns: 1fr;
  gap: 10px;
}

.q-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 16px;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  user-select: none;
}

.q-card:active {
  transform: scale(0.97);
}

.q-card.selected {
  border-color: var(--border-focus);
  background: linear-gradient(180deg, rgba(233, 106, 45, 0.15) 0%, #161210 100%);
  box-shadow: 0 0 20px rgba(233, 106, 45, 0.25);
}

.q-card .card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #080808;
  margin-bottom: 10px;
}

.q-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.q-card .card-label {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.q-card .card-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3px;
  line-height: 1.3;
}

/* List Options (Age, Motives, Time) */
.q-opts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.q-opt-row {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 14px;
  padding: 15px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  user-select: none;
}

.q-opt-row:active {
  transform: scale(0.98);
}

.q-opt-row.selected {
  border-color: var(--border-focus);
  background: linear-gradient(90deg, rgba(233, 106, 45, 0.15) 0%, var(--bg-card) 100%);
}

.q-opt-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.q-opt-icon {
  font-size: 20px;
  line-height: 1;
}

.q-opt-text {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
}

.q-opt-arrow {
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.2s;
}

.q-opt-row:hover .q-opt-arrow {
  transform: translateX(4px);
}

/* Multi-select checkmark */
.q-opt-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.q-opt-row.selected .q-opt-check {
  background: var(--brand);
  border-color: var(--brand);
}

.q-opt-row.selected .q-opt-check svg {
  display: block;
  stroke: #fff;
  width: 14px;
  height: 14px;
}

.q-opt-check svg {
  display: none;
}

/* Slider Screen (Height & Weight) */
.q-slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 20px 0;
}

.q-unit-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 24px;
}

.q-unit-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.q-unit-btn.active {
  background: var(--brand);
  color: #fff;
}

.q-slider-val-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.q-slider-val {
  font-size: clamp(52px, 14vw, 76px);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
}

.q-slider-unit {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
}

.q-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin-bottom: 12px;
}

.q-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--brand);
  cursor: pointer;
  box-shadow: 0 0 15px var(--brand-glow);
  transition: transform 0.1s;
}

.q-range-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

.q-ruler-marks {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

/* Name Input */
.q-input-wrap {
  margin-top: 15px;
  width: 100%;
}

.q-input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.q-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.q-input {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 14px;
  padding: 16px 54px 16px 18px;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.q-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 15px var(--brand-glow);
}

.q-input-icon-btn {
  position: absolute;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  transition: opacity 0.2s;
}

.q-input-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Interstitial / Educational Break Screens */
.q-break-box {
  background: linear-gradient(180deg, #181412 0%, #0d0d0d 100%);
  border: 1px solid rgba(233, 106, 45, 0.25);
  border-radius: 20px;
  padding: 24px 20px;
  margin: 10px 0 20px;
  text-align: center;
}

.q-break-icon {
  width: 64px;
  height: 64px;
  background: rgba(233, 106, 45, 0.15);
  border: 1px solid var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 16px;
}

.q-break-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.3;
}

.q-break-desc {
  font-size: 14px;
  color: #c9c5bf;
  line-height: 1.55;
  margin-bottom: 16px;
}

.q-break-stat-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 12px 10px;
  margin-top: 14px;
}

.q-stat-item {
  display: flex;
  flex-direction: column;
}

.q-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
}

.q-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Loading Screen Animation */
.q-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  text-align: center;
  width: 100%;
}

.q-spinner-circle {
  width: 110px;
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.q-spinner-circle svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.q-spinner-circle circle {
  fill: none;
  stroke-width: 8;
}

.q-spinner-bg {
  stroke: rgba(255, 255, 255, 0.1);
}

.q-spinner-meter {
  stroke: var(--brand);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s linear;
  filter: drop-shadow(0 0 6px var(--brand-glow));
}

.q-loading-pct {
  position: absolute;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.q-loading-status {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  min-height: 48px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.q-loading-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin-top: 10px;
  text-align: left;
}

.q-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  opacity: 0.4;
  transition: all 0.3s ease;
}

.q-check-row.done {
  color: #fff;
  opacity: 1;
}

.q-check-row.done svg {
  stroke: var(--green-success);
}

/* Results & Projection Screen */
.q-results-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 6px;
}

.q-summary-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 16px;
  padding: 16px 18px;
}

.q-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.q-summary-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.q-summary-badge {
  background: rgba(233, 106, 45, 0.15);
  color: var(--brand);
  border: 1px solid var(--brand);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.q-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.q-metric-cell {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px 12px;
}

.q-metric-cell .lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.q-metric-cell .val {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

/* Before / After Projection */
.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0;
  width: 100%;
}

.ba-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  aspect-ratio: 1 / 1.25;
  background: #080808;
}

.ba-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.ba-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #fff;
}

.ba-badge.after {
  background: var(--brand);
  color: #000;
}

/* Projection Chart Card */
.q-chart-card {
  background: linear-gradient(180deg, #181412 0%, #0e0d0c 100%);
  border: 1.5px solid rgba(233, 106, 45, 0.3);
  border-radius: 18px;
  padding: 20px 18px;
  margin: 8px 0;
}

.q-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.q-chart-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.q-chart-target {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand);
}

.q-timeline-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  padding-left: 20px;
}

.q-timeline-steps::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(233, 106, 45, 0.3);
}

.q-timeline-step {
  position: relative;
  display: flex;
  flex-direction: column;
}

.q-timeline-step::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #111;
  border: 2px solid var(--brand);
}

.q-timeline-step .t-week {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
}

.q-timeline-step .t-desc {
  font-size: 13.5px;
  color: #ddd;
  line-height: 1.35;
}

/* Sticky Footer CTA */
.q-footer {
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.95) 30%, #000 100%);
  padding: 16px 20px max(18px, var(--safe-bottom));
  width: 100%;
}

.cta-btn {
  width: 100%;
  height: 54px;
  background: linear-gradient(90deg, #E96A2D 0%, #FF8547 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px var(--brand-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
  text-decoration: none;
  user-select: none;
}

.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(233, 106, 45, 0.5);
}

.cta-btn:active {
  transform: translateY(1px) scale(0.99);
}

.cta-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
  filter: grayscale(0.5);
}

.cta-btn .cta-arrow {
  font-size: 20px;
  transition: transform 0.2s;
}

.cta-btn:hover .cta-arrow {
  transform: translateX(4px);
}

/* Pulsing effect for final CTA */
.cta-pulse {
  animation: ctaPulseAnim 2s infinite;
}

@keyframes ctaPulseAnim {
  0% {
    box-shadow: 0 0 0 0 rgba(233, 106, 45, 0.6);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(233, 106, 45, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(233, 106, 45, 0);
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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