:root {
  --bg: #071324;
  --surface: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.2);
  --text: #e9f3ff;
  --muted: #a9c3e6;
  --brand: #00d4ff;
  --ok-bg: rgba(59, 242, 181, 0.18);
  --ok-line: rgba(59, 242, 181, 0.6);
  --warn-bg: rgba(255, 184, 77, 0.2);
  --warn-line: rgba(255, 184, 77, 0.58);
  --neutral-bg: rgba(255, 255, 255, 0.12);
  --neutral-line: rgba(255, 255, 255, 0.28);
}

* { box-sizing: border-box; }

html {
  background-color: #173860;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 15%, #1a3961 0%, var(--bg) 50%);
  overscroll-behavior-y: none;
}

.ambient {
  position: fixed;
  inset: -120px;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.45;
}

.orb-a {
  display: none;
}

.orb-b {
  display: none;
}

.topbar {
  width: min(980px, calc(100% - 24px));
  margin: 0 auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 20, 35, 0.74);
  backdrop-filter: blur(16px);
  position: sticky;
  top: calc(env(safe-area-inset-top) + 10px);
  z-index: 12;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

main {
  width: min(980px, calc(100% - 24px));
  margin: 30px auto 60px;
  display: grid;
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: var(--surface);
}

.summary-card {
  position: relative;
}

.auth-card {
  width: min(560px, 100%);
  justify-self: center;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.kicker {
  margin: 0 0 8px;
  color: #93f0ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
}

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

.stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.selector-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.selector-head h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

.option-grid {
  display: grid;
  gap: 8px;
}

.option-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 2px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.option-tile:hover {
  transform: translateY(-1px);
}

.option-tile.is-selected {
  border-color: rgba(0, 212, 255, 0.75);
  background: rgba(0, 212, 255, 0.12);
}

.option-title {
  font-weight: 700;
}

.option-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.option-price {
  margin-top: 2px;
  font-weight: 700;
  color: #bff4ff;
  font-size: 0.9rem;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

input {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.dashboard {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.status-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--neutral-line);
  background: var(--neutral-bg);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pill.active {
  border-color: var(--ok-line);
  background: var(--ok-bg);
}

.pill.attention {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.status-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.kv {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.divider {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.actions {
  margin-top: 14px;
}

.btn,
.ghost {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn {
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), #4ed0ff);
  color: #032033;
}

.ghost {
  background: transparent;
  color: var(--text);
}

.apple-btn {
  border: 1px solid #2f3a4a;
  border-radius: 999px;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  color: #f6fbff;
  background: linear-gradient(180deg, #111722, #0a1019);
}

.apple-btn:hover {
  filter: brightness(1.08);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(3, 8, 16, 0.58);
  backdrop-filter: blur(4px);
}

.sheet {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 84px);
  bottom: auto;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 24px));
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(10, 20, 35, 0.96);
  z-index: 26;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-close {
  padding: 7px 11px;
}

.message {
  min-height: 20px;
  color: var(--muted);
}

.inline-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

#accountLoading {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn[disabled],
.ghost[disabled],
.apple-btn[disabled] {
  opacity: 0.64;
  cursor: not-allowed;
}

.embedded-checkout {
  margin-top: 6px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .option-grid-2 {
    grid-template-columns: 1fr;
  }

  .sheet {
    top: auto;
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(680px, calc(100% - 20px));
    max-height: min(88dvh, 880px);
    border-radius: 18px;
    padding: 16px;
  }
}
