:root {
  --bg: #f7fafc;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --ok: #4fc898;   /* brand green */
  --warn: #f38b09; /* brand orange */
  --bad: #dc2626;
  --accent: #2563eb; /* neutral primary accent */
  --chip: #f3f4f6;
  --border: #e5e7eb;
  --bg-grad: radial-gradient(1200px 600px at 20% -10%, #ffffff 0%, #f7fafc 60%, #f3f4f6 100%);
}

/* Dark theme overrides */
body.dark {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --bad: #ef4444;
  --accent: #6366f1;
  --chip: #1f2937;
  --border: #1f2937;
  --bg-grad: radial-gradient(1200px 600px at 20% -10%, #1b2548 0%, #0f172a 60%, #0b1020 100%);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; padding: 32px; font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  min-height: 100vh;
  background: var(--bg-grad) no-repeat fixed;
  background-size: cover;
  background-color: var(--bg);
  color: var(--text);
}

.container { max-width: 940px; margin: 0 auto; }
.topbar { display:flex; align-items:center; justify-content: space-between; gap:12px; }
.brand { display:flex; align-items:center; gap:12px; }
.brand-link { display:inline-flex; align-items:center; text-decoration:none; }
.logo { height: 36px; width: auto; display:block; }
.logo-dark { display: none; }
body.dark .logo-light { display: none; }
body.dark .logo-dark { display: block; }
h1 { font-weight: 700; margin: 0; font-size: 26px; letter-spacing: .2px; }
.subtitle { color: var(--muted); margin: 6px 0 18px; }
.content { margin-top: 60px; }

.search-bar {
  background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.06), inset 0 1px 0 rgba(255,255,255,.6);
}
.search-icon { opacity: .6; }
.search-input {
  flex: 1; background: transparent; border: 0; outline: none; color: var(--text);
  font-size: 20px; letter-spacing: .2px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 2px 0; }
.chip { background: var(--chip); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; font-size: 12px; }

.results { margin-top: 18px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.row {
  display: grid; grid-template-columns: auto 120px 140px; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.domain { font-variant-numeric: tabular-nums; font-weight: 600; }
.meta { color: var(--muted); font-size: 13px; }
.status { font-weight: 700; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.status.spin { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.status.warn { color: var(--warn); }
.spinner { width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: #64748b; border-radius: 50%; display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn {
  justify-self: end; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600;
  transition: background .15s ease, box-shadow .15s ease, transform .02s ease;
}
.btn:hover { background: #f9fafb; box-shadow: 0 2px 10px rgba(15,23,42,.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; box-shadow: none; }
.btn.cta { background: var(--ok); border-color: var(--ok); color: #0b3a2a; }
.btn.cta:hover { filter: brightness(1.02); }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #3a2200; }

/* Modal (Whois) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display:none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { width: min(820px, 96vw); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden; }
.modal-header { display:flex; align-items:center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close { background: transparent; border: 0; color: var(--text); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.modal-body { padding: 14px; max-height: min(70vh, 680px); overflow: auto; }
.kv { display:grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.kv .k { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 13px; }
.section { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.mt-12 { margin-top: 12px; }

.footer { max-width: 940px; margin: 40px auto 0; color: var(--muted); display:flex; align-items:center; gap:8px; }
.footer .pill { background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; color: var(--text); }

/* Theme toggle switch */
.toggle {
  display:inline-flex; align-items:center; gap:8px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.toggle .icon { width:16px; height:16px; }
.icon-sun { display:inline; }
.icon-moon { display:none; }
body.dark .icon-sun { display:none; }
body.dark .icon-moon { display:inline; }

/* Screen reader only */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

@media (max-width: 640px) {
  body { padding: 18px; }
  .row { grid-template-columns: 1fr; align-items: start; }
  .btn { justify-self: start; }
}
