:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --text: #14201D;
  --muted: #66756F;
  --accent: #00614A;
  --on-accent: #FFFFFF;
  --border: #E1E1E1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1512;
    --surface: #101E1A;
    --text: #F3F6F4;
    --muted: #8FA39D;
    --accent: #1FBA8F;
    --on-accent: #04231C;
    --border: #1E2E29;
  }
}

:root[data-theme="dark"] {
  --bg: #0A1512;
  --surface: #101E1A;
  --text: #F3F6F4;
  --muted: #8FA39D;
  --accent: #1FBA8F;
  --on-accent: #04231C;
  --border: #1E2E29;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Standalone/PWA mode needs this exemption explicitly — the app-wide
   user-select: none above is for tap-friendly chrome, not for text the
   user actually needs to type into. */
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

img,
svg {
  -webkit-user-drag: none;
}

.screen {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 24px calc(clamp(16px, 3dvh, 28px) + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  flex: none;
  margin-bottom: clamp(10px, 3dvh, 28px);
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease;
}

.back-btn:active {
  transform: scale(0.88);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-switch {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 10;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: transform 120ms ease;
}

.theme-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.theme-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.theme-btn:active {
  transform: scale(0.88);
}

.signal-visual {
  display: flex;
  justify-content: center;
  flex: none;
  margin-bottom: clamp(6px, 2dvh, 20px);
  color: var(--accent);
}

.signal-visual svg {
  display: block;
  width: clamp(72px, 22dvh, 180px);
  height: clamp(72px, 22dvh, 180px);
}

/* Same animation family as the welcome screen (signal flow + breathing
   hub + node pulse), dialed back to ~60-70% amplitude so it reads as
   "part of the same system" without competing with the form below. */
.pulses circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0;
  transform-origin: 100px 100px;
  animation: dvr-pulse 3.6s ease-out infinite;
}

.pulses circle:nth-child(2) { animation-delay: 1.2s; }

@keyframes dvr-pulse {
  0%   { transform: scale(0.4); opacity: 0.55; }
  70%  { opacity: 0.13; }
  100% { transform: scale(1.3); opacity: 0; }
}

.mesh line {
  stroke: var(--accent);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0.34;
  stroke-dasharray: 4 7;
  stroke-dashoffset: 0;
  animation: dvr-line-flow 3.6s linear infinite;
}

.mesh line:nth-child(1) { animation-delay: 0s; }
.mesh line:nth-child(2) { animation-delay: 0.25s; }
.mesh line:nth-child(3) { animation-delay: 0.5s; }
.mesh line:nth-child(4) { animation-delay: 0.75s; }
.mesh line:nth-child(5) { animation-delay: 1s; }
.mesh line:nth-child(6) { animation-delay: 1.25s; }

@keyframes dvr-line-flow {
  to { stroke-dashoffset: -22; }
}

.nodes circle {
  fill: var(--accent);
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: dvr-node-glow 2.8s ease-in-out infinite;
}

.nodes circle:nth-child(1) { animation-delay: 0s; }
.nodes circle:nth-child(2) { animation-delay: 0.4s; }
.nodes circle:nth-child(3) { animation-delay: 0.8s; }
.nodes circle:nth-child(4) { animation-delay: 1.2s; }
.nodes circle:nth-child(5) { animation-delay: 1.6s; }
.nodes circle:nth-child(6) { animation-delay: 2s; }

@keyframes dvr-node-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 0.9; transform: scale(1.16); }
}

.hub {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
  animation: dvr-hub-breathe 4s ease-in-out infinite;
}

@keyframes dvr-hub-breathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 1px color-mix(in srgb, var(--accent) 25%, transparent));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 50%, transparent));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulses circle { animation: none; opacity: 0.16; transform: scale(1); }
  .mesh line { animation: none; }
  .nodes circle { animation: none; opacity: 0.75; transform: scale(1); }
  .hub { animation: none; filter: none; }
  .back-btn,
  .theme-btn,
  .method-tab,
  .btn-primary {
    transition: none;
  }
}

.intro {
  flex: none;
}

h1 {
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.lead-sub {
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: clamp(12px, 3dvh, 32px);
}

.method-switch {
  display: flex;
  flex: none;
  gap: 6px;
  padding: 4px;
  margin-bottom: clamp(8px, 2dvh, 20px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.method-tab {
  flex: 1;
  height: clamp(46px, 8dvh, 52px);
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 0 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
  transition: transform 120ms ease;
}

.method-tab:active {
  transform: scale(0.96);
}

.method-tab[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.field-group {
  flex: none;
  margin-bottom: clamp(8px, 2dvh, 16px);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.phone-input {
  display: flex;
  align-items: center;
  height: clamp(48px, 9dvh, 56px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.phone-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.country-code {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 14px 0 18px;
  border-right: 1px solid var(--border);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  flex: none;
  white-space: nowrap;
}

.flag {
  font-size: 20px;
  line-height: 1;
}

.phone-input input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
}

.text-input {
  width: 100%;
  height: clamp(48px, 9dvh, 56px);
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.helper-text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  height: clamp(48px, 9dvh, 56px);
  margin-top: clamp(6px, 1.5dvh, 12px);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 16px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 120ms ease, opacity 160ms ease;
}

.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.92;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

@media (min-width: 560px) {
  html, body {
    overflow: auto;
  }
  body {
    align-items: center;
  }
  .screen {
    height: auto;
    padding-top: 40px;
    padding-bottom: 40px;
  }
}
