:root {
  --bg: #f3f0e4;
  --panel: #fffaf0;
  --panel-strong: #f6edd7;
  --ink: #1f2f2a;
  --teal: #10564f;
  --teal-soft: #2f756e;
  --clay: #b85c3d;
  --line: #d4c9ad;
  --shadow: 0 14px 28px rgba(24, 47, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Public Sans", sans-serif;
  background: radial-gradient(circle at 5% 0%, #f9f3e4, var(--bg) 50%, #efe5cf 100%);
  color: var(--ink);
  line-height: 1.5;
}

body.overlay-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  line-height: 1.1;
}

p {
  margin: 0;
}

.container {
  width: min(1080px, 92vw);
  margin-inline: auto;
}

.funnel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 16%, transparent);
  backdrop-filter: blur(6px);
}

body.tester-mode .funnel-header {
  border-bottom-color: color-mix(in srgb, var(--clay) 32%, transparent);
}

.header-row {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--teal);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.text-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-content {
  padding: 2rem 0 3.2rem;
  display: grid;
  gap: 1.3rem;
}

.hero-panel,
.form-panel,
.info-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: clamp(1.2rem, 3vw, 2rem);
  display: grid;
  gap: 0.9rem;
}

.hero-panel.compact {
  gap: 0.65rem;
}

.hero-panel h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.75rem);
}

.kicker {
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--clay) 82%, black);
  font-weight: 800;
}

.tester-badge {
  border: 1px dashed color-mix(in srgb, var(--clay) 42%, transparent);
  background: color-mix(in srgb, var(--clay) 12%, white);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--clay) 80%, black);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.35rem;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(130deg, var(--teal), var(--teal-soft));
  color: #fffdf6;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.06);
}

.btn-ghost {
  border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, white);
  color: var(--teal);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.info-card {
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}

.location-subline {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--ink) 82%, black);
}

a.location-subline {
  color: color-mix(in srgb, var(--teal) 80%, black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a.location-subline:hover,
a.location-subline:focus-visible {
  color: color-mix(in srgb, var(--teal) 90%, black);
}

.info-card ol {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.form-panel {
  padding: clamp(1rem, 2.5vw, 1.6rem);
}

.policy-panel {
  display: grid;
  gap: 1.1rem;
}

.policy-section {
  display: grid;
  gap: 0.6rem;
}

.policy-section h2 {
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
}

.policy-meta {
  font-size: 0.92rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--teal) 78%, black);
}

.policy-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.policy-note {
  margin-top: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.policy-note a,
.policy-section a {
  color: var(--teal);
  font-weight: 700;
}

.funnel-footer {
  border-top: 1px solid color-mix(in srgb, var(--teal) 12%, transparent);
  padding: 2rem 0 3rem;
}

.funnel-footer .container {
  display: grid;
  gap: 0.5rem;
}

.small-privacy-link {
  color: color-mix(in srgb, var(--teal) 84%, black);
  text-decoration: underline;
  font-size: 0.88rem;
  font-weight: 600;
}

.funnel-footer .tester-badge {
  margin-top: 0.55rem;
  width: fit-content;
  font-size: 0.84rem;
  padding: 0.48rem 0.7rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.field-grid .wide {
  grid-column: 1 / -1;
}

label,
legend {
  font-weight: 700;
  color: color-mix(in srgb, var(--ink) 88%, black);
}

label {
  display: grid;
  gap: 0.45rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--teal) 22%, transparent);
  border-radius: 12px;
  padding: 0.62rem 0.74rem;
  font: inherit;
  color: var(--ink);
  background: #fffdf7;
}

textarea {
  resize: vertical;
}

fieldset {
  margin: 1.1rem 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.8rem;
  margin-top: 0.65rem;
}

.checkbox-grid label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 500;
}

.checkbox-grid input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.1rem;
}

#other-interest-wrap {
  margin-top: 0.7rem;
  display: none;
}

#other-interest-wrap.is-visible {
  display: grid;
}

.form-message {
  margin-top: 0.9rem;
  font-weight: 600;
  min-height: 1.4rem;
}

.form-message.is-error {
  color: #a13d29;
}

.form-message.is-success {
  color: #0d5c36;
}

.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.success-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.success-card {
  width: min(580px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(165deg, #fffdf5 0%, #f7efd9 100%);
  box-shadow: 0 28px 46px rgba(20, 42, 37, 0.24);
  padding: clamp(1.2rem, 4vw, 2rem);
  display: grid;
  gap: 0.85rem;
  text-align: center;
  transform: translateY(10px) scale(0.98);
  animation: popIn 0.28s ease forwards;
}

.success-check {
  width: 88px;
  height: 88px;
  margin-inline: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  color: #fffef8;
  background: linear-gradient(145deg, #138367, #0f5e4a);
  box-shadow: 0 10px 24px rgba(15, 94, 74, 0.35);
}

.overlay-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.45rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat-card {
  padding: 0.9rem 1rem;
}

.stat-label {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--teal) 76%, black);
}

.stat-value {
  margin-top: 0.45rem;
  font-size: clamp(1.2rem, 3.1vw, 2rem);
  font-family: "Syne", sans-serif;
}

.dashboard-panel {
  display: grid;
  gap: 1rem;
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1 1 320px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffef9;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 90%, white);
  padding: 0.7rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

th {
  background: color-mix(in srgb, var(--panel-strong) 88%, white);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  border: 1px solid transparent;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  font-weight: 800;
}

.type-test {
  background: color-mix(in srgb, var(--clay) 16%, white);
  border-color: color-mix(in srgb, var(--clay) 35%, transparent);
  color: color-mix(in srgb, var(--clay) 82%, black);
}

.type-real {
  background: color-mix(in srgb, var(--teal) 12%, white);
  border-color: color-mix(in srgb, var(--teal) 30%, transparent);
  color: color-mix(in srgb, var(--teal) 80%, black);
}

.top-interests {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

@media (max-width: 900px) {
  .info-grid,
  .field-grid,
  .checkbox-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header-row {
    min-height: 66px;
  }
}

@media (max-width: 560px) {
  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .overlay-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .success-card .btn {
    width: 100%;
  }
}

@keyframes popIn {
  from {
    transform: translateY(14px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
