/* /start — quiz card. Carried over from the reference embed; the survey card
   is Arial/Helvetica, not Montserrat (checked against start-age.png). */

.start-hero {
  min-height: 100vh;
  padding: 20px 20px 40px;
  background: var(--page-bg) url("/assets/back.jpeg") center bottom / cover no-repeat;
}

.start-logo {
  width: 270px;
  height: auto;
  margin: 0 auto;
}

.hidden { display: none !important; }

/* ------------------------------------------------------------------- card */

.survey-wrap {
  max-width: 520px;
  margin: 40px auto;
  padding: 28px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .08);
  font-family: Arial, Helvetica, sans-serif;
  color: #322f30;
}

/* --------------------------------------------------------------- progress */

.progress-wrap { margin-bottom: 18px; }

.survey-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.survey-progress-fill {
  height: 100%;
  width: 33%;
  background: var(--blue);
  transition: width .4s ease;
}

.progress-text {
  margin-top: 6px;
  text-align: right;
  font-size: 13px;
  color: var(--blue);
  transition: opacity .3s ease;
}

/* ----------------------------------------------------------------- titles */

.survey-title {
  margin-bottom: 28px;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  color: #322f30;
  animation: fadeSlideIn .5s ease;
}

#step3 .survey-title {
  max-width: 320px;
  margin: 0 auto 24px;
  font-size: 22px;
  line-height: 1.25;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.step-container { animation: fadeSlideIn .5s ease; }

/* -------------------------------------------------------------- questions */

.question-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  margin-bottom: 30px;
  animation: fadeSlideIn .5s ease both;
}

.question-row:nth-child(2) { animation-delay: .1s; }
.question-row:nth-child(3) { animation-delay: .2s; }
.question-row:nth-child(4) { animation-delay: .3s; }

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: #322f30;
}

.option-group { display: flex; gap: 18px; }

.option-btn {
  min-width: 70px;
  padding: 10px 0;
  border: 1px solid #ababab;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.option-btn:hover { border-color: var(--blue); background: #f0f4ff; }

.option-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  transform: scale(1.05);
}

.option-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ------------------------------------------------------------------- next */

.next-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 3px;
  animation: fadeIn .5s ease .4s both;
}

.next-btn {
  min-width: 95px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.next-btn:hover { background: var(--blue-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.next-btn:active { transform: translateY(0); }
.next-btn:disabled { background: #cbd5e1; cursor: not-allowed; transform: none; }

/* -------------------------------------------------------------------- age */

.age-grid { display: grid; gap: 10px; justify-items: center; }

.age-btn {
  width: 200px;
  padding: 12px 0;
  border: 1px solid #ababab;
  border-radius: 14px;
  background: #f3f4f6;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  transition: all .2s ease;
  animation: fadeSlideIn .4s ease both;
}

.age-btn:nth-child(1) { animation-delay: .05s; }
.age-btn:nth-child(2) { animation-delay: .1s; }
.age-btn:nth-child(3) { animation-delay: .15s; }
.age-btn:nth-child(4) { animation-delay: .2s; }
.age-btn:nth-child(5) { animation-delay: .25s; }
.age-btn:nth-child(6) { animation-delay: .3s; }

.age-btn:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .2);
}

.age-btn:active { transform: translateY(0); }

/* ------------------------------------------------------------------- back */

.back-row { display: flex; justify-content: flex-start; margin-top: 22px; }

.back-link {
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: var(--blue);
  cursor: pointer;
  transition: all .2s ease;
}

.back-link:hover { background: #f0f4ff; border-color: var(--blue); }

/* --------------------------------------------------------- contact fields */

.step3-fields,
.step3-btnwrap,
.step3-text { max-width: 270px; margin: 0 auto; }

.form-group { margin-bottom: 16px; animation: fadeSlideIn .4s ease both; }
.form-group:nth-child(1) { animation-delay: .1s; }
.form-group:nth-child(2) { animation-delay: .2s; }

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  transition: all .2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.form-input.invalid { border-color: #dc2626; background: #fef2f2; }
.form-input.valid   { border-color: var(--green); }

.field-error {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: #dc2626;
  animation: fadeIn .3s ease;
}

.field-error.show { display: block; }

.submit-btn {
  width: 100%;
  height: 50px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  animation: fadeSlideIn .4s ease .3s both;
}

.submit-btn:hover:not(:disabled)  { background: var(--blue-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { background: #cbd5e1; cursor: not-allowed; }

.submit-btn.loading { position: relative; color: transparent; }

.submit-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ------------------------------------------------------------------ terms */

.tc-row {
  display: grid;
  grid-template-columns: 16px auto;
  column-gap: 8px;
  max-width: 270px;
  margin: 12px auto 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.34;
  color: #95a3a4;
  animation: fadeSlideIn .4s ease .4s both;
}

.tc-row input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: #ced4da;
  cursor: pointer;
  transition: all .2s ease;
}

.tc-row input:hover   { background: #adb5bd; }
.tc-row input:checked { background: #95a3a4; }

.tc-row input:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 6px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tc-row label { font-weight: 400; }
.tc-row label span { display: inline-block; margin-left: -24px; font-weight: 400; }
.tc-row a { color: #95a3a4; font-weight: 400; }
.tc-row a:hover { color: #7d8a8b; }

#tcError {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  color: #dc2626;
  text-align: center;
  animation: fadeIn .3s ease;
}

#tcError.show { display: block; }

/* ---------------------------------------------------------------- loading */

.loading-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 275px;
  text-align: center;
  animation: fadeSlideIn .6s ease;
}

.loading-gif { width: 100px; height: auto; }

.loading-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #322f30;
}

/* ----------------------------------------------------------- helper text */

.helper-text {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  animation: fadeIn .5s ease .5s both;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 767px) {
  body { overflow-x: hidden; }

  .start-logo { width: 210px; }

  .survey-wrap {
    width: 94%;
    max-width: 360px;
    margin: 20px auto;
    padding: 20px 15px;
  }

  .survey-title { font-size: 26px; margin-bottom: 20px; }

  .question-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
    text-align: center;
  }

  .question-text { font-size: 18px; }

  .option-group { justify-content: center; }

  .option-btn { min-width: 90px; height: 44px; padding: 0; font-size: 15px; }

  .next-btn { height: 48px; }

  .age-btn { width: 100%; max-width: 260px; padding: 10px 0; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .step-container, .question-row, .age-btn, .form-group,
  .submit-btn, .tc-row, .next-row, .helper-text, .survey-title,
  .loading-message { animation: none; }
}
