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

:root {
  --orange: #b85c2a;
  --orange-hover: #a04f22;
  --orange-active: #8f451e;
  --beige: #f5f0e8;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #d8d8d8;
  --footer-bg: #f0f0f0;
  --flow-bg: #f3f3f3;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--beige);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background: var(--beige);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo-placeholder {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.logo-img:not([hidden]) + .logo-placeholder,
.logo:has(.logo-img:not([hidden])) .logo-placeholder {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-call {
  background: var(--orange);
  color: var(--white);
  font-size: 0.8125rem;
  padding: 10px 14px;
}

.btn-call:hover {
  background: var(--orange-hover);
}

/* Hero */
.hero {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 32px;
  min-height: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-color: #5a6b4f;
  background-image: var(--hero-bg-image, linear-gradient(180deg, #6b7d5e 0%, #4a5c42 40%, #3d4f36 100%));
  background-size: cover;
  background-position: center top;
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

/* Quiz card */
.quiz-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin-top: 8px;
}

.quiz-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 28px 24px 24px;
}

.quiz-step {
  display: none;
}

.quiz-step.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

.quiz-title {
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* Options */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option-item {
  position: relative;
}

.option-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.option-label:hover {
  border-color: #bbb;
  background: #fafafa;
}

.option-input:checked + .option-label {
  border-color: var(--orange);
  background: #fef8f4;
  box-shadow: 0 0 0 1px var(--orange);
}

.option-radio {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #bbb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}

.option-input:checked + .option-label .option-radio {
  border-color: var(--orange);
}

.option-radio::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.option-input:checked + .option-label .option-radio::after {
  transform: scale(1);
}

.option-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.option-icon img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}

.option-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

/* CTA */
.btn-submit {
  width: 100%;
  background: var(--orange);
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 16px 20px;
  border-radius: var(--radius);
  gap: 10px;
}

.btn-submit:hover:not(:disabled) {
  background: var(--orange-hover);
}

.btn-submit:active:not(:disabled) {
  background: var(--orange-active);
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-submit--loading {
  pointer-events: none;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
  flex-shrink: 0;
}

.btn-spinner[hidden] {
  display: none;
}

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

.quiz-step--hero .quiz-progress {
  margin-bottom: 20px;
}

.trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.trust-badge svg {
  flex-shrink: 0;
  color: #c9a227;
}

/* Flow layout (steps 2+) */
body.quiz-mode-flow {
  background: var(--flow-bg);
}

.hero--flow {
  align-items: stretch;
  padding: 0;
  min-height: 100dvh;
}

.hero--flow .hero-bg {
  display: none;
}

.hero--flow .quiz-wrapper {
  max-width: 640px;
  margin: 0 auto;
  margin-top: 0;
  min-height: 100dvh;
  display: flex;
}

.quiz-card--flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  border-radius: 0;
  padding: 24px 20px 28px;
  background: var(--flow-bg);
}

.quiz-step--flow {
  flex: 1;
  display: none;
  flex-direction: column;
}

.quiz-step--flow.active {
  display: flex;
}

.quiz-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.quiz-brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.quiz-brand-text {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--orange);
}

.quiz-progress {
  margin-bottom: 28px;
}

.quiz-progress-label {
  display: block;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quiz-progress-bar {
  display: flex;
  gap: 4px;
}

.quiz-progress-segment {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
}

.quiz-progress-segment--filled {
  background: var(--orange);
}

.quiz-step--flow .quiz-title {
  text-align: left;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.quiz-step--flow .quiz-title--with-subtitle {
  margin-bottom: 12px;
}

.quiz-step--flow .quiz-title--input {
  text-align: center;
  margin-bottom: 24px;
}

.quiz-input-wrap {
  position: relative;
  flex: 1;
  margin-bottom: 24px;
}

.quiz-input-check {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) scale(0.5);
  color: #2e7d32;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.25s ease;
  pointer-events: none;
  display: flex;
}

.quiz-input-wrap--valid .quiz-input {
  border-color: #2e7d32;
  box-shadow: 0 0 0 1px #2e7d32;
  padding-right: 48px;
}

.quiz-input-wrap--valid .quiz-input-check {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.quiz-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 1.0625rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quiz-input::placeholder {
  color: #aaa;
}

.quiz-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange);
}

.quiz-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
}

.quiz-step--flow .options-list {
  flex: 1;
  margin-bottom: 24px;
}

.options-list--plain .option-label {
  padding: 16px 18px;
}

.options-list--plain .option-text {
  font-size: 1.0625rem;
}

.quiz-nav {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.btn-back {
  background: var(--white);
  color: var(--orange);
  border: 1.5px solid var(--orange);
  padding: 14px 16px;
  min-width: 52px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.btn-back:hover {
  background: #fef8f4;
}

.btn-back-arrow {
  font-size: 1.125rem;
  line-height: 1;
}

.btn-back-text {
  display: none;
}

.btn-next {
  width: 100%;
  background: var(--orange);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: var(--radius);
}

.btn-next:hover:not(:disabled) {
  background: var(--orange-hover);
}

.btn-next:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.quiz-step--flow .trust-badge {
  margin-top: auto;
  padding-top: 8px;
}

/* Loading screen */
.loading-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 24px;
}

.loading-spinner-ring {
  width: 52px;
  height: 52px;
  border: 4px solid #e8e8e8;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

.loading-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.loading-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
  max-width: 320px;
}

.loading-checklist {
  list-style: none;
  width: 100%;
  max-width: 360px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loading-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.loading-item-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #ccc;
  border-radius: 50%;
  position: relative;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.loading-item-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
}

.loading-item--done {
  color: var(--text);
  font-weight: 500;
}

.loading-item--done .loading-item-icon {
  border-color: #2e7d32;
  background: #2e7d32;
}

.loading-item--done .loading-item-icon::after {
  transform: rotate(45deg) scale(1);
}

/* Result / conversion page */
.quiz-card--result {
  background: var(--white);
}

.quiz-step--result.active {
  display: flex;
}

.result-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0 24px;
}

.result-badge {
  margin-bottom: 20px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  max-width: 400px;
}

.result-lead {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 420px;
}

.result-lead strong {
  color: var(--text);
  font-weight: 600;
}

.result-card {
  width: 100%;
  background: #fef8f4;
  border: 1.5px solid rgba(184, 92, 42, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 24px;
}

.result-card-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.btn-result-call {
  display: flex;
  width: 100%;
  background: var(--orange);
  color: var(--white);
  font-size: 1.125rem;
  font-weight: 700;
  padding: 18px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, transform 0.1s ease;
  animation: pulse-call 2s ease-in-out infinite;
}

.btn-result-call:hover {
  background: var(--orange-hover);
}

.btn-result-call:active {
  transform: scale(0.98);
}

@keyframes pulse-call {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 92, 42, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(184, 92, 42, 0); }
}

.result-card-note {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.result-benefits {
  list-style: none;
  width: 100%;
  max-width: 360px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-benefits li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.4;
}

.result-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #2e7d32;
  font-weight: 700;
}

body.quiz-mode-result {
  background: var(--flow-bg);
}

body.quiz-mode-result .quiz-card--flow {
  background: var(--white);
}

@media (min-width: 768px) {
  .result-title {
    font-size: 1.75rem;
  }

  .result-card {
    padding: 28px 32px;
  }
}

/* Footer */
.site-footer {
  background: var(--footer-bg);
  padding: 20px 16px 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 2px;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links .dot {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 0 2px;
}

.copyright {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.copyright a {
  color: var(--text-muted);
}

/* Responsive */
@media (min-width: 480px) {
  .header-inner {
    padding: 14px 24px;
  }

  .btn-call {
    font-size: 0.875rem;
    padding: 11px 18px;
  }

  .hero {
    padding: 32px 24px 40px;
  }

  .quiz-card {
    padding: 32px 32px 28px;
  }

  .quiz-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }

  .options-list {
    gap: 12px;
    margin-bottom: 24px;
  }
}

@media (min-width: 768px) {
  .quiz-wrapper {
    margin-top: 24px;
  }

  .hero--flow .quiz-wrapper {
    margin-top: 0;
    padding: 32px 24px;
  }

  .quiz-card--flow {
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 36px 40px 32px;
    min-height: auto;
  }

  .quiz-step--flow .quiz-title {
    font-size: 1.75rem;
  }

  .btn-back {
    padding: 14px 20px;
    min-width: auto;
  }

  .btn-back-text {
    display: inline;
    margin-left: 4px;
  }

  .quiz-nav {
    gap: 16px;
  }
}
