:root {
  --bg: #071329;
  --surface: #0d1d3b;
  --surface-2: #13284f;
  --border: rgba(96, 165, 250, 0.18);
  --border-active: rgba(250, 204, 21, 0.72);
  --text: #f8fafc;
  --muted: #9db4d4;
  --accent: #facc15;
  --accent-hover: #fde047;
  --blue: #3b82f6;
  --blue-soft: #60a5fa;
  --accent-2: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.28), transparent 45%),
              radial-gradient(circle at 88% 12%, rgba(250, 204, 21, 0.12), transparent 38%),
              linear-gradient(180deg, #091733 0%, #071329 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(7, 19, 41, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.85);
}

.brand-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-soft);
  border-left: 1px solid var(--border);
  padding-left: 10px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  background: rgba(13, 29, 59, 0.9);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.16s ease;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.16);
}

.nav a.active {
  color: #071329;
  background: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.16s ease;
  color: var(--text);
  background: var(--surface-2);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, #fde047 0%, #facc15 55%, #f59e0b 100%);
  color: #071329;
  box-shadow: 0 6px 20px rgba(250, 204, 21, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 55%, #facc15 100%);
  box-shadow: 0 10px 28px rgba(250, 204, 21, 0.42);
}

.btn-success {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
}

.btn-success:hover {
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.48);
}

.btn-ghost {
  background: rgba(19, 40, 79, 0.65);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 15px 26px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

/* Cards & Grids */
.card {
  background: linear-gradient(180deg, rgba(16, 35, 70, 0.92), rgba(13, 29, 59, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 12px 34px rgba(3, 9, 22, 0.32);
}

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

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

.calc-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
  align-items: start;
}

/* Hero */
.hero {
  text-align: center;
  padding: 40px 26px 42px;
  background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.28), transparent 60%),
              linear-gradient(180deg, rgba(19, 40, 79, 0.95), rgba(10, 23, 48, 0.96));
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 26px;
  margin-bottom: 24px;
  box-shadow: 0 20px 50px rgba(3, 9, 24, 0.45);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 16px;
}

.pill-green {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.36);
  color: #4ade80;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 45%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  margin: 0 auto 26px;
  max-width: 650px;
  color: var(--muted);
  font-size: 16px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.hero-metrics strong {
  color: var(--accent);
}

.section-title {
  margin: 34px 0 14px;
  font-size: 22px;
  font-weight: 800;
}

.section-sub {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

/* Option selectors */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.option-tile {
  position: relative;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(19, 40, 79, 0.72);
  color: var(--text);
  cursor: pointer;
  transition: 0.15s ease;
}

.option-tile:hover {
  border-color: rgba(96, 165, 250, 0.5);
}

.option-tile.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.16), rgba(37, 99, 235, 0.22));
  box-shadow: 0 0 0 1px var(--accent);
}

.option-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #071329;
}

.option-main {
  font-size: 15px;
  font-weight: 800;
}

.option-price {
  font-size: 18px;
  font-weight: 900;
  margin-top: 4px;
  color: #ffffff;
}

.option-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(19, 40, 79, 0.75);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.chip:hover {
  border-color: var(--blue-soft);
}

.chip.active {
  border-color: var(--accent);
  background: rgba(250, 204, 21, 0.16);
  color: var(--accent);
}

/* Form inputs */
.field {
  margin-top: 16px;
}

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

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #08152e;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.input:focus {
  border-color: var(--accent);
}

.inline-row {
  display: flex;
  gap: 8px;
}

/* Summary box */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
}

.summary-row strong {
  color: var(--text);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.summary-total .amount {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
}

.sub-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #08152e;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}

.sandbox-banner {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fef08a;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  background: rgba(7, 19, 41, 0.85);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #0f2552;
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

@media (max-width: 1024px) {
  .container {
    padding: 24px 18px 56px;
  }
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .brand-sub {
    display: none;
  }
  .nav {
    order: 3;
    width: 100%;
    border-radius: 16px;
    justify-content: space-between;
  }
  .nav a {
    flex: 1 1 30%;
    text-align: center;
    padding: 9px 6px;
    font-size: 13px;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .container {
    padding: 18px 14px calc(48px + env(safe-area-inset-bottom));
  }
  .topbar {
    gap: 10px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .brand {
    font-size: 15px;
  }
  .topbar-actions .btn-sm {
    padding: 7px 10px;
    font-size: 12px;
  }
  .nav a {
    flex: 1 1 31%;
    font-size: 12px;
    padding: 8px 4px;
  }
  .hero {
    padding: 26px 16px 28px;
    border-radius: 20px;
  }
  .hero p {
    font-size: 14px;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-cta .btn {
    width: 100%;
  }
  .hero-metrics {
    gap: 10px 16px;
    font-size: 12px;
  }
  .card {
    padding: 16px;
    border-radius: 16px;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .option-tile {
    padding: 12px 10px;
  }
  .option-price {
    font-size: 16px;
  }
  .inline-row {
    flex-wrap: wrap;
  }
  .summary-total .amount {
    font-size: 26px;
  }
  .toast {
    left: 14px;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    text-align: center;
  }
}
