/* ==========================================================================
   GrowVyapar WhatsApp Assessment — Phase 1 styles
   Mobile-first. Warm neutral background, single restrained accent colour.
   ========================================================================== */

:root {
  /* Colour */
  --color-bg: #faf7f2;
  --color-surface: #ffffff;
  --color-border: #e4dfd5;
  --color-text: #211d16;
  --color-text-muted: #5c574c;
  --color-accent: #17624a;
  --color-accent-dark: #114a38;
  --color-accent-contrast: #ffffff;
  --color-accent-soft: #e8f2ee;
  --color-danger: #a3312a;
  --color-danger-soft: #fbeceb;
  --color-focus: #0f5c9c;

  /* Type */
  --font-body: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Spacing / sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --touch-min: 44px;
  --max-width: 560px;

  /* Motion */
  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;
}

@media (prefers-color-scheme: dark) {
  /* Intentionally not switching to a dark theme in Phase 1 — the brief calls
     for a single calm warm-neutral look. Colours stay fixed for consistency
     across devices and inside WhatsApp's in-app browser. */
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a {
  color: var(--color-accent);
}

/* Focus states — accessible, visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------- */
/* noscript */
/* ---------------------------------------------------------------------- */

.noscript-banner {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  padding: 16px;
  text-align: center;
  font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Header */
/* ---------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-accent-dark);
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------------- */
/* Progress */
/* ---------------------------------------------------------------------- */

.progress-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 14px 20px 0;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 999px;
  width: 0%;
  transition: width var(--transition-base);
}

.progress-label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Wizard layout */
/* ---------------------------------------------------------------------- */

.wizard {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 24px 20px 40px;
}

.loading-fallback {
  color: var(--color-text-muted);
  padding: 40px 0;
  text-align: center;
}

.screen {
  animation: screen-in var(--transition-base);
}

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

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .progress-fill { transition: none; }
  * { scroll-behavior: auto !important; }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0 0 10px;
}

.stage-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}

h1.headline,
h2.headline {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 14px;
  color: var(--color-text);
}

.supporting-copy {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin: 0 0 20px;
}

.trust-points {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trust-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--color-text);
}

.trust-points li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--color-accent);
}

.privacy-note {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 16px;
}

/* ---------------------------------------------------------------------- */
/* Answer options */
/* ---------------------------------------------------------------------- */

.question-block {
  margin-bottom: 22px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--touch-min);
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.option-btn:hover {
  border-color: var(--color-accent);
}

.option-btn__mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  position: relative;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.option-btn[data-multi="true"] .option-btn__mark {
  border-radius: 6px;
}

.option-btn.is-selected {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.option-btn.is-selected .option-btn__mark {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.option-btn.is-selected .option-btn__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 6px;
  border-left: 2.5px solid var(--color-accent-contrast);
  border-bottom: 2.5px solid var(--color-accent-contrast);
  transform: translateY(-1px) rotate(-45deg);
}

.option-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.option-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: -6px 0 14px;
}

.selection-warning {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  margin: -4px 0 14px;
}

.selection-warning.is-visible {
  display: flex;
}

/* ---------------------------------------------------------------------- */
/* Form fields */
/* ---------------------------------------------------------------------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.field .optional-tag {
  font-weight: 400;
  color: var(--color-text-muted);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field select {
  width: 100%;
  min-height: var(--touch-min);
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.field input:focus,
.field select:focus {
  border-color: var(--color-accent);
}

.field input.has-error,
.field select.has-error {
  border-color: var(--color-danger);
}

.field-error {
  display: none;
  color: var(--color-danger);
  font-size: 0.82rem;
  margin-top: 6px;
  font-weight: 600;
}

.field-error.is-visible {
  display: block;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
}

.checkbox-field input[type="checkbox"] {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--color-accent);
}

.checkbox-field label {
  font-size: 0.92rem;
  color: var(--color-text);
  font-weight: 400;
}

/* ---------------------------------------------------------------------- */
/* Buttons / nav */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  width: 100%;
}

.btn--primary:hover {
  background: var(--color-accent-dark);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-accent-dark);
  border-color: var(--color-accent);
  width: 100%;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

.btn--small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn--link {
  background: none;
  border: none;
  color: var(--color-accent);
  padding: 8px 0;
  font-weight: 600;
  width: auto;
}

.is-hidden {
  display: none !important;
}

.nav-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.nav-row .btn--ghost {
  flex: none;
}

.nav-row .btn--primary {
  flex: 1;
}

/* ---------------------------------------------------------------------- */
/* Result screen */
/* ---------------------------------------------------------------------- */

.result-summary {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 18px 0;
}

.result-summary h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.result-summary ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-muted);
}

.result-summary li {
  margin-bottom: 6px;
}

.reveal-box {
  background: var(--color-accent-soft);
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 22px 0;
}

.reveal-box__label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin: 0 0 6px;
}

.reveal-box__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0 0 12px;
  color: var(--color-accent-dark);
}

.reveal-box ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.reveal-box li {
  margin-bottom: 6px;
}

.pricing-row {
  display: flex;
  gap: 12px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

.pricing-pill {
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

/* ---------------------------------------------------------------------- */
/* Modal (demo request + legal) */
/* ---------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 29, 22, 0.45);
}

.modal__panel {
  position: relative;
  background: var(--color-surface);
  width: 100%;
  max-width: var(--max-width);
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 28px;
  animation: modal-in var(--transition-base);
}

@keyframes modal-in {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .modal__panel { animation: none; }
}

@media (min-width: 640px) {
  .modal {
    align-items: center;
  }
  .modal__panel {
    border-radius: 16px;
  }
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 4px 30px 16px 0;
}

.modal__body p {
  color: var(--color-text-muted);
  line-height: 1.6;
}

.demo-success {
  background: var(--color-accent-soft);
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin-top: 14px;
}

/* ---------------------------------------------------------------------- */
/* Footer */
/* ---------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  margin-top: auto;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}

.site-footer__links a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
}

.site-footer__links a:hover {
  color: var(--color-accent);
}

.site-footer__tagline {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Small screens guard (320px) */
/* ---------------------------------------------------------------------- */

@media (max-width: 340px) {
  .wizard,
  .site-header__inner,
  .site-footer__inner,
  .progress-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }
}
