/* ── Reset & tokens ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --dark:    #0D0F14;
  --mid:     #161920;
  --card:    #1C2030;
  --border:  #2A2E3F;
  --text:    #E8EAF0;
  --muted:   #7A8099;
  --accent:  #C8A45A;
  --green:   #4CAF82;
  --red:     #CF6679;
  --orange:  #C89050;

  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'Courier New', monospace;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

html { font-size: 14px; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, select, textarea { font-family: var(--font-body); }
code { font-family: var(--font-mono); }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--mid); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Typography ─────────────────────────────────────────────────────────────── */
.accent  { color: var(--accent); }
.muted   { color: var(--muted); }
.fw-600  { font-weight: 600; }
.fz-12   { font-size: 12px; }
.fz-13   { font-size: 13px; }

/* ── App shell ──────────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 224px; flex-shrink: 0;
  background: var(--mid);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
}
.sidebar__logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-bot     { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--accent); }
.logo-blocker { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--text); }
.logo-sub     { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }

.sidebar__nav {
  flex: 1; padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 400; color: var(--muted);
  border: 1px solid transparent;
  transition: all .18s;
}
.nav-item:hover  { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--accent); background: rgba(200,164,90,.1); border-color: rgba(200,164,90,.2); font-weight: 600; }
.nav-icon { font-size: 15px; line-height: 1; width: 18px; text-align: center; }

.sidebar__user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-plan { font-size: 11px; color: var(--muted); }
.logout-btn { color: var(--muted); font-size: 16px; transition: color .18s; padding: 4px; }
.logout-btn:hover { color: var(--red); }

/* ── Main content ───────────────────────────────────────────────────────────── */
.main-content { overflow-y: auto; padding: 36px 40px; max-width: 1100px; }

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; gap: 16px; }
.page-title  { font-family: var(--font-head); font-size: 30px; font-weight: 600; line-height: 1.1; }
.page-sub    { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── Card ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.card__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.card__title { font-family: var(--font-head); font-size: 18px; font-weight: 600; }

/* ── Avatar ─────────────────────────────────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(200,164,90,.15); border: 1px solid rgba(200,164,90,.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.avatar--sm { width: 32px; height: 32px; font-size: 11px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; transition: all .18s;
  white-space: nowrap; cursor: pointer;
}
.btn--accent { background: var(--accent); color: #0D0F14; }
.btn--accent:hover { filter: brightness(1.1); }
.btn--ghost  { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--gold-outline { background: rgba(200,164,90,.1); color: var(--accent); border: 1px solid rgba(200,164,90,.4); }
.btn--gold-outline:hover { background: rgba(200,164,90,.2); }
.btn--sm     { padding: 5px 12px; font-size: 12px; }
.btn--lg     { padding: 11px 24px; font-size: 14px; }
.btn--full   { width: 100%; }
.btn--danger { color: var(--red) !important; }
.btn--danger:hover { border-color: var(--red) !important; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-label  { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .03em; }
.form-label__hint { font-weight: 400; opacity: .7; }
.form-input {
  background: var(--dark); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  color: var(--text); font-size: 13px; outline: none;
  transition: border-color .18s;
}
.form-input:focus { border-color: rgba(200,164,90,.5); }

/* ── Metrics grid ───────────────────────────────────────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  transition: border-color .2s;
}
.metric-card:hover { border-color: rgba(200,164,90,.3); }
.metric-icon       { font-size: 20px; color: var(--accent); margin-bottom: 10px; }
.metric-value      { font-family: var(--font-head); font-size: 26px; font-weight: 700; }
.metric-value--red    { color: var(--red); }
.metric-value--accent { color: var(--accent); }
.metric-sub        { font-size: 12px; color: var(--muted); margin-top: 2px; }
.metric-label      { font-size: 10px; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; margin-top: 8px; }

/* ── Status tags ────────────────────────────────────────────────────────────── */
.status-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.status--green { background: rgba(76,207,130,.12); color: var(--green); border: 1px solid rgba(76,207,130,.25); }
.status--gold  { background: rgba(200,164,90,.15);  color: var(--accent); border: 1px solid rgba(200,164,90,.3); }
.status--red   { background: rgba(207,102,121,.12); color: var(--red);   border: 1px solid rgba(207,102,121,.25); }

/* ── Billing banner ─────────────────────────────────────────────────────────── */
.billing-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 20px; line-height: 1.5;
  flex-wrap: wrap;
}
.billing-banner__icon { font-size: 16px; flex-shrink: 0; }
.billing-banner > div { flex: 1; }
.billing-banner--trial { background: rgba(76,207,130,.07); border: 1px solid rgba(76,207,130,.2); color: var(--text); }
.billing-banner--low   { background: rgba(200,164,90,.07);  border: 1px solid rgba(200,164,90,.25); color: var(--text); }
.billing-banner--empty { background: rgba(207,102,121,.07); border: 1px solid rgba(207,102,121,.25); color: var(--text); }

/* ── Credit packs ───────────────────────────────────────────────────────────── */
.credits-section { padding: 20px 22px; }
.credits-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 16px;
}
.credit-pack {
  background: var(--mid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 20px;
  text-align: center; position: relative;
  transition: border-color .2s;
}
.credit-pack:hover { border-color: rgba(200,164,90,.3); }
.credit-pack--featured { border-color: rgba(200,164,90,.4); background: rgba(200,164,90,.05); }
.credit-pack__badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #0D0F14;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 20px; text-transform: uppercase; white-space: nowrap;
}
.credit-pack__amount { font-family: var(--font-head); font-size: 32px; font-weight: 700; color: var(--text); }
.credit-pack__label  { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.credit-pack__price  { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.credit-pack__note   { font-size: 11px; color: var(--muted); margin-bottom: 18px; }
.credits-note { font-size: 12px; color: var(--muted); }

/* ── Flash / alerts ─────────────────────────────────────────────────────────── */
.flash {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 20px; line-height: 1.5;
}
.flash--success { background: rgba(76,207,130,.1); border: 1px solid rgba(76,207,130,.25); color: var(--green); }
.flash--error   { background: rgba(207,102,121,.1); border: 1px solid rgba(207,102,121,.25); color: var(--red); }
.new-key-banner { display: flex; flex-direction: column; gap: 12px; }
.new-key-display { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.new-key-code { font-family: var(--font-mono); font-size: 13px; letter-spacing: .03em; color: var(--text); }

/* ── Auth pages ─────────────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 30% 40%, rgba(200,164,90,.05) 0%, transparent 60%), var(--dark);
}
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  width: 100%; max-width: 400px;
}
.auth-logo   { margin-bottom: 28px; font-size: 22px; }
.auth-title  { font-family: var(--font-head); font-size: 24px; font-weight: 600; margin-bottom: 22px; }
.auth-form   { display: flex; flex-direction: column; gap: 16px; }
.auth-footer { font-size: 13px; color: var(--muted); text-align: center; margin-top: 20px; }

/* ── Public layout ──────────────────────────────────────────────────────────── */
.body--public { background: var(--dark); }
.pub-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 48px; border-bottom: 1px solid var(--border);
  background: var(--mid); position: sticky; top: 0; z-index: 10;
}
.pub-logo { font-size: 20px; }
.pub-header__actions { display: flex; align-items: center; gap: 10px; }
.pub-main { max-width: 1080px; margin: 0 auto; }
.pub-footer {
  text-align: center; padding: 24px; font-size: 12px;
  color: var(--muted); border-top: 1px solid var(--border); margin-top: 60px;
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero { padding: 80px 48px 60px; text-align: center; }
.hero__inner { max-width: 680px; margin: 0 auto; }
.hero__badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  background: rgba(200,164,90,.1); border: 1px solid rgba(200,164,90,.3);
  color: var(--accent); font-size: 12px; font-weight: 600; margin-bottom: 20px;
}
.hero__title {
  font-family: var(--font-head); font-size: 48px; font-weight: 700;
  line-height: 1.1; margin-bottom: 20px; color: var(--text);
}
.hero__sub { font-size: 16px; color: var(--muted); line-height: 1.7; margin-bottom: 32px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Features ───────────────────────────────────────────────────────────────── */
.features { padding: 20px 48px 60px; }
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 24px;
  transition: border-color .2s;
}
.feature-card:hover { border-color: rgba(200,164,90,.3); }
.feature-card__icon  { font-size: 26px; margin-bottom: 14px; }
.feature-card__title { font-family: var(--font-head); font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.feature-card__body  { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── Pricing section (home) ─────────────────────────────────────────────────── */
.pricing-section { padding: 0 48px 60px; text-align: center; }
.pricing-section__header { margin-bottom: 32px; }
.pricing-section__title { font-family: var(--font-head); font-size: 28px; font-weight: 600; margin-bottom: 10px; }
.pricing-section__sub { font-size: 14px; color: var(--muted); max-width: 520px; margin: 0 auto; line-height: 1.6; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 720px; margin: 0 auto 20px; }
.pricing-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 20px; position: relative; text-align: center;
}
.pricing-card--featured { border-color: var(--accent); background: var(--mid); }
.pricing-card__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #000; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
}
.pricing-card__name { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.pricing-card__price { font-family: var(--font-head); font-size: 36px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.pricing-card__unit { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.pricing-card__rate { font-size: 11px; color: var(--muted); }
.pricing-note { font-size: 13px; color: var(--muted); margin-top: 16px; }

/* ── Demo section ───────────────────────────────────────────────────────────── */
.demo-section {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 0 48px 80px; align-items: start;
}
.demo-card {
  background: var(--mid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.demo-card__label {
  padding: 12px 18px; font-size: 11px; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.demo-card__code {
  display: block; padding: 20px 18px; font-family: var(--font-mono);
  font-size: 13px; color: var(--text); line-height: 1.8;
  white-space: pre;
}
.demo-info { padding: 8px 0; }
.demo-info__title { font-family: var(--font-head); font-size: 26px; font-weight: 600; margin-bottom: 12px; }
.demo-info__body  { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.demo-info__code {
  background: var(--mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  line-height: 1.7; white-space: pre-wrap; word-break: break-all;
}

/* ── Lookup tool ────────────────────────────────────────────────────────────── */
.lookup-card .card__header { border-bottom: none; }
.lookup-form-wrap { padding: 0 22px 20px; }
.lookup-form {
  display: flex; gap: 10px; align-items: center;
}
.lookup-input { flex: 1; font-size: 15px; padding: 10px 14px; font-family: var(--font-mono); }
.lookup-examples {
  margin-top: 10px; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.example-btn {
  padding: 3px 10px; border-radius: 20px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-family: var(--font-mono);
  transition: all .15s; cursor: pointer;
}
.example-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Lookup result ──────────────────────────────────────────────────────────── */
.lookup-result {
  border-top: 1px solid var(--border);
  padding: 20px 22px;
}
.lookup-result__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.lookup-result__ip      { font-family: var(--font-mono); font-size: 18px; font-weight: 600; margin-right: 10px; }
.lookup-result__country { font-size: 13px; color: var(--muted); }
.lookup-result__grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 16px; }
.lookup-result__row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 0; border-bottom: 1px solid rgba(42,46,63,.5);
}
.lookup-result__row:nth-child(odd)  { padding-right: 20px; }
.lookup-result__row:nth-child(even) { padding-left: 20px; border-left: 1px solid rgba(42,46,63,.5); }
.lookup-result__label { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.lookup-result__val   { font-size: 13px; font-weight: 500; font-family: var(--font-mono); }

/* ── Verdict badge ──────────────────────────────────────────────────────────── */
.verdict-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.verdict--green  { background: rgba(76,207,130,.12); color: var(--green);  border: 1px solid rgba(76,207,130,.25); }
.verdict--red    { background: rgba(207,102,121,.12); color: var(--red);   border: 1px solid rgba(207,102,121,.25); }
.verdict--orange { background: rgba(200,144,80,.12);  color: var(--orange);border: 1px solid rgba(200,144,80,.25); }
.verdict--muted  { background: rgba(122,128,153,.1);  color: var(--muted); border: 1px solid rgba(122,128,153,.2); }

/* ── Lookup flags ───────────────────────────────────────────────────────────── */
.lookup-flags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.flag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.flag-pill--on  { background: rgba(207,102,121,.1); color: var(--red);  border: 1px solid rgba(207,102,121,.2); }
.flag-pill--off { background: rgba(122,128,153,.06); color: var(--muted); border: 1px solid rgba(122,128,153,.15); }

/* ── Raw JSON toggle ────────────────────────────────────────────────────────── */
.lookup-raw { margin-top: 4px; }
.lookup-raw summary {
  font-size: 12px; color: var(--muted); cursor: pointer;
  padding: 4px 0; user-select: none; list-style: none;
}
.lookup-raw summary:hover { color: var(--text); }
.lookup-raw pre {
  background: var(--mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  line-height: 1.7; white-space: pre-wrap; margin-top: 10px;
  max-height: 300px; overflow-y: auto;
}

/* ── Spinner ────────────────────────────────────────────────────────────────── */
.lookup-spinner { padding: 20px 22px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── API key section ────────────────────────────────────────────────────────── */
.api-key-section {
  padding: 20px 22px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.api-key-display { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.api-key-code {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--dark); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px;
  color: var(--text); flex: 1; min-width: 0; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}

/* ── Docs section ───────────────────────────────────────────────────────────── */
.docs-section { padding: 20px 22px; }
.docs-endpoint { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.docs-method {
  background: rgba(200,164,90,.15); color: var(--accent);
  border: 1px solid rgba(200,164,90,.3);
  padding: 3px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700;
}
.docs-path { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.docs-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.docs-code {
  background: var(--mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  line-height: 1.7; white-space: pre-wrap; word-break: break-all;
  margin-bottom: 14px;
}
.docs-response-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.docs-verdicts { margin-top: 16px; }
.docs-verdicts__title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }
.docs-verdict-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
