@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --navy:        #0C1829;
  --navy-deep:   #070e1a;
  --navy-hover:  #14243a;
  --ivory:       #F5F0E8;
  --ivory-warm:  #EDE9DF;
  --verm:        #C1281B;
  --verm-dark:   #a0200f;
  --text-muted:  rgba(12,24,41,0.60);
  --text-faint:  rgba(12,24,41,0.45);
  --border:      rgba(12,24,41,0.14);
  --border-soft: rgba(12,24,41,0.09);
  --shadow:      rgba(12,24,41,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F5F0E8;
  color: #0C1829;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 64px;
}

/* Site header */
.site-header {
  width: 100%;
  max-width: 600px;
  padding: 24px 0 8px;
}
.site-header .brand {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  color: #0C1829;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.site-header .brand span { color: #C1281B; }
.site-header .brand em {
  font-style: normal;
  color: var(--text-faint);
  font-weight: 400;
}

/* Card */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(12,24,41, 0.10), 0 1px 4px rgba(12,24,41, 0.06);
  width: 100%;
  max-width: 600px;
  padding: 32px 24px;
  margin-top: 14px;
  border-top: 3px solid #0C1829;
  animation: cardIn 0.28s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-intro {
  background-color: #0C1829;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(7,14,26,0.70) 0%, rgba(7,14,26,0.88) 100%),
    url('/static/hero.jpg');
  background-size: 22px 22px, cover, cover;
  background-position: 0 0, center, center top;
  border-top: 3px solid #C1281B;
  position: relative;
  overflow: hidden;
}
.card-intro::before {
  content: '';
  position: absolute;
  top: -70px; right: -70px;
  width: 220px; height: 220px;
  border: 1.5px solid rgba(193,40,27, 0.18);
  border-radius: 50%;
  pointer-events: none;
}
.card-intro::after {
  content: '';
  position: absolute;
  top: -36px; right: -36px;
  width: 140px; height: 140px;
  border: 1.5px solid rgba(193,40,27, 0.10);
  border-radius: 50%;
  pointer-events: none;
}
.card-intro h1 { color: #fff; position: relative; }
.card-intro p  { color: rgba(255, 255, 255, 0.68); position: relative; }
.card-intro .nav-row { position: relative; }
.card-intro .intro-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #C1281B;
  margin-bottom: 12px;
  position: relative;
}

/* Typography */
h1 {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 14px;
  color: #0C1829;
}
h2 {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 22px;
  color: #0C1829;
}
h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #0C1829;
}
p {
  line-height: 1.65;
  font-size: 15px;
  color: rgba(12,24,41,0.60);
  margin-bottom: 14px;
}

/* Progress */
.progress-bar {
  width: 100%;
  max-width: 600px;
  height: 5px;
  background: rgba(12,24,41,0.10);
  border-radius: 3px;
  margin-top: 14px;
}
.progress-fill {
  height: 100%;
  background: #C1281B;
  border-radius: 3px;
  transition: width 0.35s ease;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 80%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer 1.8s ease-in-out infinite;
}
@keyframes shimmer {
  to { left: 180%; }
}
.stage-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: rgba(12,24,41,0.45);
  margin-top: 7px;
  width: 100%;
  max-width: 600px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Questions */
.question { margin-bottom: 28px; }
.question label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #0C1829;
  margin-bottom: 12px;
  line-height: 1.45;
}

/* Option buttons */
.options { display: flex; flex-direction: column; gap: 8px; }
.option-btn {
  background: #fff;
  border: 1.5px solid rgba(12,24,41,0.14);
  border-radius: 8px;
  padding: 13px 40px 13px 20px;
  text-align: left;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #0C1829;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  line-height: 1.45;
  position: relative;
}
.option-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: #C1281B;
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.option-btn::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border: 1.5px solid rgba(12,24,41,0.14);
  border-radius: 50%;
  transition: all 0.15s;
  background: #fff;
}
.option-btn:hover  {
  border-color: #0C1829;
  background: #EDE9DF;
  color: #0C1829;
  box-shadow: 0 2px 8px rgba(12,24,41, 0.08);
}
.option-btn:hover::before { opacity: 1; }
.option-btn:hover::after  { border-color: #0C1829; }
.option-btn.selected {
  border-color: #0C1829;
  background: #0C1829;
  color: #fff;
  box-shadow: 0 2px 12px rgba(12,24,41, 0.18);
}
.option-btn.selected::before { opacity: 1; background: rgba(193,40,27,0.7); }
.option-btn.selected::after  {
  background: #C1281B;
  border-color: #C1281B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  border: 1.5px solid rgba(12,24,41,0.14);
  border-radius: 8px;
  padding: 13px 15px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: #0C1829;
  background: #fff;
  margin-top: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  outline: none;
  border-color: #0C1829;
  box-shadow: 0 0 0 3px rgba(12,24,41, 0.1);
}

select {
  width: 100%;
  border: 1.5px solid rgba(12,24,41,0.14);
  border-radius: 8px;
  padding: 13px 40px 13px 15px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: #0C1829;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230C1829' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 14px center;
  margin-top: 6px;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus {
  outline: none;
  border-color: #0C1829;
  box-shadow: 0 0 0 3px rgba(12,24,41, 0.1);
}

/* Nav */
.nav-row { display: flex; gap: 12px; margin-top: 28px; }

/* Buttons */
.btn-primary {
  background: #0C1829;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px 28px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.45s ease;
}
.btn-primary:hover  { background: #14243a; box-shadow: 0 4px 14px rgba(12,24,41,0.25); }
.btn-primary:hover::after { left: 160%; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-gold {
  background: #C1281B;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px 28px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.btn-gold::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.45s ease;
}
.btn-gold:hover  { background: #a0200f; box-shadow: 0 4px 14px rgba(193,40,27,0.35); }
.btn-gold:hover::after { left: 160%; }
.btn-gold:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent;
  color: rgba(12,24,41,0.45);
  border: 1.5px solid rgba(12,24,41,0.14);
  border-radius: 8px;
  padding: 15px 20px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: #0C1829; color: #0C1829; }

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  animation: badgeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
.tier-high   { background: #0C1829; color: #C1281B; box-shadow: 0 0 0 3px rgba(193,40,27,0.18), 0 2px 8px rgba(12,24,41,0.2); }
.tier-medium { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.tier-low    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Results */
.insight-row { margin-bottom: 18px; }
.insight-row .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(12,24,41,0.45);
  margin-bottom: 5px;
}
.insight-row .value {
  font-size: 15px;
  color: #0C1829;
  line-height: 1.6;
}

/* Loading spinner */
.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(12,24,41,0.10);
  border-top-color: #0C1829;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 4px auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Confirmation */
.confirm-icon {
  width: 52px;
  height: 52px;
  background: #C1281B;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 0 0 8px rgba(193,40,27,0.12), 0 0 0 16px rgba(193,40,27,0.06);
}
.confirm-icon svg { width: 26px; height: 26px; }
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.divider { border: none; border-top: 1px solid rgba(12,24,41,0.09); margin: 24px 0; }
.optional-label { font-size: 12px; color: rgba(12,24,41,0.45); margin-left: 6px; font-weight: 400; }
.error-msg { color: #dc2626; font-size: 13px; margin-top: 10px; font-weight: 500; }
.hidden { display: none !important; }

@media (min-width: 480px) {
  .card { padding: 44px 40px; }
  h1 { font-size: 30px; }
  h2 { font-size: 20px; }
}

/* ── Embed mode (rendered inside a partner iframe) ── */
.embed-mode {
  background: var(--ivory);
}
.embed-mode .site-header {
  padding: 14px 20px;
}
.embed-mode .site-header .brand {
  font-size: 15px;
}
.embed-mode .card {
  margin-top: 16px;
}
.embed-mode .mcr-powered {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 18px 0 10px;
}
.embed-mode .mcr-powered a {
  color: var(--verm);
  text-decoration: none;
}
