:root {
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-primary-light: #eff6ff;
  --c-dark: #0f172a;
  --c-navy: #1e293b;
  --c-gray-700: #334155;
  --c-gray-500: #6b7280; /* 4.84:1 on white — passes WCAG AA */
  --c-gray-400: #94a3b8; /* decorative / non-text use only */
  --c-gray-200: #e2e8f0;
  --c-gray-100: #f1f5f9;
  --c-white: #ffffff;
  --c-success: #10b981;
  --c-error: #ef4444;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 4px 16px rgba(0,0,0,.07);
}

/* ── SKIP NAVIGATION ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 99999;
  background: var(--c-primary);
  color: #fff;
  padding: .6rem 1.25rem;
  font-weight: 600;
  font-size: .875rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  transition: top .1s;
}
.skip-link:focus { top: 0; }

/* ── FOCUS STYLES (keyboard navigation) ── */
*:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--c-dark);
  background: var(--c-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-gray-200);
}

.nav-logo {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.1rem; font-weight: 700; color: var(--c-dark);
  text-decoration: none;
}

.nav-logo img { width: 32px; height: 32px; border-radius: 8px; }

.nav-actions { display: flex; align-items: center; gap: .75rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 8px;
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: all .15s;
}

.btn-primary {
  background: var(--c-primary); color: #fff;
  border-color: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); text-decoration: none; }

.btn-ghost {
  background: transparent; color: var(--c-gray-700);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--c-gray-100); color: var(--c-dark); text-decoration: none; }

.btn-outline {
  background: transparent; color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn-outline:hover { background: var(--c-primary-light); text-decoration: none; }

.btn-danger { background: var(--c-error); color: #fff; border-color: var(--c-error); }
.btn-danger:hover { background: #dc2626; text-decoration: none; }

.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; border-radius: 10px; }

/* ── FORMS ── */
.form-card {
  background: var(--c-white);
  border: 1px solid var(--c-gray-200);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
  width: 100%; max-width: 420px;
  margin: auto;
}

.form-title { font-size: 1.4rem; font-weight: 700; margin-bottom: .25rem; }
.form-sub { color: var(--c-gray-500); font-size: .875rem; margin-bottom: 1.5rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--c-gray-700); margin-bottom: .4rem; letter-spacing: .02em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%; padding: .6rem .85rem;
  border: 1.5px solid var(--c-gray-200); border-radius: 8px;
  font-size: .9375rem; color: var(--c-dark);
  background: var(--c-white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  outline: none; /* box-shadow is the visible indicator */
}
.field input[type="color"] { height: 42px; padding: 2px 6px; cursor: pointer; }

.field-hint { font-size: .78rem; color: var(--c-gray-500); margin-top: .3rem; }

.alert {
  padding: .75rem 1rem; border-radius: 8px;
  font-size: .875rem; margin-bottom: 1rem; font-weight: 500;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── LAYOUT ── */
.page-wrap {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: 3rem 1.5rem;
}

.page-center {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.5rem; min-height: calc(100vh - 64px - 60px);
}

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1a2f5a 50%, #0f172a 100%);
  color: #fff; text-align: center; padding: 6rem 1.5rem 5rem;
  position: relative; overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(37,99,235,.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(37,99,235,.2); border: 1px solid rgba(37,99,235,.4);
  color: #93c5fd; border-radius: 99px;
  padding: .3rem .9rem; font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 1.2rem; letter-spacing: -.02em;
}

.hero h1 span { color: #60a5fa; }

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.75); max-width: 580px;
  margin: 0 auto 2.5rem;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── FEATURES GRID ── */
.features { padding: 5rem 1.5rem; background: var(--c-gray-100); }
.features-header { text-align: center; margin-bottom: 3rem; }
.features-header h2 { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
.features-header p { color: var(--c-gray-500); max-width: 500px; margin: 0 auto; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 1100px; margin: 0 auto;
}

.feature-card {
  background: var(--c-white); border: 1px solid var(--c-gray-200);
  border-radius: 14px; padding: 1.5rem;
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--c-primary-light); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon svg { width: 22px; height: 22px; }

.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.feature-card p { font-size: .85rem; color: var(--c-gray-500); line-height: 1.5; }

/* ── HOW IT WORKS ── */
.how { padding: 5rem 1.5rem; text-align: center; }
.how h2 { font-size: 2rem; font-weight: 800; margin-bottom: .75rem; }
.how-sub { color: var(--c-gray-500); max-width: 480px; margin: 0 auto 3rem; }

.steps-row {
  display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
  max-width: 800px; margin: 0 auto;
}

.step-item { flex: 1; min-width: 200px; max-width: 240px; }
.step-num {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; margin: 0 auto 1rem;
}
.step-item h3 { font-weight: 700; margin-bottom: .4rem; }
.step-item p { font-size: .875rem; color: var(--c-gray-500); }

/* ── CTA STRIP ── */
.cta-strip {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff; text-align: center; padding: 4rem 1.5rem;
}
.cta-strip h2 { font-size: 2rem; font-weight: 800; margin-bottom: .75rem; }
.cta-strip p { color: rgba(255,255,255,.8); margin-bottom: 2rem; }

/* ── DASHBOARD ── */
.dash-layout {
  flex: 1; display: flex; min-height: calc(100vh - 64px);
}

.dash-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--c-navy); color: #fff;
  padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}

.dash-sidebar-logo {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: .95rem;
  padding: .5rem .75rem 1.25rem;
  color: #fff;
}
.dash-sidebar-logo img { width: 28px; height: 28px; border-radius: 6px; }

.dash-nav-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border-radius: 8px;
  color: rgba(255,255,255,.7); font-size: .875rem; font-weight: 500;
  text-decoration: none; transition: all .15s;
}
.dash-nav-link:hover, .dash-nav-link.active {
  background: rgba(255,255,255,.1); color: #fff; text-decoration: none;
}
.dash-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.dash-sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1rem;
}

.dash-main { flex: 1; padding: 2rem; background: var(--c-gray-100); overflow: auto; }

.dash-header { margin-bottom: 2rem; }
.dash-header h1 { font-size: 1.5rem; font-weight: 800; }
.dash-header p { color: var(--c-gray-500); font-size: .875rem; }

.dash-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

/* ── CARDS ── */
.card {
  background: var(--c-white); border: 1px solid var(--c-gray-200);
  border-radius: 14px; padding: 1.5rem; box-shadow: var(--shadow);
}
.card-title {
  font-size: 1rem; font-weight: 700; margin-bottom: .25rem;
  display: flex; align-items: center; gap: .5rem;
}
.card-title svg { width: 18px; height: 18px; color: var(--c-primary); }
.card-sub { font-size: .8rem; color: var(--c-gray-500); margin-bottom: 1.25rem; }

/* ── CODE BLOCK ── */
.code-block {
  background: var(--c-navy); color: #e2e8f0;
  border-radius: 10px; padding: 1rem 1.25rem;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: .8rem; line-height: 1.7;
  position: relative; overflow-x: auto;
  white-space: pre-wrap; word-break: break-all;
}

.copy-btn {
  position: absolute; top: .6rem; right: .6rem;
  background: rgba(255,255,255,.1); border: none;
  color: #94a3b8; padding: .35rem .7rem; border-radius: 6px;
  font-size: .75rem; cursor: pointer; transition: all .15s;
}
.copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── ADMIN TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { background: var(--c-gray-100); padding: .75rem 1rem; text-align: left; font-weight: 600; color: var(--c-gray-700); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
td { padding: .75rem 1rem; border-top: 1px solid var(--c-gray-200); }
tr:hover td { background: var(--c-gray-100); }

/* ── FOOTER ── */
.site-footer {
  background: var(--c-navy); color: rgba(255,255,255,.7); /* ≥4.5:1 on navy */
  text-align: center; padding: 1.25rem; font-size: .8rem;
  flex-shrink: 0;
}

/* ── TOGGLE SWITCH ── */
.toggle-wrap { display: flex; align-items: center; gap: .75rem; margin: .5rem 0; }
.toggle-wrap label { font-size: .875rem; color: var(--c-gray-700); cursor: pointer; }
.toggle {
  position: relative; width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--c-gray-200); border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--c-primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── COLOR PICKER PREVIEW ── */
.color-preview-row { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.color-swatch { width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--c-gray-200); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
}
.badge-blue { background: var(--c-primary-light); color: var(--c-primary); }
.badge-green { background: #f0fdf4; color: #166534; }
.badge-gray  { background: var(--c-gray-100); color: var(--c-gray-500); }

/* ── LIVE DEMO SECTION ── */
.demo-sect { padding: 5rem 1.5rem; background: var(--c-white); }
.demo-sect-header { text-align: center; margin-bottom: 2.5rem; }
.demo-sect-header h2 { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
.demo-sect-header p { color: var(--c-gray-500); max-width: 580px; margin: 0 auto; }

.demo-browser {
  max-width: 720px; margin: 0 auto;
  border-radius: 14px; border: 1.5px solid var(--c-gray-200);
  box-shadow: 0 8px 32px rgba(0,0,0,.1); overflow: hidden;
}
.demo-browser-bar {
  background: var(--c-gray-100); padding: .6rem 1rem;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid var(--c-gray-200);
}
.demo-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c-gray-200); flex-shrink:0; }
.demo-dot:nth-child(1) { background: #fc5f57; }
.demo-dot:nth-child(2) { background: #febc2e; }
.demo-dot:nth-child(3) { background: #28c840; }
.demo-url {
  flex: 1; background: var(--c-white); border-radius: 5px;
  padding: .2rem .75rem; font-size: .75rem; color: var(--c-gray-500);
  margin-left: .25rem; border: 1px solid var(--c-gray-200);
}
.demo-content { padding: 2rem 2.5rem; }
.demo-content h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; color: var(--c-dark); }
.demo-content p { font-size: .9375rem; color: var(--c-gray-700); line-height: 1.7; margin-bottom: .75rem; }
.demo-content p:last-child { margin-bottom: 0; }
.demo-notice {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--c-primary-light); color: var(--c-primary-dark);
  border: 1px solid #bfdbfe; border-radius: 8px;
  padding: .5rem 1rem; font-size: .8rem; font-weight: 600;
  margin-top: 1.5rem;
}
