/* =============================================================================
   Code With Power — API Platform
   Dark premium design system
   ============================================================================= */

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

:root {
  --bg:            #07080c;
  --surface:       #0d1018;
  --surface-2:     #131720;
  --border:        #1d2235;
  --border-2:      #252c40;
  --accent:        #f97316;
  --accent-hover:  #ea6c0a;
  --accent-dim:    rgba(249, 115, 22, 0.1);
  --accent-glow:   rgba(249, 115, 22, 0.2);
  --text:          #dde1ec;
  --text-muted:    #68718a;
  --text-dim:      #363d52;
  --green:         #22c55e;
  --green-dim:     rgba(34, 197, 94, 0.12);
  --green-border:  rgba(34, 197, 94, 0.25);
  --red:           #ef4444;
  --red-dim:       rgba(239, 68, 68, 0.1);
  --red-border:    rgba(239, 68, 68, 0.25);
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
                   'Helvetica Neue', Arial, sans-serif;
  --mono:          'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono',
                   'Consolas', monospace;
  --radius:        14px;
  --radius-sm:     9px;
  --shadow:        0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Base ──────────────────────────────────────────────────────────────────── */

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Navigation ────────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 8, 12, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.brand-bolt {
  font-size: 1.25rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px var(--accent));
}

.brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

.status-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1;   box-shadow: 0 0 8px var(--green); }
  50%       { opacity: 0.4; box-shadow: 0 0 4px var(--green); }
}

/* ── Main layout ───────────────────────────────────────────────────────────── */

.main {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.2);
  padding: 0.3125rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.375rem;
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 1rem;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-sub {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 380px;
  margin: 0 auto;
}

/* ── Stats row ─────────────────────────────────────────────────────────────── */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.125rem 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  font-family: var(--mono);
}

.stat-value.accent {
  color: var(--accent);
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Card ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.875rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ── Form ──────────────────────────────────────────────────────────────────── */

.form-row {
  display: flex;
  gap: 0.625rem;
  align-items: stretch;
}

.form-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
  height: 48px;
  padding: 0 0.625rem;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--mono);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 0.5rem;
}

.form-select:focus {
  border-color: var(--accent);
}

.btn-primary {
  height: 48px;
  padding: 0 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Ghost button (used on placeholder pages) ──────────────────────────────── */

.btn-ghost {
  display: inline-block;
  height: 40px;
  line-height: 38px;
  padding: 0 1.25rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Result area ───────────────────────────────────────────────────────────── */

.result-area {
  display: none;
  margin-top: 1.25rem;
}

.result-area.show {
  display: block;
  animation: fade-in 0.2s ease;
}

.result-area.loading {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0 0.25rem;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */

.result-spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

/* ── Result card ───────────────────────────────────────────────────────────── */

.result-card {
  border-radius: var(--radius-sm);
  padding: 1.125rem 1.375rem;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
}

.result-card.available {
  border-color: var(--green-border);
  background: var(--green-dim);
}

.result-card.registered {
  border-color: var(--red-border);
  background: var(--red-dim);
}

.result-card.error,
.result-card.unknown {
  border-color: var(--border-2);
  background: var(--surface-2);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.result-domain {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.result-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-badge.available {
  color: var(--green);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.result-badge.registered {
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.result-badge.unknown,
.result-badge.error {
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.result-message {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.result-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-top: 0.25rem;
}

/* ── Footer note ───────────────────────────────────────────────────────────── */

.footer-note {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.footer-note p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-note a {
  color: var(--accent);
  text-decoration: none;
}

.footer-note a:hover {
  text-decoration: underline;
}

/* ── Placeholder pages (login, admin, 404) ─────────────────────────────────── */

.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.125rem;
  min-height: 55vh;
}

.placeholder-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3125rem 0.875rem;
  border-radius: 100px;
}

.placeholder-page h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.placeholder-page p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 340px;
  line-height: 1.6;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .nav {
    padding: 1rem 1.125rem;
  }

  .brand-name {
    font-size: 0.875rem;
  }

  .main {
    padding: 2.5rem 1rem 4rem;
  }

  .card {
    padding: 1.375rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-input,
  .form-select,
  .btn-primary {
    width: 100%;
  }

  .form-select {
    padding: 0 1rem;
  }

  .stat-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
  }

  .stat-card {
    padding: 0.875rem 0.5rem;
  }

  .stat-value {
    font-size: 1rem;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
