/* ═══════════════════════════════════════════════════════════════
   SINDIBAD BEACH RESORT — Premium Quiz Wizard
   Centered Layout · Luxury Real-Estate Aesthetic
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS CUSTOM PROPERTIES ─────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-page: #f6f2ed;
  --bg-card: #ffffff;
  --bg-card-hover: #faf7f3;
  --bg-selected: rgba(139, 74, 50, 0.05);

  /* Text */
  --clr-heading: #6b3425;
  --clr-body: #3d3630;
  --clr-muted: #9a8d80;
  --clr-light: #c4b8ab;
  --clr-placeholder: #c0b5a7;

  /* Borders & lines */
  --clr-border: #e6dfd7;
  --clr-border-hover: #d4cbc1;
  --clr-grid: #ece6de;

  /* Accent */
  --clr-accent: #8b4a32;
  --clr-accent-h: #6f3826;
  --clr-accent-soft: rgba(139, 74, 50, 0.08);

  /* Misc */
  --clr-error: #c0392b;
  --clr-success: #6b3425;

  /* Radii */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  /* Transitions */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --transition: 0.45s var(--ease);
  --transition-fast: 0.25s var(--ease);

  /* Fonts */
  --ff-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Sizing */
  --container-max: 620px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--ff-sans);
  font-weight: 400;
  color: var(--clr-body);
  background: var(--bg-page);
  min-height: 100vh;
  overflow-x: hidden;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
button,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── BACKGROUND GRID ───────────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 0;
  padding: 0 8vw;
}

.bg-grid span {
  width: 1px;
  height: 100%;
  background: var(--clr-grid);
  opacity: .35;
}

/* ── QUIZ WRAPPER — centers everything ─────────────────────── */
.quiz-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 24px;
}

.quiz-container {
  width: 100%;
  max-width: var(--container-max);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── BRAND ─────────────────────────────────────────────────── */
.brand {
  text-align: center;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.brand__name {
  font-family: var(--ff-serif);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--clr-muted);
}

.brand__divider {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--clr-border);
}

/* ── PROGRESS ──────────────────────────────────────────────── */
.progress {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 44px;
  transition: opacity var(--transition);
}

.progress__track {
  flex: 1;
  height: 2px;
  background: var(--clr-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress__fill {
  width: 25%;
  height: 100%;
  background: var(--clr-accent);
  border-radius: 2px;
  transition: width var(--transition);
}

.progress__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--clr-muted);
  letter-spacing: 0.1em;
  white-space: nowrap;
  min-width: 32px;
  text-align: right;
}

/* ── STEPS (shared) ────────────────────────────────────────── */
.step {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: fadeSlideIn var(--transition) both;
}

.step--active {
  display: flex;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}

.step__counter {
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-light);
  margin-bottom: 14px;
  text-align: center;
}

.step__title {
  font-family: var(--ff-serif);
  font-weight: 500;
  font-size: 1.65rem;
  line-height: 1.35;
  color: var(--clr-heading);
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: -0.01em;
}

.step__subtitle {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--clr-body);
  text-align: center;
  max-width: 440px;
}

/* ── CHOICE CARDS ──────────────────────────────────────────── */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  color: var(--clr-body);
  transition: all 0.3s ease;
  gap: 6px;
  line-height: 1.45;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
}

.choice:hover {
  background: var(--bg-card-hover);
  border-color: var(--clr-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
}

.choice:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

.choice.is-selected {
  border-color: var(--clr-accent);
  background: var(--bg-selected);
  box-shadow: 0 0 0 1px var(--clr-accent), 0 4px 16px rgba(139, 74, 50, .08);
}

.choice.is-selected .choice__label,
.choice.is-selected .choice__detail {
  color: var(--clr-heading);
  font-weight: 500;
}

/* Checkmark on selected */
.choice.is-selected::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--clr-accent);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8.5l3 3 5-5.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px;
  animation: scaleCheck 0.3s var(--ease) both;
}

@keyframes scaleCheck {
  from {
    transform: translateY(-50%) scale(0);
  }

  to {
    transform: translateY(-50%) scale(1);
  }
}

.choice__label {
  font-size: 0.93rem;
  font-weight: 420;
  transition: color 0.2s ease;
}

.choice__detail {
  font-size: 0.93rem;
  font-weight: 420;
  color: inherit;
  margin-left: 0;
  white-space: nowrap;
}

/* ── BACK BUTTON ───────────────────────────────────────────── */
.btn-back {
  background: none;
  border: none;
  color: var(--clr-muted);
  font-size: 0.83rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--clr-light);
  margin-top: 28px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
  padding: 4px 0;
}

.btn-back:hover {
  color: var(--clr-body);
  text-decoration-color: var(--clr-body);
}

.btn-back:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── PRIMARY BUTTON ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.93rem;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.btn--primary {
  background: var(--clr-accent);
  color: #fff;
  padding: 16px 48px;
}

.btn--primary:hover:not(:disabled) {
  background: var(--clr-accent-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(139, 74, 50, .2);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(139, 74, 50, .15);
}

.btn--primary:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
}

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

/* ── RESULT MESSAGE ────────────────────────────────────────── */
.result-message {
  margin-bottom: 36px;
  text-align: center;
}

.result-message h2 {
  font-family: var(--ff-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--clr-heading);
  margin-bottom: 16px;
}

.result-message p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--clr-body);
  max-width: 480px;
  margin: 0 auto;
}

/* ── TYPING INDICATOR ────────────────────────────────────────── */
.typing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--clr-border);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.typing-indicator span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--clr-muted);
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
    background-color: var(--clr-heading);
  }
}

/* ── LEAD FORM ─────────────────────────────────────────────── */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.form-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

.form-row--half .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--clr-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-group input {
  padding: 15px 20px;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.93rem;
  color: var(--clr-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input::placeholder {
  color: var(--clr-placeholder);
  font-weight: 300;
}

.form-group input:hover {
  border-color: var(--clr-border-hover);
}

.form-group input:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-soft);
}

.form-group input.has-error {
  border-color: var(--clr-error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .08);
}

.form-error {
  font-size: 0.75rem;
  color: var(--clr-error);
  min-height: 1em;
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.form-error.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.btn--submit {
  margin-top: 8px;
  width: 100%;
  padding: 17px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

/* ── SUCCESS BLOCK ─────────────────────────────────────────── */
.success-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 0;
}

.success-icon {
  width: 60px;
  height: 60px;
  color: var(--clr-success);
  animation: scaleIn 0.5s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-block .step__title {
  margin-bottom: 4px;
}

.success-block .step__subtitle {
  max-width: 380px;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 680px) {
  .quiz-wrapper {
    padding: 32px 16px;
    align-items: flex-start;
  }

  .quiz-container {
    max-width: 100%;
  }

  .step__title {
    font-size: 1.4rem;

    br {
      display: none;
    }
  }

  .choice {
    padding: 16px 18px;
  }

  .choice__label,
  .choice__detail {
    font-size: 0.88rem;
  }

  .choice.is-selected::after {
    right: 14px;
    width: 20px;
    height: 20px;
  }

  .form-row--half {
    flex-direction: column;
    gap: 20px;
  }

  .bg-grid {
    padding: 0 5vw;
  }

  .bg-grid span:first-child,
  .bg-grid span:last-child {
    display: none;
  }
}

@media (max-width: 400px) {
  .quiz-wrapper {
    padding: 24px 12px;
  }

  .step__title {
    font-size: 1.25rem;
  }

  .choice {
    padding: 14px 16px;
  }

  .btn--primary {
    padding: 15px 32px;
  }
}