:root {
  --bg: #08090b;
  --panel: #111318;
  --panel-2: #171a20;
  --line: #262a33;
  --text: #f4f6f8;
  --muted: #9ca3af;
  --accent: #d8dde6;
  --good: #6ee7a8;
  --warn: #f7cc68;
  --bad: #ff8585;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(255,255,255,.05), transparent 32rem),
    radial-gradient(circle at 100% 100%, rgba(255,255,255,.035), transparent 28rem),
    var(--bg);
}

button, input { font: inherit; }

button {
  cursor: pointer;
  border: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .16em;
}

.subbrand {
  color: var(--muted);
  margin-top: 2px;
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge, .security-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.badge.good {
  color: var(--good);
  border-color: rgba(110,231,168,.35);
  background: rgba(110,231,168,.08);
}

.badge.bad {
  color: var(--bad);
  border-color: rgba(255,133,133,.35);
  background: rgba(255,133,133,.08);
}

.badge.neutral {
  color: var(--muted);
  background: rgba(255,255,255,.03);
}

.security-chip {
  color: var(--good);
  border-color: rgba(110,231,168,.25);
  background: rgba(110,231,168,.06);
}

.panel, .card {
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent), var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.panel {
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.auth-panel {
  width: min(520px, 100%);
  margin: 7vh auto 0;
}

.panel-head {
  margin-bottom: 20px;
}

.panel-head h1,
.panel-head h2 {
  margin: 0;
  line-height: 1.15;
}

.panel-head h1 { font-size: 25px; }
.panel-head h2 { font-size: 18px; }

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.row-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0c0e12;
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input:focus {
  border-color: #586174;
  box-shadow: 0 0 0 4px rgba(148,163,184,.08);
}

.primary, .ghost {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  color: #101114;
  background: #f3f4f6;
  margin-top: 4px;
}

.primary:hover:not(:disabled) {
  background: #fff;
}

.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.ghost:hover:not(:disabled) {
  background: rgba(255,255,255,.04);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  border-radius: 16px;
  padding: 18px;
  min-width: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}

.metric {
  font-size: 19px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.45;
}

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

.plan {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 17px;
  background: var(--panel-2);
}

.plan-name {
  font-size: 16px;
  font-weight: 850;
}

.plan-price {
  font-size: 26px;
  font-weight: 900;
  margin-top: 16px;
}

.plan-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.plan .primary {
  width: 100%;
  margin-top: 18px;
}

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

.two-col .panel { margin-bottom: 18px; }

.message {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

.message.success {
  color: var(--good);
  border-color: rgba(110,231,168,.28);
  background: rgba(110,231,168,.07);
}

.message.error {
  color: var(--bad);
  border-color: rgba(255,133,133,.28);
  background: rgba(255,133,133,.07);
}

.message.info {
  color: #cbd5e1;
  background: rgba(255,255,255,.025);
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 13px;
  background: #f3f4f6;
  color: #101114;
  font-weight: 750;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  z-index: 50;
}

.hidden { display: none !important; }

@media (max-width: 900px) {
  .summary-grid,
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

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

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

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
