:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0c1a2c;
  --panel: rgba(14, 24, 39, 0.84);
  --panel-strong: rgba(18, 29, 46, 0.98);
  --border: rgba(151, 170, 196, 0.18);
  --text: #ecf4ff;
  --muted: #9eb4cc;
  --accent: #6ed3ff;
  --accent-2: #ffbe6d;
  --accent-3: #7bf5c4;
  --danger: #ff7d7d;
  --shadow: 0 24px 80px rgba(1, 8, 18, 0.45);
  --radius: 24px;
  --radius-sm: 14px;
  --font-body: "Segoe UI Variable", "Segoe UI", "Aptos", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Aptos Display", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(110, 211, 255, 0.14), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(255, 190, 109, 0.12), transparent 30%),
    linear-gradient(160deg, #050b14 0%, #0a1524 44%, #07111f 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

.bg-shape-a {
  width: 18rem;
  height: 18rem;
  left: -4rem;
  top: 6rem;
  background: radial-gradient(circle, rgba(110, 211, 255, 0.22), transparent 70%);
}

.bg-shape-b {
  width: 24rem;
  height: 24rem;
  right: -6rem;
  bottom: -6rem;
  background: radial-gradient(circle, rgba(255, 190, 109, 0.2), transparent 72%);
}

.shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 29, 46, 0.9), rgba(10, 18, 30, 0.85));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  margin-bottom: 1.25rem;
}

.hero-brand {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.brand-logo {
  display: block;
  width: min(100%, 260px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  background: #fff;
}

.brand-tagline {
  max-width: 30ch;
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
  line-height: 1.3;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
}

.lede {
  margin: 0.9rem 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.meta-label,
.field-hint,
.summary-meta,
.panel-header p,
.status-banner,
.result-grid dd,
.help-block p {
  color: var(--muted);
}

.meta-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
}

.meta-value {
  display: block;
  margin-top: 0.2rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.25rem;
  align-items: start;
}

.panel {
  border-radius: var(--radius);
  padding: 1.25rem;
  min-width: 0;
}

.panel-header {
  margin-bottom: 1rem;
}

.panel-header h2 {
  font-size: 1.2rem;
}

.panel-header p {
  margin: 0.35rem 0 0;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

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

.field-label {
  font-weight: 700;
}

.field-group-heading {
  grid-column: 1 / -1;
  margin: 0.25rem 0 -0.1rem;
  font-size: 1.05rem;
}

.field-hint {
  font-size: 0.88rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(167, 184, 207, 0.2);
  background: rgba(6, 12, 20, 0.65);
  color: var(--text);
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus,
select:focus {
  border-color: rgba(110, 211, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(110, 211, 255, 0.12);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary {
  color: #0a1524;
  background: linear-gradient(135deg, var(--accent) 0%, #a8f0ff 100%);
  box-shadow: 0 18px 40px rgba(110, 211, 255, 0.2);
}

.secondary {
  color: #06111e;
  background: linear-gradient(135deg, #ffe4b7 0%, var(--accent-2) 100%);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.help-block {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.turnstile-block {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(110, 211, 255, 0.14);
  background: rgba(110, 211, 255, 0.05);
}

.turnstile-copy {
  display: grid;
  gap: 0.15rem;
}

.turnstile-block .success {
  color: var(--accent-3);
}

.turnstile-block .error {
  color: var(--danger);
}

.help-block summary {
  cursor: pointer;
  font-weight: 700;
}

.results-panel {
  background: linear-gradient(180deg, rgba(16, 24, 38, 0.98), rgba(8, 14, 23, 0.95));
}

.status-banner {
  border-radius: 16px;
  padding: 0.8rem 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.status-banner.success {
  color: var(--accent-3);
  border-color: rgba(123, 245, 196, 0.2);
  background: rgba(123, 245, 196, 0.08);
}

.status-banner.error {
  color: var(--danger);
  border-color: rgba(255, 125, 125, 0.2);
  background: rgba(255, 125, 125, 0.08);
}

.results-brand {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 190, 109, 0.2);
  border-radius: 20px;
  background: rgba(255, 190, 109, 0.06);
}

.results-brand-logo {
  display: block;
  width: min(100%, 200px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  background: #fff;
}

.results-brand-tagline {
  max-width: 34ch;
  margin: 0;
  color: var(--accent-2);
  font-weight: 800;
  line-height: 1.35;
}

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

.summary-card {
  border-radius: 20px;
  padding: 1rem;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-card.accent {
  background: linear-gradient(180deg, rgba(110, 211, 255, 0.16), rgba(110, 211, 255, 0.05));
  border-color: rgba(110, 211, 255, 0.16);
}

.summary-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.summary-card strong {
  display: block;
  max-width: 100%;
  margin-top: 0.35rem;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.summary-meta {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.88rem;
}

.summary-note {
  white-space: pre-line;
  line-height: 1.45;
}

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

.result-item {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.result-label {
  color: #d7e5f5;
  font-weight: 700;
}

.result-value {
  font-size: 1.05rem;
  font-weight: 800;
}

.breakdown {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.breakdown summary {
  cursor: pointer;
  font-weight: 700;
}

pre {
  overflow: auto;
  margin: 0.9rem 0 0;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(3, 7, 13, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #d8e8f7;
}

.pulse {
  animation: pulse 0.18s ease;
}

@keyframes pulse {
  from {
    transform: scale(0.99);
  }
  to {
    transform: scale(1);
  }
}

@media (max-width: 960px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .summary-grid,
  .result-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 1rem, 1180px);
    padding-top: 0.5rem;
  }

  .hero,
  .panel {
    padding: 1rem;
  }

  .action-row {
    flex-direction: column;
  }

  .results-brand {
    grid-template-columns: 1fr;
  }

  .results-brand-logo {
    width: min(100%, 220px);
  }

  button {
    width: 100%;
  }
}
