/* ---------- Tokens ---------- */
:root {
  --blue: #1a56db;
  --blue-dark: #1445b8;
  --blue-deep: #0f3a9c;
  --green: #12a150;
  --green-bg: #e6f7ee;
  --red: #d63b3b;
  --red-bg: #fdeaea;
  --amber: #b7791f;
  --amber-bg: #fff4e0;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #17203a;
  --muted: #5b6785;
  --border: #dde3ee;
  --shadow: 0 10px 30px rgba(16, 32, 72, .10);
  --radius: 14px;
  --hero-overlay: linear-gradient(180deg, rgba(8, 20, 55, .55) 0%, rgba(8, 20, 55, .35) 60%, rgba(245, 247, 251, 1) 100%);
}
html[data-theme="dark"] {
  --bg: #0c1220;
  --surface: #141c2f;
  --surface-2: #1c2740;
  --text: #e9eef8;
  --muted: #9aa7c4;
  --border: #283552;
  --green-bg: #113322;
  --red-bg: #3a1a1a;
  --amber-bg: #3a2c12;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --hero-overlay: linear-gradient(180deg, rgba(4, 10, 30, .65) 0%, rgba(4, 10, 30, .45) 60%, rgba(12, 18, 32, 1) 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Side rail ---------- */
.side-rail {
  position: fixed; left: 0; top: 140px; z-index: 20;
  background: var(--surface); border-radius: 0 12px 12px 0;
  box-shadow: var(--shadow); padding: 6px;
}
.rail-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--blue);
}
.rail-btn:hover { background: var(--surface-2); }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding-bottom: 32px; color: #fff;
  background-image:
    var(--hero-overlay),
    radial-gradient(60% 80% at 80% 10%, #4f7ff0 0%, transparent 60%),
    radial-gradient(50% 70% at 10% 90%, #0b2f8a 0%, transparent 60%),
    linear-gradient(135deg, #123c9e 0%, #1a56db 45%, #0a2a7a 100%);
  background-size: cover;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23ffffff' stroke-opacity='.12' stroke-width='1'/%3E%3C/svg%3E");
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}
.hero > * { position: relative; }

.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 30px; }
.brand { font-size: 28px; font-weight: 800; letter-spacing: -.5px; color: #fff; }
.brand span { color: #9dc0ff; }
.brand.small { font-size: 20px; color: var(--text); }
.brand.small span { color: var(--blue); }
.nav-right { display: flex; align-items: center; gap: 10px; }
/* Visible: a compact code with a chevron. The real <select> sits on top, invisible, so the native dropdown (with full names) still opens. */
.currency-select {
  position: relative; display: inline-flex; align-items: center; cursor: pointer;
  color: #fff; font-weight: 600; padding: 6px 22px 6px 8px; border-radius: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
}
.currency-select:hover { background-color: rgba(255,255,255,.12); }
.currency-select select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0;
}
.currency-select select option, .currency-select select optgroup { color: #111; background: #fff; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  border-radius: 10px; padding: 10px 18px; font-weight: 600; transition: .15s;
}
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.24); }
.btn-solid { background: #fff; color: var(--blue); }
.btn-solid:hover { background: #e9f0ff; }

/* Mode tabs */
.mode-tabs {
  display: flex; gap: 6px; width: fit-content; max-width: 100%; margin: 0 auto 18px; padding: 6px;
  background: rgba(10, 22, 60, .55); backdrop-filter: blur(10px); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none;
}
.mode-tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  background: transparent; color: #dbe6ff; font-weight: 600;
}
.mode-tab:hover { background: rgba(255,255,255,.12); }
.mode-tab.active { background: #fff; color: var(--blue); }

/* Search card */
.search-card {
  background: var(--blue); border-radius: 18px; padding: 30px 32px 26px; box-shadow: var(--shadow);
}
.search-card h1, .search-card h2 { margin: 0 0 4px; font-size: 26px; font-weight: 700; }
.search-card .subtitle { margin: 0 0 20px; color: #cfe0ff; }
.search-form { display: flex; gap: 12px; flex-wrap: wrap; }
.field {
  display: flex; align-items: center; gap: 10px; min-height: 52px;
  background: var(--blue-dark); border: 1px solid rgba(255,255,255,.28); border-radius: 12px; padding: 0 14px;
  color: #fff;
}
.field:focus-within { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.field-grow { flex: 1 1 320px; }
.field-select { flex: 0 0 170px; }
.field input, .field select {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font-size: 16px; font-weight: 500;
}
.field input::placeholder { color: #a9c2f5; }
.field select { appearance: none; cursor: pointer; }
.field select option { color: #111; }
.field-prefix { font-size: 22px; font-weight: 700; color: #a9c2f5; }
.btn-search { background: #fff; color: var(--blue); min-height: 52px; padding: 0 28px; border-radius: 12px; font-size: 16px; }
.btn-search:hover { background: #e9f0ff; }
.btn-search:disabled { opacity: .7; cursor: wait; }
.quick-tlds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.quick-tld {
  border: 0; cursor: pointer; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.14); color: #fff;
}
.quick-tld:hover, .quick-tld.on { background: #fff; color: var(--blue); }
.bulk-form { display: flex; flex-direction: column; gap: 12px; }
.bulk-form textarea {
  width: 100%; resize: vertical; border-radius: 12px; padding: 14px; border: 1px solid rgba(255,255,255,.28);
  background: var(--blue-dark); color: #fff; outline: 0; font-family: ui-monospace, Consolas, monospace;
}
.bulk-form textarea::placeholder { color: #a9c2f5; }
.bulk-form .btn-search { align-self: flex-start; }

/* ---------- Main ---------- */
main { padding: 8px 0 40px; }
.status {
  margin: 12px 0; padding: 12px 16px; border-radius: 12px; font-size: 14px;
  background: var(--amber-bg); color: var(--amber); border: 1px solid transparent;
}
.status.error { background: var(--red-bg); color: var(--red); }
.status.info { background: var(--surface); color: var(--muted); border-color: var(--border); }

.results { display: flex; flex-direction: column; gap: 20px; margin-top: 12px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 22px; font-weight: 700; word-break: break-all; }
.card-head .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.likely { background: var(--green-bg); color: var(--green); outline: 1px dashed var(--green); outline-offset: -1px; }
.badge.taken { background: var(--red-bg); color: var(--red); }
.badge.unknown { background: var(--amber-bg); color: var(--amber); }
.badge.loading { background: var(--surface-2); color: var(--muted); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.loading .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 14px 22px; text-align: left; white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
td.num.best { color: var(--green); }
td .best-tag { margin-left: 8px; font-size: 11px; font-weight: 700; background: var(--green-bg); color: var(--green); padding: 2px 8px; border-radius: 999px; }
.reg { display: flex; align-items: center; gap: 10px; }
.reg-logo { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.reg-name { font-weight: 600; }
.reg-src { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.reg-src.live { color: var(--green); }
.estimate-row { background: var(--surface-2); }
.estimate-row td.num { color: var(--muted); font-weight: 500; }
.estimate-disclosure {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 22px; border-top: 1px solid var(--border); background: var(--amber-bg);
  color: var(--amber); font-size: 13px;
}
.estimate-toggle {
  flex: none; border: 1px solid currentColor; border-radius: 8px; padding: 7px 11px;
  background: transparent; color: inherit; cursor: pointer; font-size: 12px; font-weight: 700;
}
.estimate-toggle:hover { background: rgba(255,255,255,.35); }
.btn-go { background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; }
.btn-go:hover { background: var(--blue-dark); }
.btn-go.off { background: var(--surface-2); color: var(--muted); pointer-events: none; }
.na { color: var(--muted); }
.card-foot { padding: 12px 22px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

/* alternatives */
.alt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 18px 22px 22px; }
.alt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.alt:hover { border-color: var(--blue); }
.alt-open {
  display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start;
  padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left;
}
.alt-open:hover .name { color: var(--blue); }
.alt .name { font-weight: 600; word-break: break-all; }
.alt .price { font-size: 13px; color: var(--muted); }
.alt .price b { color: var(--text); }
.alt-check {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px;
  background: var(--surface-2); color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700;
}
.alt-check:hover { border-color: var(--blue); }
.alt-check:disabled { cursor: wait; opacity: .7; }

/* popular TLD grid */
.section { margin-top: 44px; }
.section h2 { margin: 0 0 4px; font-size: 24px; }
.section > p, .section-head p { margin: 0; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pill-note { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
.tld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tld-card {
  background: var(--surface); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); cursor: pointer;
  border: 1px solid transparent; transition: .15s;
}
.tld-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.tld-card .tld { font-size: 22px; font-weight: 800; color: var(--blue); }
.tld-card .from { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tld-card .p { font-size: 18px; font-weight: 700; margin-top: 2px; }
.tld-card .who { font-size: 12px; color: var(--muted); }

/* how */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.how-card { background: var(--surface); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.how-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; }
.how-card h3 { margin: 12px 0 6px; }
.how-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* FAQ */
.faq-list { display: grid; gap: 10px; margin-top: 18px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.faq summary { padding: 16px 20px; cursor: pointer; font-weight: 700; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details p { margin: 0; padding: 16px 20px; color: var(--muted); }

/* about */
.about-card {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: center;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.about-text h2 { margin: 0 0 12px; }
.about-text p { margin: 0 0 12px; color: var(--muted); }
.about-text p:last-child { margin-bottom: 0; }
.about-text a { color: var(--blue); font-weight: 600; }
.about-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.about-facts li { background: var(--surface-2); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; }
.about-facts strong { font-size: 26px; font-weight: 800; color: var(--blue); line-height: 1.1; }
.about-facts span { font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (max-width: 800px) {
  .about-card { grid-template-columns: 1fr; }
}

/* footer */
.footer { border-top: 1px solid var(--border); padding: 26px 0; background: var(--surface); }
.footer-inner { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 16px; font-size: 14px; font-weight: 600; }
.footer-links a:hover { color: var(--blue); }

.privacy-note {
  display: flex; gap: 10px; margin-top: 28px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--muted); font-size: 13px;
}
.privacy-note strong { color: var(--text); white-space: nowrap; }

@media (max-width: 640px) {
  .brand { font-size: 21px; }
  .nav-right .btn-ghost { display: none; }
  .nav-right .btn-solid { display: none; }
  .search-card { padding: 22px 18px; }
  .field-select { flex: 1 1 100%; }
  .btn-search { width: 100%; justify-content: center; }
  .side-rail { top: auto; bottom: 20px; }
  th, td { padding: 12px 14px; }
  .privacy-note { flex-direction: column; }
  .estimate-disclosure { align-items: flex-start; flex-direction: column; }
}
