/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream:   #f5f0e8;
  --bone:    #ede8dc;
  --dark:    #1a1714;
  --mid:     #3d3730;
  --muted:   #8a8278;
  --accent:  #c8a96e;
  --accent2: #e8c98a;
  --white:   #ffffff;
  --shadow:  0 8px 40px rgba(0,0,0,0.18);
  --radius:  2px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --transition:   0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--cream);
}

/* ── APP WRAPPER ──────────────────────────────────────────── */
#app {
  position: relative;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── BACKGROUND ───────────────────────────────────────────── */
.bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  filter: brightness(0.45) saturate(0.7);
  transition: background-image 0.5s ease;
  z-index: 0;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(26,23,20,0.55) 0%,
    rgba(26,23,20,0.35) 50%,
    rgba(26,23,20,0.7) 100%
  );
  z-index: 1;
}

/* ── PROGRESS BAR ─────────────────────────────────────────── */
.progress-bar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.08);
  z-index: 100;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  transition: width 0.5s var(--transition);
}

/* ── PAGES CONTAINER ──────────────────────────────────────── */
.pages-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SINGLE PAGE ──────────────────────────────────────────── */
.page {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(48px);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.page.active {
  opacity: 1;
  transform: translateX(0);
}

.page.exit-left {
  opacity: 0;
  transform: translateX(-48px);
  pointer-events: none;
}

.page.exit-right {
  opacity: 0;
  transform: translateX(48px);
  pointer-events: none;
}

.page.shake {
  animation: shake 0.45s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-10px); }
  40%       { transform: translateX(10px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

.page-inner {
  width: 100%;
}

/* ── QUESTION TEXT ────────────────────────────────────────── */
.question-text {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.question-hint {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 32px;
  font-weight: 300;
  line-height: 1.5;
}

/* ── INPUT WRAPPER ────────────────────────────────────────── */
.input-wrap {
  width: 100%;
}

/* ── SHORT INPUT ──────────────────────────────────────────── */
.input-short {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(255,255,255,0.25);
  padding: 12px 0;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--white);
  outline: none;
  transition: border-color 0.25s ease;
  caret-color: var(--accent);
}

.input-short::placeholder {
  color: rgba(255,255,255,0.25);
}

.input-short:focus {
  border-bottom-color: var(--accent);
}

/* ── LONG INPUT ───────────────────────────────────────────── */
.input-long {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--white);
  outline: none;
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
  transition: border-color 0.25s ease, background 0.25s ease;
  caret-color: var(--accent);
}

.input-long::placeholder {
  color: rgba(255,255,255,0.25);
}

.input-long:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.08);
}

/* ── CHOICE / CHECKLIST ───────────────────────────────────── */
.choice-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  font-size: 0.97rem;
  font-weight: 300;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.04);
  user-select: none;
}

.choice-item:hover {
  background: rgba(200,169,110,0.1);
  border-color: rgba(200,169,110,0.4);
  transform: translateX(4px);
}

.choice-item.selected {
  background: rgba(200,169,110,0.15);
  border-color: var(--accent);
  color: var(--white);
}

.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.choice-item input[type="checkbox"] {
  border-radius: 3px;
}

.choice-item input[type="radio"]:checked,
.choice-item input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.choice-item input[type="radio"]:checked::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--dark);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.choice-item input[type="checkbox"]:checked::after {
  content: '✓';
  display: block;
  font-size: 11px;
  color: var(--dark);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
}

/* ── START BUTTON (intro page) ────────────────────────────── */
.btn-start {
  margin-top: 8px;
  padding: 16px 36px;
  background: var(--accent);
  color: var(--dark);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-start:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

/* ── NAV BUTTONS ──────────────────────────────────────────── */
.nav-buttons {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  z-index: 20;
  align-items: center;
}

.btn-back,
.btn-next,
.btn-submit {
  padding: 13px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  border: 1.5px solid transparent;
}

.btn-back {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border-color: rgba(255,255,255,0.15);
}

.btn-back:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}

.btn-next {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}

.btn-next:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.btn-submit {
  background: var(--accent);
  color: var(--dark);
  font-weight: 500;
}

.btn-submit:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── THANK YOU SCREEN ─────────────────────────────────────── */
.thankyou-screen {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.thankyou-screen.active {
  opacity: 1;
}

.thankyou-inner {
  max-width: 420px;
  padding: 0 24px;
}

.thankyou-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 24px;
  animation: spin-in 0.8s ease forwards;
}

@keyframes spin-in {
  from { transform: rotate(-90deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(0deg) scale(1); opacity: 1; }
}

.thankyou-inner h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 4rem;
  color: var(--white);
  margin-bottom: 16px;
}

.thankyou-inner p {
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
}

/* ── SCROLLABLE CHOICE LIST ON SMALL SCREENS ──────────────── */
@media (max-height: 700px) {
  .input-wrap {
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 4px;
  }
  .input-wrap::-webkit-scrollbar { width: 3px; }
  .input-wrap::-webkit-scrollbar-track { background: transparent; }
  .input-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
}

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pages-container {
    padding: 0 20px;
    align-items: flex-start;
    padding-top: 80px;
  }

  .question-text {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .nav-buttons {
    bottom: 24px;
  }

  .choice-item {
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .btn-back, .btn-next, .btn-submit {
    padding: 12px 20px;
    font-size: 0.85rem;
  }
}
