:root {
  --bg: #0b0d12;
  --surface: #14171f;
  --surface-2: #1b1f2a;
  --border: #262b38;
  --text: #eef0f4;
  --text-muted: #9aa1ac;
  --accent: #5b8cff;
  --accent-2: #7c6bff;
  --accent-contrast: #ffffff;
  --success: #34c77b;
  --danger: #ef5350;
  --warning: #f2a93b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f0f2f7;
    --border: #e3e6ee;
    --text: #14161c;
    --text-muted: #5b6270;
    --accent: #3b6bf5;
    --accent-2: #6a4bf0;
    --accent-contrast: #ffffff;
    --shadow: 0 20px 50px -25px rgba(30, 40, 70, 0.35);
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.5;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: relative;
  z-index: 2;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  color: var(--accent);
  width: 26px;
  height: 26px;
  display: inline-flex;
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 24px;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.site-header nav a:hover {
  color: var(--text);
}

/* Hero */

.hero {
  position: relative;
  padding: 84px 0 40px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
      circle at 50% -10%,
      color-mix(in srgb, var(--accent) 22%, transparent) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 85% 20%,
      color-mix(in srgb, var(--accent-2) 16%, transparent) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.hero .container {
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--text), var(--text) 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}

@supports (background-clip: text) {
  .hero h1 {
    color: transparent;
  }
}

.subtitle {
  color: var(--text-muted);
  margin: 0 auto 36px;
  max-width: 480px;
  font-size: 1.02rem;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.input-wrap {
  position: relative;
  flex: 1;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

#ruc-input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  box-shadow: var(--shadow);
}

#ruc-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-form button {
  padding: 14px 24px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.search-form button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.search-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Result card */

.result {
  margin: 28px auto 0;
  max-width: 480px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.2s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.result-title h3 {
  margin: 0;
  font-size: 1.1rem;
}

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.activo {
  background: rgba(52, 199, 123, 0.15);
  color: var(--success);
}

.badge.baja,
.badge.no-hallado {
  background: rgba(239, 83, 80, 0.15);
  color: var(--danger);
}

.badge.otro {
  background: rgba(242, 169, 59, 0.15);
  color: var(--warning);
}

.result dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  margin: 0;
}

.result dt {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.result dd {
  margin: 0;
  font-size: 0.92rem;
}

.result.error {
  color: var(--danger);
  text-align: center;
}

.result.loading {
  color: var(--text-muted);
  text-align: center;
}

/* Features */

.features {
  padding: 8px 0 56px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
}

.feature svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: 10px;
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  .search-form {
    flex-direction: column;
  }
}

/* API section */

.api {
  border-top: 1px solid var(--border);
  padding: 56px 0;
}

.api h2 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.api p {
  color: var(--text-muted);
}

.code-sample {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
}

.code-sample pre {
  margin: 0;
}

.code-sample code {
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--text);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Hide reCAPTCHA badge sanely -- keep it visible per Google ToS, just tidy spacing */
.grecaptcha-badge {
  z-index: 5;
}
