/* ============================================
   ThePlatePlanner — Design System
   Inspired by MyChallenge / MediterraneanChallenge
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Primary */
  --primary: #0F4C43;
  --primary-light: #1A6B5E;
  --primary-lighter: #E8F5F0;
  --primary-bg: #EFF1F5;
  --primary-btn: #0F4C43;
  --primary-btn-hover: #0D3D36;

  /* Accent */
  --accent: #D4A574;
  --accent-light: #F5E6D3;
  --accent-pink: #F2D1D1;

  /* Neutrals */
  --bg: #EFF1F5;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;

  /* Text */
  --text: #1A1A2E;
  --text-secondary: #4A4A5A;
  --text-muted: #8A8A9A;
  --text-on-primary: #FFFFFF;

  /* Borders */
  --border: #D8DAE0;
  --border-light: #E8EAF0;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.1);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 100px;

  /* Typography */
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition-normal: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);

  /* Container */
  --container-max: 640px;
  --container-padding: 20px;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; outline: none; }
ul, ol { list-style: none; }

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

/* ============================================
   HEADER / LOGO
   ============================================ */
.header {
  padding: 20px 0;
  text-align: center;
  position: relative;
  z-index: 100;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.header__back {
  position: absolute;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.header__back:hover {
  background: rgba(0,0,0,0.05);
}

.header__back.hidden { display: none; }

.header__logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  height: 4px;
  background: var(--border-light);
  position: relative;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  transition: width 0.4s var(--ease-out);
  min-width: 4px;
}

/* ============================================
   HERO SECTION (Landing)
   ============================================ */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-3xl);
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
}

.hero__image {
  width: 240px;
  height: 240px;
  margin: 0 auto var(--space-xl);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__title {
  margin-bottom: var(--space-md);
  color: var(--text);
}

.hero__subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.6;
}

.hero__select-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.hero__buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-lg);
}

.hero__gender-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 48px;
  background: var(--primary-btn);
  color: var(--text-on-primary);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  transition: all var(--transition-normal);
  min-width: 180px;
}

.hero__gender-btn:hover {
  background: var(--primary-btn-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero__gender-btn:active {
  transform: scale(0.97);
}

.hero__gender-icon {
  font-size: 1.2rem;
}

/* ============================================
   QUIZ SECTION
   ============================================ */
.quiz {
  display: none;
  padding: var(--space-2xl) 0 var(--space-3xl);
  min-height: calc(100vh - 84px);
  animation: fadeIn 0.3s var(--ease-out);
}

.quiz.active { display: block; }

.quiz__step {
  display: none;
  animation: slideIn 0.35s var(--ease-out);
}

.quiz__step.active { display: block; }

.quiz__title {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.quiz__subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
}

.quiz__badge {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--space-lg);
}

/* Option cards (radio-style) */
.quiz__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.quiz__option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 16px 20px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.95rem;
}

.quiz__option:hover {
  border-color: var(--primary);
  background: var(--primary-lighter);
}

.quiz__option.selected {
  border-color: var(--primary);
  background: var(--primary-lighter);
}

.quiz__option-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.quiz__option-check {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.quiz__option.selected .quiz__option-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.quiz__option.selected .quiz__option-check::after {
  content: '✓';
  font-size: 0.75rem;
  color: white;
  font-weight: 700;
}

/* Multi-select checkbox style */
.quiz__option--multi .quiz__option-check {
  border-radius: 6px;
}

/* Age cards with images */
.quiz__age-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.quiz__age-card {
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--primary-lighter);
  border: 2px solid transparent;
}

.quiz__age-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.quiz__age-card.selected {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.quiz__age-avatar {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz__age-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s var(--ease-out);
}

.quiz__age-card:hover .quiz__age-avatar img {
  transform: scale(1.05);
}

.quiz__age-label {
  padding: 10px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Input fields */
.quiz__input-group {
  margin-top: var(--space-xl);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.quiz__unit-toggle {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.quiz__unit-btn {
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  transition: all var(--transition-fast);
}

.quiz__unit-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.quiz__input {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  text-align: center;
  background: var(--bg-white);
  transition: all var(--transition-fast);
  color: var(--text);
  font-weight: 600;
}

.quiz__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 76, 67, 0.1);
}

.quiz__input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.quiz__input-label {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.quiz__input-row {
  display: flex;
  gap: var(--space-md);
}

.quiz__input-row .quiz__input {
  flex: 1;
}

/* Next button */
.quiz__next-btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: var(--space-xl) auto 0;
  padding: 18px 32px;
  background: var(--primary-btn);
  color: var(--text-on-primary);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1.05rem;
  transition: all var(--transition-normal);
  opacity: 1;
}

.quiz__next-btn:hover {
  background: var(--primary-btn-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.quiz__next-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================
   SUMMARY / RESULTS
   ============================================ */
.summary {
  display: none;
  padding: var(--space-2xl) 0;
  animation: fadeIn 0.4s var(--ease-out);
}

.summary.active { display: block; }

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

.summary__bmi-card {
  background: var(--accent-pink);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.summary__bmi-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.summary__bmi-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: var(--space-lg);
}

.summary__bmi-gauge {
  width: 200px;
  height: 110px;
  margin: 0 auto var(--space-lg);
  position: relative;
}

.summary__bmi-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

.summary__bmi-text strong {
  color: var(--text);
}

/* Stats grid */
.summary__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.summary__stat {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  border: 1px solid var(--border-light);
}

.summary__stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.summary__stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   EMAIL CAPTURE
   ============================================ */
.email-capture {
  display: none;
  padding: var(--space-2xl) 0;
  text-align: center;
  min-height: calc(100vh - 84px);
  animation: fadeIn 0.4s var(--ease-out);
}

.email-capture.active { display: block; }

.email-capture__icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
}

.email-capture__title {
  margin-bottom: var(--space-md);
}

.email-capture__subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.email-capture__form {
  max-width: 400px;
  margin: 0 auto;
}

.email-capture__input {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  margin-bottom: var(--space-md);
  background: var(--bg-white);
  transition: all var(--transition-fast);
}

.email-capture__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 76, 67, 0.1);
}

.email-capture__btn {
  width: 100%;
  padding: 18px 32px;
  background: var(--primary-btn);
  color: var(--text-on-primary);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1.05rem;
  transition: all var(--transition-normal);
}

.email-capture__btn:hover {
  background: var(--primary-btn-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.email-capture__skip {
  display: block;
  margin-top: var(--space-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.email-capture__skip:hover {
  color: var(--primary);
}

/* ============================================
   PRICING SECTION
   ============================================ */
.pricing {
  display: none;
  padding: var(--space-2xl) 0 var(--space-3xl);
  animation: fadeIn 0.4s var(--ease-out);
}

.pricing.active { display: block; }

.pricing__title {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.pricing__subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.pricing__cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 480px;
  margin: 0 auto var(--space-xl);
}

.pricing__card {
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.pricing__card:hover {
  border-color: var(--primary);
}

.pricing__card.selected {
  border-color: var(--primary);
  background: var(--primary-lighter);
}

.pricing__card--popular {
  border-color: var(--primary);
}

.pricing__popular-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing__radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.pricing__card.selected .pricing__radio {
  border-color: var(--primary);
  background: var(--primary);
}

.pricing__card.selected .pricing__radio::after {
  content: '';
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.pricing__info {
  flex: 1;
}

.pricing__duration {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.pricing__per-day {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pricing__price {
  text-align: right;
}

.pricing__price-current {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}

.pricing__price-old {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.pricing__cta {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto var(--space-lg);
  padding: 18px 32px;
  background: var(--primary-btn);
  color: var(--text-on-primary);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1.05rem;
  text-align: center;
  transition: all var(--transition-normal);
}

.pricing__cta:hover {
  background: var(--primary-btn-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pricing__guarantee {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

.pricing__guarantee strong {
  color: var(--text-secondary);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: var(--space-xl) 0;
  text-align: center;
  border-top: 1px solid var(--border-light);
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.footer__links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--primary);
}

.footer__copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.footer__disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
  opacity: 0.7;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .hero__buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero__gender-btn {
    width: 100%;
    max-width: 300px;
  }

  .quiz__age-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .summary__stats {
    grid-template-columns: 1fr;
  }

  .hero__image {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 380px) {
  :root {
    --container-padding: 16px;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
}
