/* felai.se — site.css — 46elks-inspired light theme */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap');

/* ─── Design tokens ────────────────────────────────────────────────────── */
:root {
  --primary:       #4C54DF;
  --primary-hover: #2426C7;
  --heading:       #110C45;
  --body:          #242424;
  --muted:         #6B7280;
  --light-bg:      #F5F5FC;
  --border:        #E5E7EB;
  --white:         #ffffff;
  --code-bg:       #242424;
  --inline-code-bg: #EFEEFC;
  --inline-code-border: #B2B4F1;
  --green:         #16A34A;
  --green-bg:      #DCFCE7;
  --red:           #DC2626;
  --red-bg:        #FEE2E2;
  --footer-bg:     #161265;
  --radius:        12px;
  --radius-pill:   9999px;
  --max-content:   768px;
  --max-wide:      1024px;
}

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

/* ─── Base ─────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

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

/* ─── Layout helpers ───────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.container-wide {
  width: 100%;
  max-width: var(--max-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--light-bg);
}

/* ─── Navigation ───────────────────────────────────────────────────────── */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--heading);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-logo:hover { color: var(--primary); text-decoration: none; }

.nav-logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--body);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
  background: var(--light-bg);
  color: var(--primary);
  text-decoration: none;
}

.nav-links a.btn-nav-cta {
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
}

.nav-links a.btn-nav-cta:hover {
  background: var(--primary-hover);
  color: var(--white);
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--white);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
}

.btn-sm {
  padding: 10px 22px;
  font-size: 0.9rem;
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding: 96px 0 80px;
  text-align: center;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero-lead {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Feature grid ─────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.section-alt .feature-card {
  background: var(--white);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

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

/* ─── How it works steps ───────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  counter-reset: step;
}

.step {
  text-align: center;
  padding: 24px 16px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.step h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.step p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

/* ─── Code blocks ──────────────────────────────────────────────────────── */
pre {
  background: var(--code-bg);
  color: #F8F8F2;
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 24px 0;
}

pre code {
  background: none;
  border: none;
  color: inherit;
  font-size: inherit;
  padding: 0;
}

code {
  background: var(--inline-code-bg);
  border: 1px solid var(--inline-code-border);
  color: var(--primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  padding: 2px 6px;
  border-radius: 4px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1a2e;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 12px 20px;
  font-size: 0.8rem;
  color: #9CA3AF;
  margin-bottom: -1px;
}

.code-header + pre {
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: 0;
}

/* ─── Tables ───────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 24px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}

thead {
  background: var(--light-bg);
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--light-bg);
}

.required-badge {
  display: inline-block;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.optional-badge {
  display: inline-block;
  background: var(--light-bg);
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

/* ─── Section headings ─────────────────────────────────────────────────── */
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  margin-bottom: 16px;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 540px;
  margin-bottom: 48px;
}

/* ─── Docs layout ──────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 80px;
}

.docs-sidebar {
  position: sticky;
  top: 80px;
}

.docs-sidebar ul {
  list-style: none;
}

.docs-sidebar li { margin-bottom: 2px; }

.docs-sidebar a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.docs-sidebar a:hover,
.docs-sidebar a.active {
  background: var(--light-bg);
  color: var(--primary);
}

.docs-sidebar .sidebar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--heading);
  padding: 16px 12px 6px;
}

.docs-content h2 {
  margin-top: 56px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.docs-content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.docs-content h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

/* ─── Form inputs ──────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: var(--body);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76, 84, 223, 0.12);
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--heading);
}

.form-group { margin-bottom: 20px; }

/* ─── Badges / pills ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-blue {
  background: rgba(76, 84, 223, 0.12);
  color: var(--primary);
}

.badge-green {
  background: var(--green-bg);
  color: var(--green);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red);
}

/* HTTP method badges */
.method {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'SF Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.method-post { background: #DCFCE7; color: #166534; }
.method-get  { background: #DBEAFE; color: #1E40AF; }

/* ─── Endpoint cards ───────────────────────────────────────────────────── */
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.endpoint-path {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
}

/* ─── Spinner ──────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

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

/* ─── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.7);
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 8px;
}

.footer-brand span { color: #8B8FE8; }

.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
}

.footer-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--white); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* ─── Alerts / notices ─────────────────────────────────────────────────── */
.notice {
  background: var(--inline-code-bg);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
}

/* ─── Account / stat cards ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.stat-card {
  background: var(--light-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── Secret / API key display ─────────────────────────────────────────── */
.secret-box {
  background: var(--code-bg);
  color: #F8F8F2;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1rem;
  letter-spacing: 0.05em;
  margin: 16px 0;
  word-break: break-all;
}

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }

  .hero { padding: 60px 0 48px; }

  .section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .nav-links { gap: 4px; }
  .nav-links a { padding: 8px 10px; font-size: 0.875rem; }
  .hero-actions { flex-direction: column; align-items: center; }
}
