/* Email Verifier: one stylesheet, no libraries. Light and dark themes; works from 360px up. */

:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --text: #0f172a;
  --muted: #5b6577;
  --border: #e3e7f0;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-soft: #eef0ff;
  --on-brand: #ffffff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fff4de;
  --bad: #b91c1c;
  --bad-soft: #fdeaea;
  --unknown: #475569;
  --unknown-soft: #eef1f6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --focus: 0 0 0 3px rgba(79, 70, 229, 0.35);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #131a2e;
  --surface-2: #1a2340;
  --text: #e8ecf7;
  --muted: #9aa6c1;
  --border: #263150;
  --brand: #8b85ff;
  --brand-hover: #a09bff;
  --brand-soft: #232a52;
  --on-brand: #0b1020;
  --ok: #4ade80;
  --ok-soft: #12301f;
  --warn: #fbbf24;
  --warn-soft: #382a0c;
  --bad: #f87171;
  --bad-soft: #3a1717;
  --unknown: #aab4cb;
  --unknown-soft: #222b45;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --focus: 0 0 0 3px rgba(139, 133, 255, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
code, .mono { font: 0.88em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--surface-2); padding: 0.12rem 0.4rem; border-radius: 6px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 1rem; }
main { flex: 1; padding: 1.5rem 0 3rem; }
.stack > * + * { margin-top: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card.flat { box-shadow: none; }
.card h2 { margin-bottom: 0.25rem; }
.card .lead { color: var(--muted); margin-bottom: 1rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; font-size: 1rem;
}
.nav { display: flex; gap: 0.25rem; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav button.link {
  color: var(--muted); padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.95rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button.link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.icon-btn { width: 38px; height: 38px; padding: 0 !important; display: inline-grid; place-items: center; font-size: 1.05rem; }

/* ---------- forms & buttons ---------- */
label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 0.3rem; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; min-height: 46px;
}
textarea { min-height: 170px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 46px; padding: 0 1.15rem;
  font: inherit; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; transition: background 0.15s, transform 0.05s, border-color 0.15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { min-height: 36px; padding: 0 0.8rem; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.search-bar { display: flex; gap: 0.6rem; }
.search-bar input { min-height: 54px; font-size: 1.05rem; border-radius: 12px; }
.search-bar .btn { min-height: 54px; border-radius: 12px; padding: 0 1.5rem; }
@media (max-width: 520px) { .search-bar { flex-direction: column; } }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero p { color: var(--muted); max-width: 40rem; margin: 0 auto 1.25rem; font-size: 1.05rem; }
.hero .card { text-align: left; max-width: 760px; margin: 0 auto; }

/* ---------- status pills, result card ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.7rem; border-radius: 999px;
  font-weight: 700; font-size: 0.85rem; white-space: nowrap;
}
.pill.Verified { background: var(--ok-soft); color: var(--ok); }
.pill.Risky { background: var(--warn-soft); color: var(--warn); }
.pill.Invalid, .pill.Error { background: var(--bad-soft); color: var(--bad); }
.pill.Unknown { background: var(--unknown-soft); color: var(--unknown); }

.result { margin-top: 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; background: var(--surface-2); }
.result[hidden] { display: none; }
.result .addr { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.result .why { margin: 0.5rem 0 0; color: var(--text); }
.result .tech { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.score { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.8rem; }
.bar { flex: 1; height: 10px; border-radius: 99px; background: var(--border); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--unknown); transition: width 0.5s ease; }
.bar.Verified > span { background: var(--ok); }
.bar.Risky > span { background: var(--warn); }
.bar.Invalid > span, .bar.Error > span { background: var(--bad); }
.score b { font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }

.notice { padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.notice.error { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---------- toasts (flash messages) ---------- */
.flashes { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.flash.success { border-left: 4px solid var(--ok); }
.flash.danger { border-left: 4px solid var(--bad); }
.flash.warning { border-left: 4px solid var(--warn); }
.flash.info { border-left: 4px solid var(--brand); }

/* ---------- bulk ---------- */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 0.75rem; transition: border-color 0.15s, background 0.15s; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone textarea { border: 0; background: transparent; box-shadow: none !important; padding: 0.4rem; }
.counter { font-size: 0.9rem; color: var(--muted); }
.counter.over { color: var(--bad); font-weight: 600; }
.progress { height: 12px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #7c3aed); transition: width 0.4s ease; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 0.3rem 0.8rem; font: inherit; font-size: 0.88rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stat { text-align: center; padding: 0.6rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.stat b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }

/* ---------- tables (turn into cards on phones) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.break { overflow-wrap: anywhere; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--border); }
  .stack-table td { border: 0; padding: 0.2rem 0.9rem; text-align: left !important; }
  .stack-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
}

/* ---------- misc ---------- */
.feature { display: flex; gap: 0.8rem; }
.feature .ico { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); font-size: 1.15rem; }
.feature p { color: var(--muted); margin: 0; font-size: 0.93rem; }
.keybox { display: flex; gap: 0.5rem; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.35rem 0.4rem 0.35rem 0.8rem; }
.keybox code { background: none; padding: 0; flex: 1; overflow-wrap: anywhere; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.86rem; line-height: 1.5; margin: 0.5rem 0 1rem; }
pre code { background: none; padding: 0; }
.method { display: inline-block; font-weight: 700; font-size: 0.78rem; padding: 0.15rem 0.5rem; border-radius: 6px; background: var(--brand-soft); color: var(--brand); margin-right: 0.4rem; }
.pager { display: flex; gap: 0.5rem; justify-content: center; align-items: center; margin-top: 1rem; }
.switch { display: inline-flex; align-items: center; gap: 0.6rem; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 1.25rem; max-width: 420px; width: calc(100% - 2rem); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(8, 12, 25, 0.55); }
.site-footer { border-top: 1px solid var(--border); padding: 1.25rem 0; color: var(--muted); font-size: 0.88rem; }
.site-footer .wrap { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }
.error-page { text-align: center; padding: 4rem 0; }
.error-page .code { font-size: 4.5rem; font-weight: 800; color: var(--brand); line-height: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 720px) {
  .site-header .wrap { flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .nav { margin-left: 0; width: 100%; justify-content: flex-start; }
  .card { padding: 1rem; }
}

/* spacing helpers (replace inline styles; the content policy forbids them) */
[data-u="mt-s"] { margin-top: 0.9rem; }
[data-u="mt-s2"] { margin-top: 0.75rem; }
[data-u="mt-s3"] { margin: 0.8rem 0 0; }
[data-u="mt-m"] { margin-top: 1.25rem; }
[data-u="mt-l"] { margin-top: 1.5rem; }
[data-u="mt-xl"] { margin-top: 2rem; }
[data-u="my-m"] { margin: 1rem 0 0.6rem; }
[data-u="m0"] { margin: 0; }
[data-u="end"] { align-items: end; }
[data-u="jend"] { justify-content: flex-end; }
[data-u="narrow"] { max-width: 800px; margin: 0 auto; }
[data-u="plain-list"] { margin: 0; padding-left: 1.2rem; }
[data-u="stats-grid"] { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
[data-u="filters-grid"] { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
