/* ============================================
   Tailwise — Pastel Lineart design system
   ============================================ */

:root {
  /* Surfaces */
  --surface: #f9faf7;
  --surface-low: #f3f4f1;
  --surface-white: #ffffff;
  --outline-variant: #dde3de;

  /* Text */
  --text: #191c1b;
  --text-soft: #404945;
  --text-muted: #707975;
  --charcoal: #4a4a4a;

  /* Pastels */
  --primary: #366758;          /* deep mint — accents, links */
  --mint: #b5ead7;             /* pale mint container */
  --mint-soft: #e2f6ee;
  --peach: #fdd9c0;            /* primary action fill */
  --peach-soft: #fbe9e7;       /* hover state */
  --on-peach: #785d49;
  --lavender: #ecd8f3;
  --lavender-soft: #f3e5f5;    /* selected state */
  --on-lavender: #685970;
  --butter: #fdf0c2;           /* chips */
  --on-butter: #6e5b1e;

  /* Shape */
  --r-sm: 0.75rem;
  --r-md: 1.5rem;
  --r-lg: 2rem;
  --r-pill: 9999px;

  --shadow-soft: 0 10px 30px -12px rgba(54, 103, 88, 0.18);
  --shadow-peach: 0 10px 24px -10px rgba(120, 93, 73, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Lexend", sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: linear-gradient(135deg, #f9faf7 0%, #fdf5f0 50%, #f3f9f7 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .font-display {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---------- Header ---------- */
.topbar {
  width: 100%;
  background: transparent;
}
.topbar nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo svg { width: 28px; height: 28px; }

.nav-links { display: none; gap: 24px; align-items: center; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
@media (min-width: 768px) { .nav-links { display: flex; } }

/* ---------- Progress ---------- */
.progress-wrap {
  max-width: 560px;
  width: 100%;
  margin: 8px auto 0;
  padding: 0 20px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.progress-track {
  height: 12px;
  border-radius: var(--r-pill);
  background: #e6ece7;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--mint), #9dd1bf);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Layout ---------- */
main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 64px;
}

.step {
  display: none;
  max-width: 880px;
  width: 100%;
  text-align: center;
}
.step.active {
  display: block;
  animation: fadeIn 0.55s ease-out both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-title {
  font-size: clamp(26px, 4.5vw, 40px);
  line-height: 1.2;
}
.step-sub {
  font-size: 18px;
  line-height: 28px;
  color: var(--text-soft);
  margin: 10px 0 0;
}

/* ---------- Size cards ---------- */
.size-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 40px;
}
@media (min-width: 768px) { .size-grid { grid-template-columns: repeat(3, 1fr); } }

.selection-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  background: var(--surface-white);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--r-lg);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.selection-card:hover {
  transform: translateY(-8px);
  background: var(--peach-soft);
  border-color: #d9a98f;
}
.selection-card.selected {
  background: var(--lavender-soft);
  border-color: var(--on-lavender);
  box-shadow: var(--shadow-soft);
}
.selection-card .dog-art {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
  color: var(--charcoal);
  animation: float 6s ease-in-out infinite;
}
.selection-card:nth-child(2) .dog-art { animation-delay: 0.2s; }
.selection-card:nth-child(3) .dog-art { animation-delay: 0.4s; }
.selection-card .dog-art svg {
  width: 120px;
  height: 120px;
  transition: transform 0.5s;
}
.selection-card:hover .dog-art svg { transform: scale(1.1); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.selection-card .card-label {
  font-family: "Quicksand", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-soft);
}
.selection-card .card-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s;
}
.selection-card.selected .card-check { opacity: 1; transform: scale(1); }
.card-check svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface-white);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  padding: 32px 24px;
  margin-top: 32px;
  text-align: left;
}
@media (min-width: 640px) { .form-card { padding: 40px; } }

.field { margin-bottom: 24px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.field .optional { color: var(--text-muted); font-weight: 400; }

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px 20px;
}
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  width: 100%;
  font-family: "Lexend", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--r-pill);
  padding: 12px 20px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea {
  border-radius: var(--r-md);
  min-height: 130px;
  resize: vertical;
  line-height: 24px;
}
input:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(181, 234, 215, 0.45);
}
input::placeholder, textarea::placeholder { color: #a9b3ad; }

/* Pill toggle group (gender etc.) */
.pill-group { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-option {
  font-family: "Lexend", sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--outline-variant);
  background: var(--surface-white);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.pill-option:hover { border-color: var(--primary); }
.pill-option.selected {
  background: var(--mint);
  border-color: var(--primary);
  color: #1c4f41;
}
.pill-option .tick {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: transparent;
  border: 2px solid #b8c4bd;
  border-radius: 6px;
  background: #fff;
  margin-right: 4px;
  vertical-align: -3px;
  transition: all 0.2s;
}
.pill-option.selected .tick {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.months-wrap {
  margin-top: 18px;
  padding: 16px 18px 12px;
  background: var(--mint-soft);
  border: 1px solid #cdeadd;
  border-radius: var(--r-md);
  animation: fadeIn 0.4s ease-out both;
}

textarea.textarea-sm { min-height: 88px; }

/* Slider */
.slider-wrap { padding: 4px 6px 0; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: var(--r-pill);
  background: #e6ece7;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-white);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-soft);
  cursor: grab;
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-white);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-soft);
  cursor: grab;
}
.slider-value {
  font-family: "Quicksand", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 10px;
  text-align: center;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Stepper (+ / -) */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.stepper button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--outline-variant);
  background: var(--surface-white);
  color: var(--primary);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.stepper button:hover { background: var(--mint-soft); border-color: var(--primary); }
.stepper button:active { transform: scale(0.92); }
.stepper .stepper-value {
  font-family: "Quicksand", sans-serif;
  font-size: 22px;
  font-weight: 700;
  min-width: 90px;
  text-align: center;
}
.stepper .stepper-value small {
  display: block;
  font-family: "Lexend", sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

/* ---------- Trait cards ---------- */
.trait-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 32px;
}
@media (min-width: 640px)  { .trait-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .trait-grid { grid-template-columns: repeat(4, 1fr); } }

.trait-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--surface-white);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: "Lexend", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.trait-card svg { width: 34px; height: 34px; color: var(--charcoal); transition: transform 0.3s; }
.trait-card:hover { transform: translateY(-4px); background: var(--peach-soft); border-color: #d9a98f; }
.trait-card:hover svg { transform: scale(1.12) rotate(-4deg); }
.trait-card.selected {
  background: var(--lavender-soft);
  border-color: var(--on-lavender);
  color: var(--on-lavender);
  box-shadow: var(--shadow-soft);
}
.trait-counter {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 18px;
}

/* ---------- Food cards ---------- */
.food-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) { .food-grid { grid-template-columns: repeat(5, 1fr); } }
.food-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  background: var(--surface);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: "Lexend", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  transition: all 0.25s;
}
.food-card svg { width: 30px; height: 30px; color: var(--charcoal); }
.food-card:hover { transform: translateY(-3px); background: var(--peach-soft); }
.food-card.selected {
  background: var(--mint);
  border-color: var(--primary);
  color: #1c4f41;
}
.food-card.selected svg { color: #1c4f41; }

/* ---------- Goal chips ---------- */
.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.chip {
  font-family: "Lexend", sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  background: var(--butter);
  color: var(--on-butter);
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { transform: translateY(-2px); }
.chip.selected {
  background: var(--mint);
  color: #1c4f41;
  border-color: var(--primary);
}
.suggest-chip {
  background: var(--surface-white);
  border: 1.5px dashed var(--outline-variant);
  color: var(--text-muted);
}
.suggest-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Quicksand", sans-serif;
  font-size: 19px;
  font-weight: 600;
  padding: 16px 40px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--peach);
  color: var(--on-peach);
  cursor: pointer;
  box-shadow: var(--shadow-peach);
  transition: all 0.25s;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-3px); opacity: 0.95; }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-primary svg { width: 20px; height: 20px; transition: transform 0.25s; }
.btn-primary:hover:not(:disabled) svg { transform: translateX(4px); }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Lexend", sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--outline-variant);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-back:hover { border-color: var(--charcoal); color: var(--text); }
.btn-back svg { width: 18px; height: 18px; }

/* ---------- Email / recap ---------- */
.recap-card {
  background: var(--mint-soft);
  border: 1px solid #cdeadd;
  border-radius: var(--r-md);
  padding: 24px;
  margin: 32px 0 8px;
  text-align: left;
  display: flex;
  gap: 20px;
  align-items: center;
}
.recap-card .dog-avatar {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface-white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
}
.recap-card .dog-avatar svg { width: 62px; height: 62px; }
.recap-name {
  font-family: "Quicksand", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.recap-meta { font-size: 14px; color: var(--text-soft); margin-top: 2px; }
.recap-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.recap-tags span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--butter);
  color: var(--on-butter);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}

.promise {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-soft);
  background: var(--surface-white);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-top: 20px;
}
.promise svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--primary); margin-top: 2px; }

.consent-line {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin: 14px 0 0;
}
.consent-line a { color: var(--primary); }

.field-error {
  display: none;
  font-size: 13px;
  color: #ba1a1a;
  margin-top: 6px;
}
.field-error.visible { display: block; }

/* ---------- Success ---------- */
.success-art {
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-art svg { width: 80px; height: 80px; }
@keyframes pop {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.paw-trail {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  color: #9dd1bf;
}
.paw-trail svg { width: 26px; height: 26px; animation: pop 0.5s both; }
.paw-trail svg:nth-child(2) { animation-delay: 0.15s; transform: rotate(15deg); }
.paw-trail svg:nth-child(3) { animation-delay: 0.3s; }
.paw-trail svg:nth-child(4) { animation-delay: 0.45s; transform: rotate(-12deg); }

/* ---------- Footer ---------- */
footer {
  width: 100%;
  background: var(--surface-low);
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
.footer-brand { font-family: "Quicksand", sans-serif; font-size: 22px; font-weight: 700; color: var(--primary); }
.footer-tag { font-size: 14px; color: var(--text-soft); margin-top: 4px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 14px; color: var(--text-soft); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }

/* misc */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
