/* NPK landing — tuned for Android WebView & low-end browsers */

:root {
  --green: #2d7a3a;
  --green-dark: #1f5a2a;
  --light-green: #e8f5e9;
  --white: #fff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --red-unknown: #c62828;
  --border-mint: #c8e6c9;
  --shadow: 0 2px 10px rgba(45, 122, 58, 0.12);
  --shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --ease: ease;
  --dur: 0.2s;
  --dur-slow: 0.35s;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  color: var(--text);
  background: var(--light-green);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#main-flow {
  min-height: 100vh;
  min-height: 100dvh;
}

.panel {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  position: relative;
}

/* Solid bg = fewer GPU layers than gradient on weak GPUs */
.panel--intro {
  background: var(--green);
  color: var(--white);
  text-align: center;
}

.panel--quiz {
  background: var(--light-green);
}

.panel--result {
  background: var(--white);
  min-height: 0;
  padding-bottom: 3rem;
}

.intro__headline {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  max-width: 22ch;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.intro__sub {
  font-size: clamp(1rem, 3vw, 1.15rem);
  opacity: 0.95;
  max-width: 28ch;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem 1.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: transform var(--dur) var(--ease);
  }
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--white);
  color: var(--green);
  box-shadow: var(--shadow);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn--primary:hover {
    box-shadow: var(--shadow-btn);
  }
}

.btn--cta {
  background: var(--green);
  color: var(--white);
  width: 100%;
  max-width: 420px;
  padding: 1.1rem 1.5rem;
  font-size: 1.1rem;
}

.btn--cta--block {
  width: 100%;
  max-width: none;
}

@media (hover: hover) {
  .btn--cta:hover {
    background: var(--green-dark);
  }
}

.intro__trust {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

#quiz-root {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.quiz-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-bottom: 1px solid rgba(45, 122, 58, 0.15);
  z-index: 10;
}

.quiz-progress__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 0.5rem;
  text-align: center;
}

.quiz-progress__track {
  height: 8px;
  background: var(--border-mint);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
  .quiz-progress__fill {
    transition: width var(--dur-slow) var(--ease);
  }
}

.quiz-step {
  display: none;
  opacity: 0;
  padding-top: 4.5rem;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .quiz-step {
    transform: translate3d(0, 12px, 0);
    transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  }
}

.quiz-step.is-active {
  display: block;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .quiz-step.is-active {
    transform: translate3d(0, 0, 0);
  }

  .quiz-step.is-leaving {
    opacity: 0;
    transform: translate3d(0, -8px, 0);
  }
}

.quiz-question {
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 400px) {
  .answers-grid {
    grid-template-columns: 1fr;
  }
}

.answer-card {
  background: var(--white);
  border: 2px solid var(--border-mint);
  border-radius: var(--radius);
  padding: 1rem 0.85rem;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (prefers-reduced-motion: no-preference) {
  .answer-card {
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  }
}

@media (hover: hover) {
  .answer-card:hover {
    border-color: var(--green);
    box-shadow: var(--shadow);
  }
}

.answer-card.is-selected {
  border-color: var(--green);
  background: var(--light-green);
  box-shadow: var(--shadow);
}

.answer-card .emoji {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.result-hero {
  text-align: center;
  padding-top: 2rem;
  max-width: 560px;
  margin: 0 auto;
}

.result-hero h1 {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.result-hero .subheadline {
  font-size: clamp(1rem, 2.8vw, 1.15rem);
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.npk-meter {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2rem);
  margin: 1.5rem 0 1.25rem;
  padding: 1.25rem;
  background: var(--light-green);
  border-radius: var(--radius);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.npk-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.npk-bar__label {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--green);
}

.npk-bar__col {
  width: 48px;
  height: 100px;
  background: var(--border-mint);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.npk-bar__fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: var(--green);
  border-radius: 0 0 8px 8px;
}

@media (prefers-reduced-motion: no-preference) {
  .npk-bar__fill {
    transition: height var(--dur-slow) var(--ease);
  }
}

.npk-bar.is-unknown .npk-bar__fill {
  display: none;
}

.npk-bar__unknown {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--red-unknown);
  background: rgba(198, 40, 40, 0.12);
}

.npk-bar.is-unknown .npk-bar__unknown {
  display: flex;
}

.result-text {
  max-width: 480px;
  margin: 0 auto 1.5rem;
  text-align: center;
  font-size: 1.05rem;
  color: var(--text);
}

.offer-box {
  border: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  max-width: 420px;
  margin: 0 auto 1.25rem;
  background: var(--light-green);
  text-align: left;
}

.offer-box ul {
  list-style: none;
  margin-bottom: 1rem;
}

.offer-box li {
  padding: 0.35rem 0;
  font-size: 1rem;
}

.offer-price {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
}

.offer-price del {
  color: var(--muted);
  font-weight: 600;
  margin-right: 0.5rem;
}

.offer-price strong {
  color: var(--green-dark);
}

.urgency {
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 2rem;
}

.product-photos {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 2rem;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.product-photos__title {
  text-align: center;
  font-size: 1.35rem;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
  font-weight: 800;
}

.product-photos__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .product-photos__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
  }
}

.product-photos__item {
  margin: 0;
  background: var(--light-green);
  border-radius: var(--radius);
  border: 1px solid var(--border-mint);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-photos__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--white);
}

.product-photos__item figcaption {
  padding: 0.75rem 1rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.35;
}

.reviews-section {
  background: var(--light-green);
  padding: 2.5rem 1rem 3rem;
  width: 100%;
}

.reviews-section h2 {
  text-align: center;
  font-size: 1.5rem;
  color: var(--green-dark);
  margin-bottom: 1.5rem;
}

.reviews-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 700px) {
  .reviews-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.review-card {
  background: var(--white);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-mint);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
}

.review-card__top {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 0.75rem;
}

.review-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-mint);
  background: var(--light-green);
}

.review-card__intro {
  min-width: 0;
  flex: 1;
}

.review-card .meta {
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.35rem;
}

.review-card .stars {
  margin-bottom: 0;
  letter-spacing: 2px;
}

.review-card__quote {
  margin: 0;
  line-height: 1.5;
}

/* Modal: avoid `inset` alone for older WebViews */
.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  padding: 1rem;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: no-preference) {
  .modal-overlay {
    transition: opacity var(--dur-slow) var(--ease);
  }
}

.modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--white);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-btn);
}

.modal-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--green-dark);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-mint);
  border-radius: 10px;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.form-group input:focus {
  outline: none;
  border-color: var(--green);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.modal-actions .btn {
  flex: 1;
  min-width: 140px;
  border-radius: 12px;
}

.modal-sending {
  text-align: center;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green-dark);
  line-height: 1.35;
}

.modal-sending.hidden {
  display: none !important;
}

.btn--success.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn--success.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.25rem;
  height: 1.25rem;
  margin: -0.625rem 0 0 -0.625rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: order-spin 0.65s linear infinite;
}

@keyframes order-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn--success.is-loading::after {
    animation: none;
    border-color: rgba(255, 255, 255, 0.45);
  }
}

.btn--secondary {
  background: #eee;
  color: var(--text);
}

.btn--success {
  background: var(--green);
  color: var(--white);
}

.confirm-summary {
  text-align: center;
  padding: 0.5rem 0 1rem;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
