* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --tf-accent: #2d6a4f;
  --tf-accent-2: #40916c;
  --tf-accent-soft: rgba(45, 106, 79, 0.14);
  --tf-accent-glow: rgba(45, 106, 79, 0.35);
  --tf-bg: #f4f7f5;
  --tf-text: #152318;
  --tf-muted: #5c6f62;
  --tf-card: #ffffff;
  --tf-shadow: 0 12px 40px rgba(21, 35, 24, 0.1);
  --tf-radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--tf-bg);
  color: var(--tf-text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
  position: relative;
}

/* Animated mesh background */
.tf-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.tf-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.tf-bg-orb-1 {
  width: 340px; height: 340px;
  top: -100px; right: -60px;
  background: var(--tf-accent-soft);
  animation-delay: 0s;
}

.tf-bg-orb-2 {
  width: 260px; height: 260px;
  bottom: 10%; left: -80px;
  background: rgba(64, 145, 108, 0.18);
  animation-delay: -6s;
}

.tf-bg-orb-3 {
  width: 180px; height: 180px;
  top: 45%; right: 15%;
  background: rgba(45, 106, 79, 0.1);
  animation-delay: -12s;
}

.tf-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45,106,79,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,106,79,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black, transparent);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -15px) scale(1.05); }
  66% { transform: translate(-15px, 10px) scale(0.95); }
}

.tf-top {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  background: rgba(244, 247, 245, 0.75);
}

.tf-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.1rem;
  height: 6px;
  background: rgba(0,0,0,0.04);
}

.tf-bar {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
}

.tf-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--tf-accent), var(--tf-accent-2));
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 16px var(--tf-accent-glow);
}

.tf-pct {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tf-accent);
  min-width: 2.2rem;
  text-align: right;
}

.tf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  min-height: 52px;
}

.tf-back {
  background: var(--tf-card);
  border: 1px solid rgba(0,0,0,0.06);
  width: 42px; height: 42px;
  border-radius: 12px;
  font-size: 1.15rem;
  cursor: pointer;
  visibility: hidden;
  box-shadow: var(--tf-shadow);
  transition: transform 0.15s, border-color 0.2s;
  color: var(--tf-text);
}

.tf-back:hover { border-color: var(--tf-accent); }
.tf-back:active { transform: scale(0.94); }

.tf-counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tf-muted);
  background: var(--tf-card);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tf-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.1rem 2.5rem;
  position: relative;
  z-index: 1;
}

#tf-screen {
  width: 100%;
  max-width: 600px;
}

.tf-screen-enter {
  animation: screenIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tf-screen-exit {
  animation: screenOut 0.28s ease forwards;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes screenOut {
  to { opacity: 0; transform: translateY(-16px) scale(0.98); }
}

/* Welcome */
.tf-welcome { text-align: left; }

.tf-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
  padding: 0.5rem 0.85rem 0.5rem 0.5rem;
  background: var(--tf-card);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--tf-shadow);
}

.tf-logo-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tf-accent), var(--tf-accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 4px 16px var(--tf-accent-glow);
}

.tf-logo {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tf-muted);
}

.tf-welcome h1,
.tf-question h2,
.tf-thanks h2 {
  font-size: clamp(1.75rem, 5.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.9rem;
  letter-spacing: -0.03em;
}

.tf-welcome p,
.tf-hint,
.tf-thanks p,
.tf-reg-sub {
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--tf-muted);
  margin-bottom: 1.25rem;
}

.tf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.tf-stat {
  background: var(--tf-card);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 12px;
  padding: 0.85rem 0.6rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.tf-stat-num {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--tf-accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.tf-stat-lbl {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--tf-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tf-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
}

.tf-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: var(--tf-card);
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--tf-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tf-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tf-accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.tf-step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tf-accent);
  margin-bottom: 0.7rem;
  padding: 0.35rem 0.7rem;
  background: var(--tf-accent-soft);
  border-radius: 8px;
}

.tf-branch-toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--tf-accent-soft), rgba(255,255,255,0.8));
  border: 1px solid rgba(45,106,79,0.2);
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tf-text);
  animation: toastIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tf-branch-toast-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--tf-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-12px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.tf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  padding: 1.05rem 2rem;
  min-height: 54px;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--tf-accent), var(--tf-accent-2));
  color: #fff;
  box-shadow: 0 6px 24px var(--tf-accent-glow);
  transition: transform 0.15s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.tf-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.tf-btn:hover::after { transform: translateX(100%); }
.tf-btn:hover { box-shadow: 0 8px 32px var(--tf-accent-glow); }
.tf-btn:active { transform: scale(0.97); }

.tf-btn-arrow { font-size: 1.2rem; transition: transform 0.2s; }
.tf-btn:hover .tf-btn-arrow { transform: translateX(3px); }

.tf-btn-hint {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.76rem;
  color: var(--tf-muted);
}

.tf-btn.loading {
  pointer-events: none;
  opacity: 0.85;
}

.tf-btn .tf-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Options */
.tf-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.tf-option {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 1.2rem;
  min-height: 60px;
  border-radius: var(--tf-radius);
  border: 2px solid rgba(0,0,0,0.05);
  background: var(--tf-card);
  color: var(--tf-text);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: border-color 0.22s, transform 0.18s, box-shadow 0.22s, background 0.22s;
  opacity: 0;
  animation: optIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.tf-option:nth-child(1) { animation-delay: 0.05s; }
.tf-option:nth-child(2) { animation-delay: 0.1s; }
.tf-option:nth-child(3) { animation-delay: 0.15s; }
.tf-option:nth-child(4) { animation-delay: 0.2s; }
.tf-option:nth-child(5) { animation-delay: 0.25s; }
.tf-option:nth-child(6) { animation-delay: 0.3s; }
.tf-option:nth-child(7) { animation-delay: 0.35s; }
.tf-option:nth-child(8) { animation-delay: 0.4s; }
.tf-option:nth-child(9) { animation-delay: 0.45s; }

@keyframes optIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.tf-option:hover {
  border-color: var(--tf-accent);
  box-shadow: var(--tf-shadow);
  transform: translateY(-2px);
}

.tf-option.selected {
  border-color: var(--tf-accent);
  background: var(--tf-accent-soft);
  box-shadow: 0 0 0 3px var(--tf-accent-soft);
}

.tf-key {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--tf-accent-soft);
  color: var(--tf-accent);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf-opt-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--tf-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tf-accent);
}

.tf-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.tf-ico svg {
  width: 20px;
  height: 20px;
}

.tf-branch-toast-icon .tf-ico svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.tf-check .tf-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tf-check .tf-ico svg {
  width: 16px;
  height: 16px;
  color: var(--tf-accent);
}

.tf-option-label { flex: 1; line-height: 1.4; }

.tf-option-desc {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--tf-muted);
  margin-top: 0.15rem;
}

/* Inputs */
.tf-field {
  position: relative;
  margin-bottom: 1.25rem;
}

.tf-input {
  width: 100%;
  font-family: inherit;
  font-size: 1.1rem;
  padding: 1.1rem 0 0.5rem;
  border: none;
  border-bottom: 2px solid rgba(0,0,0,0.1);
  background: transparent;
  outline: none;
  color: var(--tf-text);
  transition: border-color 0.2s;
}

.tf-input:focus { border-color: var(--tf-accent); }
.tf-input:focus + .tf-label,
.tf-input:not(:placeholder-shown) + .tf-label {
  transform: translateY(-1.4rem) scale(0.82);
  color: var(--tf-accent);
}

.tf-label {
  position: absolute;
  left: 0; top: 1rem;
  font-size: 1rem;
  color: var(--tf-muted);
  pointer-events: none;
  transition: transform 0.2s, color 0.2s;
  transform-origin: left;
}

.tf-reg-card {
  background: var(--tf-card);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--tf-shadow);
  border: 1px solid rgba(0,0,0,0.04);
}

.tf-reg-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.05);
  font-size: 0.78rem;
  color: var(--tf-muted);
}

.tf-reg-trust svg { flex-shrink: 0; color: var(--tf-accent); }

.tf-checks-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tf-muted);
  margin: 1.35rem 0 0.75rem;
}

.tf-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

@media (max-width: 420px) {
  .tf-checks { grid-template-columns: 1fr; }
}

.tf-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: var(--tf-bg);
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.tf-check:hover { border-color: rgba(45,106,79,0.25); }
.tf-check:has(input:checked) {
  border-color: var(--tf-accent);
  background: var(--tf-accent-soft);
  transform: scale(1.01);
}

.tf-check input {
  width: 18px; height: 18px;
  accent-color: var(--tf-accent);
}

/* Thanks */
.tf-thanks { text-align: center; padding: 1.5rem 0; }

.tf-checkmark {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--tf-accent-soft), rgba(255,255,255,0.9));
  color: var(--tf-accent);
  border: 3px solid var(--tf-accent);
  animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.tf-checkmark::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--tf-accent);
  opacity: 0;
  animation: ring 1s ease 0.3s forwards;
}

@keyframes ring {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tf-summary {
  margin: 1.5rem 0;
  padding: 1.15rem;
  border-radius: 16px;
  background: var(--tf-card);
  border: 1px solid rgba(0,0,0,0.05);
  text-align: left;
  box-shadow: var(--tf-shadow);
}

.tf-summary-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tf-muted);
  margin-bottom: 0.65rem;
}

.tf-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.tf-summary-row:last-child { border-bottom: none; }

.tf-summary-key { color: var(--tf-muted); }
.tf-summary-val { font-weight: 600; color: var(--tf-text); }

.tf-thanks-extra {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: var(--tf-accent-soft);
  font-size: 0.88rem;
  color: var(--tf-muted);
  line-height: 1.55;
}

.tf-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.tf-confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  top: -10px;
  animation: confettiFall 2.5s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Mobile sticky footer CTA */
.tf-sticky {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 0.85rem 1.1rem calc(0.85rem + env(safe-area-inset-bottom));
  background: rgba(244,247,245,0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0,0,0,0.06);
  z-index: 20;
}

.tf-sticky .tf-btn { width: 100%; }

@media (max-width: 640px) {
  .tf-sticky.visible { display: block; }
  body.has-sticky .tf-main { padding-bottom: 5.5rem; }
}
