*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0a0b0e;
  --bg-card:    #0f1115;
  --bg-input:   #13161c;
  --bg-hover:   #1a1e27;
  --border:     #1e2330;
  --accent:     #818cf8;
  --accent-dim: rgba(129,140,248,0.15);
  --text:       #e8eaf0;
  --text-2:     #8b91a6;
  --text-3:     #4e5568;
  --success:    #818cf8;
  --warn:       #f59e0b;
  --danger:     #ef4444;
  --green:      #22d3a8;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  line-height: 1.5;
}

/* ── App layout ──────────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Site header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10,11,14,0.95);
  backdrop-filter: blur(10px);
  gap: 1rem; flex-shrink: 0;
}
.header-left  { display: flex; align-items: center; gap: 1.25rem; }
.header-right { display: flex; align-items: center; gap: 0.35rem; }

.logo {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: var(--text); flex-shrink: 0;
}
.logo-text { font-size: 0.88rem; font-weight: 700; letter-spacing: 0.08em; line-height: 1.2; font-family: 'Cascadia Code','Consolas',monospace; }
.logo-sub  { font-size: 0.66rem; color: var(--text-3); letter-spacing: 0.04em; line-height: 1.1; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: none; border-radius: 6px; cursor: pointer;
  font-family: inherit; font-weight: 500; transition: background 0.12s, color 0.12s;
  white-space: nowrap; text-decoration: none;
}
.btn-sm   { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
.btn-icon { font-size: 0.78rem; padding: 0.3rem 0.45rem; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.85; }

/* ── Usage bar ───────────────────────────────────────────────── */
.usage-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
  font-size: 0.8rem;
  min-height: 2.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.usage-licensed { color: var(--accent); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.04em; }
.usage-info { display: flex; align-items: center; gap: 0.65rem; }
.usage-label { color: var(--text-2); }
.usage-count { font-weight: 700; }
.usage-track { width: 100px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.usage-fill  { height: 100%; border-radius: 2px; transition: width 0.3s; }
.usage-reset { color: var(--text-3); font-size: 0.75rem; }
.usage-reset a { color: var(--accent); text-decoration: none; }
.usage-reset a:hover { text-decoration: underline; }

/* ── Main ───────────────────────────────────────────────────── */
main { flex: 1; max-width: 880px; margin: 0 auto; width: 100%; padding: 2.5rem 1.25rem 4rem; }

/* ── IP Hero ─────────────────────────────────────────────────── */
.ip-hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.ip-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 0.6rem;
}
.ip-address {
  font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 700;
  color: var(--text); letter-spacing: 0.03em; font-family: 'Cascadia Code','Consolas',monospace;
  margin-bottom: 0.5rem;
}
.ip-address span { color: var(--accent); }
.ip-badges { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.2rem 0.5rem; border-radius: 4px; border: 1px solid;
}
.badge-proxy   { color: var(--warn);   border-color: var(--warn);   background: rgba(245,158,11,0.08); }
.badge-hosting { color: var(--text-2); border-color: var(--border); background: transparent; }
.badge-clean   { color: var(--green);  border-color: var(--green);  background: rgba(34,211,168,0.08); }
.badge-unknown { color: var(--text-3); border-color: var(--border); background: transparent; }

/* ── Info grid ───────────────────────────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; margin-bottom: 0.85rem;
}
@media (max-width: 600px) { .info-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.15rem 1.2rem;
}
.card-title {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 0.9rem;
}
.info-table { width: 100%; border-collapse: collapse; }
.info-table tr + tr td { border-top: 1px solid var(--border); }
.info-table td { padding: 0.42rem 0; vertical-align: middle; }
.info-table .lbl { color: var(--text-2); font-size: 0.78rem; width: 42%; }
.info-table .val { color: var(--text); font-weight: 600; font-size: 0.82rem; font-family: 'Cascadia Code','Consolas',monospace; word-break: break-all; }
.info-table .val.none { color: var(--text-3); font-family: inherit; font-weight: 400; font-style: italic; }

/* ── Headers card ────────────────────────────────────────────── */
.headers-card { margin-bottom: 0; }
.headers-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.headers-table tr + tr td { border-top: 1px solid var(--border); }
.headers-table td { padding: 0.38rem 0; vertical-align: top; }
.headers-table .h-name { color: var(--text-2); width: 28%; font-family: 'Cascadia Code','Consolas',monospace; white-space: nowrap; padding-right: 1rem; }
.headers-table .h-val  { color: var(--text); word-break: break-word; }

/* ── Error msg ───────────────────────────────────────────────── */
.error-msg { color: var(--danger); font-size: 0.8rem; margin-top: 0.45rem; min-height: 1.1rem; text-align: center; }
.hidden { display: none !important; }

/* ── Copy toast ──────────────────────────────────────────────── */
.copy-toast {
  position: fixed; bottom: 1.75rem; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
  color: var(--accent); font-size: 0.82rem; padding: 0.45rem 1rem;
  pointer-events: none; opacity: 0; transition: opacity 0.15s, transform 0.15s; z-index: 100;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Auth / landing layout ───────────────────────────────────── */
:root { --font-mono: 'Cascadia Code','Consolas','Fira Code',monospace; --radius-lg: 12px; }

.auth-layout { display: grid; grid-template-columns: 1fr 420px; width: 100%; max-width: 1360px; margin: 0 auto; padding: 3rem 2rem; gap: 0 4rem; align-items: start; align-content: start; position: relative; z-index: 1; }
.auth-hero { display: contents; }
.auth-logo { grid-column: 1; display: flex; align-items: center; gap: 0.55rem; text-decoration: none; margin-bottom: 2.5rem; }
.auth-logo-name { font-size: 0.95rem; font-weight: 700; color: var(--text); letter-spacing: 0.06em; }
.auth-logo-sub { color: var(--text-3); font-weight: 400; font-size: 0.65rem; letter-spacing: 0.03em; }
.auth-tagline { grid-column: 1; }
.auth-tagline h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; color: var(--text); margin-bottom: 0.75rem; }
.auth-tagline h1 strong { color: var(--accent); }
.auth-tagline p { font-size: 1rem; color: var(--text-2); line-height: 1.6; max-width: 40ch; }
.auth-right { grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; justify-content: center; }
.auth-card-wrap { display: flex; align-items: flex-start; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; width: 100%; }
.auth-card-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 1.25rem; letter-spacing: -0.01em; }

.auth-preview { grid-column: 1; margin-top: 2.5rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-card); box-shadow: 0 8px 40px rgba(0,0,0,0.5); position: relative; }
.auth-preview::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: linear-gradient(transparent, var(--bg-card)); pointer-events: none; z-index: 1; }
.auth-preview-bar { background: rgba(0,0,0,0.35); border-bottom: 1px solid var(--border); padding: 0.5rem 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.auth-preview-dots { display: flex; gap: 5px; }
.auth-preview-dots span { width: 9px; height: 9px; border-radius: 50%; display: block; }
.auth-preview-dots span:nth-child(1) { background: #ef4444; }
.auth-preview-dots span:nth-child(2) { background: #f59e0b; }
.auth-preview-dots span:nth-child(3) { background: #22c55e; }
.auth-preview-addr { flex: 1; text-align: center; font-size: 0.68rem; color: var(--text-3); font-family: var(--font-mono); }
.auth-preview-body { padding: 0.85rem; }

.auth-footer { padding: 1.25rem 0; border-top: 1px solid var(--border); text-align: center; }
.auth-footer-line { font-size: 0.78rem; color: var(--text-3); margin-bottom: 0.4rem; }
.auth-footer-line a { color: inherit; text-decoration: none; }
.auth-footer-links { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.auth-footer-link { font-size: 0.78rem; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.auth-footer-link:hover { color: #fff; }
.auth-footer-sep { color: var(--text-3); }

@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 480px; padding: 0 1.25rem; }
  .auth-hero { display: flex; flex-direction: column; padding: 2rem 0 0.5rem; }
  .auth-logo { grid-column: unset; }
  .auth-tagline { grid-column: unset; }
  .auth-preview { display: none; }
  .auth-right { grid-column: 1; grid-row: auto; padding-top: 0; }
  .auth-card-wrap { padding: 1.25rem 0 1.5rem; align-items: center; }
}

/* ── Login form styles ───────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); }
.form-input {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: inherit; font-size: 0.88rem;
  padding: 0.55rem 0.75rem; outline: none; transition: border-color 0.15s; width: 100%;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-3); }
.notice { border-radius: 6px; padding: 0.55rem 0.75rem; font-size: 0.82rem; }
.notice-danger { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.auth-link { color: var(--accent); text-decoration: none; }
.auth-link:hover { color: #fff; }
.spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); color: var(--text-3); font-size: 0.76rem;
  padding: 1.1rem 1.5rem; text-align: center; line-height: 1.9; flex-shrink: 0;
}
.site-footer a {
  color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: 3px; transition: color 0.15s;
}
.site-footer a:hover { color: #fff; }
