/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface-2: #21262d;
  --border:    #30363d;
  --text:      #e6edf3;
  --text-muted:#8b949e;
  --accent:    #f78166;
  --accent-2:  #ffa657;
  --green:     #3fb950;
  --red:       #f85149;
  --blue:      #58a6ff;
  --radius:    12px;
  --shadow:    0 8px 32px rgba(0,0,0,.5);
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
header {
  text-align: center;
  padding: 4rem 0 2rem;
}

header h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: .75rem;
}

.subheadline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Explanation card ─────────────────────────────────────────────────────── */
.explanation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.explanation strong {
  color: var(--text);
}

.explanation .tagline {
  font-size: 1.05rem;
  color: var(--accent);
  font-style: italic;
  margin-top: .75rem;
  display: block;
}

/* ── Lookup card ──────────────────────────────────────────────────────────── */
.lookup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.lookup-card h2 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* ── Password field ───────────────────────────────────────────────────────── */
.field-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.field-wrap input[type="password"],
.field-wrap input[type="text"] {
  width: 100%;
  padding: .75rem 3rem .75rem 1rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--mono);
  outline: none;
  transition: border-color .2s;
}

.field-wrap input:focus {
  border-color: var(--accent);
}

.toggle-visibility {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .25rem;
  font-size: 1.1rem;
  line-height: 1;
  transition: color .2s;
}
.toggle-visibility:hover { color: var(--text); }

/* ── Turnstile widget ─────────────────────────────────────────────────────── */
.turnstile-wrap {
  margin-bottom: 1rem;
}

/* ── Submit button ────────────────────────────────────────────────────────── */
.btn-check {
  width: 100%;
  padding: .85rem 1.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  letter-spacing: .02em;
}

.btn-check:hover:not(:disabled) {
  opacity: .9;
  transform: translateY(-1px);
}

.btn-check:active:not(:disabled) {
  transform: translateY(0);
}

.btn-check:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ── Secondary / "Check Another" button ──────────────────────────────────── */
.btn-secondary {
  width: 100%;
  margin-top: 1rem;
  padding: .75rem 1.5rem;
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, transform .1s, box-shadow .2s;
  letter-spacing: .02em;
}

.btn-secondary:hover {
  background: rgba(247, 129, 102, 0.12);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(247, 129, 102, 0.2);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: .4em;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Result area ──────────────────────────────────────────────────────────── */
#result {
  margin-top: 1.25rem;
  display: none;
}

.result-box {
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  border: 1.5px solid;
  font-size: .95rem;
  line-height: 1.7;
}

.result-box.found {
  background: rgba(248, 81, 73, .1);
  border-color: var(--red);
  color: var(--text);
}

.result-box.not-found {
  background: rgba(63, 185, 80, .1);
  border-color: var(--green);
  color: var(--text);
}

.result-box.error {
  background: rgba(88, 166, 255, .1);
  border-color: var(--blue);
  color: var(--text);
}

.result-badge {
  display: inline-block;
  padding: .2em .7em;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}

.result-badge.found    { background: var(--red);   color: #fff; }
.result-badge.not-found { background: var(--green); color: #fff; }
.result-badge.error    { background: var(--blue);  color: #fff; }

.result-count {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-2);
  display: block;
  margin-bottom: .4rem;
}

.result-message {
  color: var(--text-muted);
}

/* ── Privacy notice ───────────────────────────────────────────────────────── */
.privacy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.75rem;
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.privacy h3 {
  font-size: .9rem;
  color: var(--text);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  margin-top: auto;
  padding: 1.5rem 0 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
}

footer p + p {
  margin-top: .3rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  header { padding: 2.5rem 0 1.5rem; }
  .lookup-card  { padding: 1.5rem; }
  .explanation  { padding: 1.25rem; }
}
