:root {
  --primary: #0d6e56;
  --primary-dark: #084a3a;
  --primary-light: #2dd4a8;
  --primary-surface: #e8f8f0;
  --text: #1a2e28;
  --text-muted: #5a6f66;
  --border: #dce8e2;
  --bg: #f4faf7;
  --white: #fff;
  --tab-h: 62px;
  --header-h: 52px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 10px rgba(13, 110, 86, 0.06);
  --shadow-md: 0 10px 28px rgba(13, 110, 86, 0.1);
  --section-pad: 28px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #d8efe6 0%, var(--primary-surface) 50%, #eef7f2 100%);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }

/* Shell */
.app-shell {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

/* Splash */
.app-splash {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(160deg, var(--primary-dark), var(--primary));
  color: #fff;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.app-splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo {
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  margin-bottom: 4px;
}
.splash-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.splash-sub {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Header */
.app-header {
  flex-shrink: 0;
  min-height: var(--header-h);
  padding: calc(8px + var(--safe-t)) 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(220, 232, 226, 0.8);
  z-index: 20;
}
.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary-dark);
  min-width: 0;
}
.app-logo-mark {
  border-radius: 8px;
  flex-shrink: 0;
}
.app-logo-text {
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.app-logo-text em {
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.8rem;
}

/* Scroll */
.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
}

/* Tab bar */
.app-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 0 8px var(--safe-b);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(220, 232, 226, 0.9);
  z-index: 30;
}
.tab-group {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-width: 0;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 6px 2px;
  border-radius: 10px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 1.1rem; line-height: 1; }
.tab-register {
  flex: 0 0 72px;
  width: 72px;
  height: 54px;
  color: var(--white);
  background: linear-gradient(145deg, var(--primary-light), var(--primary));
  margin: -16px 4px 10px;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(13, 110, 86, 0.38);
  align-self: center;
}
.tab-register .tab-icon-cta {
  font-size: 1.2rem;
  font-weight: 700;
}
.tab-register .tab-label { color: #fff; }

/* Sections */
.section-block {
  padding: var(--section-pad) 18px;
}
.section-block.alt { background: var(--white); }
.section-block.section-faq {
  background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
}
.section-head {
  margin-bottom: 18px;
}
.section-head-center {
  text-align: center;
}
.section-eyebrow {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-surface);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.section-block.alt .section-eyebrow {
  background: var(--bg);
}
.section-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--primary-dark);
}
.section-desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.sub-title {
  margin: 18px 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.sub-title-feed { margin-top: 20px; }

.card-elevated {
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(220, 232, 226, 0.9) !important;
}

/* Hero */
.hero {
  padding: 12px 18px 28px;
  background: linear-gradient(180deg, #fff 0%, var(--primary-surface) 45%, var(--bg) 100%);
}
.hero-visual {
  margin-bottom: 16px;
}
.img-placeholder {
  background: linear-gradient(135deg, #d4ede4, #b8dfd0);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
}
.img-placeholder.has-image { border: none; }
.img-placeholder img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
}
.placeholder-label {
  display: grid;
  place-items: center;
  height: 180px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-dark);
  padding: 16px;
}
.img-placeholder.has-image .placeholder-label { display: none; }

.hero-badge {
  display: inline-block;
  background: var(--white);
  border: 1px solid rgba(13, 110, 86, 0.15);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}
.hero-lead {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.hero-chips span {
  font-size: 0.7rem;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.hero-actions .btn-block:last-child { margin-bottom: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, opacity 0.12s, box-shadow 0.12s;
}
.btn:active { opacity: 0.9; transform: scale(0.98); }
.btn-block { display: flex; width: 100%; margin-bottom: 10px; }
.btn-primary {
  background: linear-gradient(145deg, var(--primary-light), var(--primary));
  color: #fff;
  box-shadow: 0 6px 18px rgba(13, 110, 86, 0.28);
}
.btn-outline {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.btn-chip {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-chip.selected,
.btn-chip.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(13, 110, 86, 0.25);
}

/* Why grid */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.why-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.why-icon {
  font-size: 1.45rem;
  margin-bottom: 8px;
  line-height: 1;
}
.why-card h3 {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.why-card p {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.service-card {
  display: block;
  box-sizing: border-box;
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}
.service-card:hover,
.service-card:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  outline: none;
}
.service-card:active {
  transform: scale(0.98);
}
.section-block.alt .service-card { background: var(--bg); }
.service-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
}
.service-card h3 {
  margin: 0 0 4px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.service-card-hint {
  display: block;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* Quiz */
.quiz-section { padding-top: var(--section-pad); }
.quiz-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.quiz-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  min-height: 172px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.quiz-panel-question {
  justify-content: center;
  align-items: stretch;
  text-align: center;
}
.quiz-progress {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-surface);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.quiz-q {
  margin: 0 0 14px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-options {
  display: flex;
  gap: 8px;
  width: 100%;
}
.quiz-options .btn-quiz { flex: 1; min-width: 0; }
.quiz-panel-result { justify-content: flex-start; }
.quiz-result-label {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.35;
}
.quiz-result-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-result-placeholder {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}
.quiz-result-highlight {
  width: 100%;
  padding: 14px 10px;
  border: 2px solid rgba(13, 110, 86, 0.22);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(13, 110, 86, 0.1);
  background: linear-gradient(180deg, #f8fffc 0%, var(--white) 100%);
  text-align: center;
}
.quiz-result-category {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
  line-height: 1.3;
}
.quiz-result-services {
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Steps timeline */
.steps-list { display: flex; flex-direction: column; gap: 0; }
.steps-timeline { position: relative; padding-left: 4px; }
.step-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.section-block.alt .step-row { background: var(--bg); }
.step-row:last-child { margin-bottom: 0; }
.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary-light), var(--primary));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 4px 10px rgba(13, 110, 86, 0.25);
}
.step-body h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.step-body p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Testimonials */
.testimonial-stack { display: flex; flex-direction: column; gap: 12px; }
.testimonial-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.section-block.alt .testimonial-card { background: var(--bg); }
.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--primary-surface);
  font-weight: 800;
  pointer-events: none;
}
.testimonial-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.avatar-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-surface), #d0ede2);
  border: 2px solid var(--white);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--primary);
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}
.testimonial-header strong { display: block; font-size: 0.88rem; }
.testimonial-header span { font-size: 0.72rem; color: var(--text-muted); }
.testimonial-card blockquote {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: normal;
  line-height: 1.5;
}

/* Leaderboard */
.leaderboard-panel, .feed-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 14px;
  box-shadow: var(--shadow-sm);
}
.section-block.alt .leaderboard-panel,
.section-block.alt .feed-panel { background: var(--bg); }
.leader-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.leader-row:last-child { border-bottom: none; }
.leader-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-surface);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--primary);
}
.leader-row:first-child .leader-rank {
  background: linear-gradient(145deg, #ffd966, #f5a623);
  color: #5c3d00;
}
.leader-info { flex: 1; min-width: 0; }
.leader-info strong { display: block; font-size: 0.85rem; }
.leader-info span { font-size: 0.7rem; color: var(--text-muted); }
.leader-earn {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.76rem;
  white-space: nowrap;
}
.feed-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.feed-item:last-child { border-bottom: none; }
.feed-item strong { color: var(--text); }

/* Calculator & rewards */
.calc-panel, .reward-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
}
.section-block.alt .calc-panel,
.section-block.alt .reward-panel { background: var(--bg); }
.reward-panel { margin-bottom: 0; }
.form-group { margin-bottom: 16px; }
.form-group:last-of-type { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-dark);
}
.form-group select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  background: var(--white);
  color: var(--text);
}
.form-group input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  margin-top: 4px;
}
.range-value {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
}
.calc-result {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-surface), #dff5ea);
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(13, 110, 86, 0.12);
}
.calc-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.amount {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.reward-panel .sub-title { margin-top: 0; }
.reward-desc {
  margin: 0 0 14px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.level-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.level-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.level-card-elite {
  border-color: rgba(13, 110, 86, 0.3);
  background: linear-gradient(135deg, #f0faf5 0%, var(--white) 100%);
}
.level-badge {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.level-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.level-body strong {
  font-size: 0.82rem;
  color: var(--primary-dark);
}
.level-body span {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* FAQ */
.faq-list { margin-bottom: 4px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.faq-item.open {
  border-color: rgba(13, 110, 86, 0.25);
}
.faq-q {
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  background: none;
  border: none;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.faq-q::after {
  content: '+';
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-surface);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}
.faq-item.open .faq-q::after {
  content: '−';
  background: var(--primary);
  color: #fff;
}
.faq-a {
  display: none;
  padding: 0 16px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.faq-item.open .faq-a { display: block; }

/* CTA & footer */
.cta-banner {
  margin-top: 24px;
  padding: 24px 20px;
  background: linear-gradient(145deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius-lg);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.cta-banner h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cta-banner p {
  margin: 0 0 16px;
  font-size: 0.8rem;
  opacity: 0.9;
  line-height: 1.45;
}
.cta-banner .btn-primary {
  background: #fff;
  color: var(--primary-dark);
  margin-bottom: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.app-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-logo {
  margin: 0 auto 10px;
  border-radius: 10px;
  opacity: 0.9;
}
.app-footer p {
  margin: 0 0 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.footer-links-inline {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

@media (min-width: 431px) {
  .app-shell {
    margin-top: 16px;
    margin-bottom: 16px;
    height: calc(100dvh - 32px);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(13, 110, 86, 0.14);
    overflow: hidden;
  }
}

.app-scroll::-webkit-scrollbar { width: 0; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.feed-item { animation: fadeIn 0.35s ease; }
