/* =========================================================
   QA Fixture Lab — shared design system
   ========================================================= */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --border: #e3e5ec;
  --text: #12141c;
  --text-muted: #5b6172;
  --primary: #4f46e5;
  --primary-dark: #3c33b8;
  --primary-light: #eef0fe;
  --accent: #0d9488;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --warn-bg: #fff7ed;
  --warn-border: #fdba74;
  --warn-text: #9a3412;
  --ok-bg: #f0fdf4;
  --ok-border: #bbf7d0;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 20, 34, 0.04), 0 4px 14px rgba(16, 20, 34, 0.06);
  --mono: "Cascadia Code", Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-bg: #0f1424;
  --nav-text: #e7e9f5;
  --nav-text-dim: #9aa0b8;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Top nav ---------- */
.site-header {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--nav-text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-family: var(--mono); font-weight: 700; font-size: 0.85rem;
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--nav-text-dim);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--nav-text);
  background: rgba(255,255,255,0.07);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  background: none; border: none; color: var(--nav-text);
  font-size: 1.4rem; cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 8px; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #101528 0%, #171d33 100%);
  color: white;
  padding: 64px 0 56px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.hero p {
  color: #c3c7db;
  max-width: 680px;
  font-size: 1.08rem;
  margin: 0 0 24px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.page-hero {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.page-hero h1 { margin: 0 0 8px; font-size: 1.8rem; letter-spacing: -0.01em; }
.page-hero p { color: var(--text-muted); margin: 0; max-width: 720px; }
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: rgba(255,255,255,0.08); color: white; border-color: rgba(255,255,255,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.15); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Sections ---------- */
section { padding: 48px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: 1.5rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.section-head p { color: var(--text-muted); margin: 0; max-width: 640px; }

/* ---------- Tool grid / cards ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.tool-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.tool-card h3 { margin: 0; font-size: 1.08rem; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; flex: 1; }
.tool-card a.card-link { font-weight: 600; font-size: 0.9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ---------- Forms / tool controls ---------- */
.tool-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-row input { width: 16px; height: 16px; }
.checkbox-row label { font-size: 0.88rem; font-weight: 500; margin: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer;
}
.swatch.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

/* ---------- Output areas ---------- */
.output-box {
  background: #0f1424;
  color: #d6e2ff;
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.82rem;
  overflow: auto;
  max-height: 480px;
  white-space: pre;
  border: 1px solid #262c47;
}
.preview-frame {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}
.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}
.result-toolbar h3 { margin: 0; font-size: 1rem; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Table ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
  font-family: var(--mono);
  white-space: nowrap;
}
.data-table th { background: var(--surface-2); }
.table-scroll { overflow: auto; max-height: 420px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------- Cards result grid (credit cards) ---------- */
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.cc-card {
  border-radius: 14px;
  padding: 18px;
  color: white;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--mono);
  position: relative;
  box-shadow: var(--shadow);
}
.cc-network { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.cc-number { font-size: 1.15rem; letter-spacing: 0.06em; margin: 14px 0; }
.cc-meta { display: flex; justify-content: space-between; font-size: 0.75rem; opacity: 0.9; }
.cc-name { font-size: 0.8rem; opacity: 0.9; }

/* ---------- Banners ---------- */
.banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.9rem;
  margin-bottom: 22px;
  border: 1px solid;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.banner-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.banner-danger { background: var(--danger-bg); border-color: var(--danger-border); color: #7f1d1d; }
.banner-ok { background: var(--ok-bg); border-color: var(--ok-border); color: #14532d; }
.banner strong { display: block; margin-bottom: 2px; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}

/* ---------- Ad slots ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, #f1f2f7, #f1f2f7 10px, #e7e9f2 10px, #e7e9f2 20px);
  border: 1px dashed #b9bdd0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a8095;
  font-size: 0.78rem;
  font-family: var(--mono);
  text-align: center;
  padding: 10px;
}
.ad-slot-leaderboard { min-height: 90px; margin: 24px 0; }
.ad-slot-square { min-height: 250px; }
.ad-slot-sidebar { min-height: 600px; }
.ad-slot-infeed { min-height: 100px; margin: 28px 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--nav-bg);
  color: var(--nav-text-dim);
  padding: 40px 0 24px;
  margin-top: 60px;
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-grid h4 { color: var(--nav-text); font-size: 0.85rem; margin: 0 0 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-grid a { color: var(--nav-text-dim); }
.footer-grid a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Prose (legal pages) ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 32px; }
.prose p, .prose li { color: var(--text-muted); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #12141c;
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
