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

/* ─────────────────────────────────────────────────────────────────────────
   WebSpeed Builder — Gradient Mesh 2025 theme
   Poppins font · indigo (#6366f1) primary · orange (#e8571a) accent
   Glassmorphism cards · gradient text · soft shadows
   ─────────────────────────────────────────────────────────────────────── */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-soft: rgba(99,102,241,0.06);
  --accent: #e8571a;
  --accent-hover: #c94510;
  --accent-soft: #fff7ed;
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --white: #ffffff;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --text: #0f172a;
  --text-soft: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --success: #10b981;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #f59e0b;
  --warning-soft: #fff7ed;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.05);
  --shadow: 0 4px 20px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.1);
  --shadow-colored: 0 12px 32px rgba(99,102,241,0.12);
  --shadow-orange: 0 8px 24px rgba(232,87,26,0.25);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gradient-primary: linear-gradient(135deg, #6366f1, #4f46e5);
  --gradient-mesh: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #e8571a 100%);
  /* Wizard "Adaugă site" — single vertical rhythm shared across all 6 steps */
  --wiz-row-gap: 20px;       /* between vertical rows inside a step */
  --wiz-col-gap: 16px;       /* between fields on the same row */
  --wiz-label-gap: 6px;      /* between a field label and its input */
  --wiz-section-gap: 28px;   /* between large section headers */
  --wiz-card-padding: 32px;  /* white wizard card padding */
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: #333;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font);
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-weight: 700; }
h2 { font-weight: 600; }

/* ── Utilities ───────────────────────────────────── */
.hidden { display: none !important; }
.muted { color: var(--text-soft); }
.spacer { flex: 1; }
.hint { font-size: 13px; color: var(--text-soft); }
.lead { color: var(--text-soft); font-size: 16px; }
.container { max-width: 1140px; width: 100%; margin: 0 auto; padding: 0 24px; }
.gradient-text {
  background: var(--gradient-mesh);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Typography ──────────────────────────────────── */
.display {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.025em;
}
.display-sm {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

/* ── Mesh background (auth, dashboard, etc.) ─────── */
.mesh-bg {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.mesh-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99,102,241,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(139,92,246,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(6,182,212,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 90% 80%, rgba(232,87,26,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ── Topbar (glass) ──────────────────────────────── */
/* Topbar background spans the full viewport width; its content is laid out
   inside `<div class="container">` so it caps at 1140px and centers, matching
   the page body below. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  transition: box-shadow 0.2s var(--ease);
}
.topbar.scrolled { box-shadow: var(--shadow); }
.topbar > .container {
  display: flex;
  align-items: center;
  gap: 16px;
  /* Horizontal 24px inherited from .container; just add vertical padding. */
  padding-top: 14px;
  padding-bottom: 14px;
}
/* Topbar nav-actions cluster (right side of dashboard / builder / etc.). */
.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand .brand-bolt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--gradient-mesh);
  color: var(--white);
  flex-shrink: 0;
}
.brand span[data-content="app.name"] { color: var(--text); }

/* Home link — present in dashboard topbar-nav and to the LEFT of the editor
   brand. Lets the user jump back to the public marketing page (webspeed.ro/)
   without going through dashboard/logout. */
.editor-home-link,
.nav-link-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--slate-700, #475569);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.editor-home-link:hover,
.nav-link-home:hover {
  background: var(--slate-100, #f1f5f9);
  color: var(--primary, #6366f1);
}
.editor-home-link {
  font-size: 18px;
  line-height: 1;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-soft);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.btn-primary:hover:not(:disabled) {
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.btn-accent {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(232,87,26,0.3);
}
.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-orange);
}
.btn-outline {
  border-color: var(--border);
  background: var(--white);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  padding: 8px 14px;
}
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--slate-100); }
.btn-ai-outline {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.btn-ai-outline:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; color: var(--white); }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s var(--ease);
}
.card:hover { border-color: var(--primary); box-shadow: var(--shadow-colored); }
.empty-state {
  text-align: center;
  padding: 64px 24px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--slate-50);
}
.empty-state h2 { font-size: 20px; margin-bottom: 8px; color: var(--text); }
.empty-state p { color: var(--text-soft); margin: 0 0 20px; }

/* ── Forms ───────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: var(--wiz-label-gap); }
.field > span { font-size: 13px; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder { color: var(--slate-400); }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.toggle-row > span:first-child { font-size: 14px; color: var(--text); font-weight: 500; }
.toggle-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--slate-300);
  border-radius: 100px;
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
  display: inline-block;
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.toggle-row input[type="checkbox"]:checked + .switch { background: var(--primary); }
.toggle-row input[type="checkbox"]:checked + .switch::after { transform: translateX(18px); }

/* ── Auth (login + OTP) ──────────────────────────── */
.auth-shell {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
  background: var(--white);
}
.auth-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(99,102,241,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(139,92,246,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 90% 10%, rgba(232,87,26,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(99,102,241,0.15);
}
.auth-card .display-sm { margin-bottom: 8px; }
.auth-card .muted { margin-bottom: 28px; }
.auth-card form { text-align: left; }
.otp-inputs { display: flex; gap: 8px; justify-content: center; margin: 8px 0 16px; }
.otp-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: all 0.2s var(--ease);
}
.otp-inputs input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.inline-warning {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin: 10px 0;
}

/* ── Hero (legacy in-app hero) ───────────────────── */
.hero { padding: 64px 0; }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.hero-text { max-width: 540px; }
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-visual img { width: 100%; max-width: 480px; }

/* ── Dashboard ───────────────────────────────────── */
.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 48px 0 32px;
  gap: 24px;
  flex-wrap: wrap;
}
.dashboard-head h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.dashboard-head .muted { font-size: 14px; }
.sites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.site-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
}
.site-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(99,102,241,0.1);
  transform: translateY(-4px);
}
.site-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--slate-100);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
}
.site-card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.site-card-thumb-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  color: var(--slate-300);
}
.site-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.site-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.site-card-meta { font-size: 12px; color: var(--text-soft); }
.site-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-soft);
  overflow: visible;
}
.site-card-actions .btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
}

/* ── Builder shell ───────────────────────────────── */
.builder {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
}
.builder-steps {
  position: sticky;
  top: 80px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.builder-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}
.builder-step.active {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.builder-step.done .step-num { background: var(--success); color: var(--white); }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--slate-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}
.builder-step.active .step-num {
  background: var(--gradient-primary);
  color: var(--white);
}
.step-info { min-width: 0; }
.step-info-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.builder-step:not(.active) .step-info-title { color: var(--text-soft); }
.step-info-desc { font-size: 12px; color: var(--text-muted); }

.builder-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--wiz-card-padding);
  min-height: 400px;
}
.step-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; }
.builder-content > p.muted { margin: 0 0 24px; }
/* Single vertical rhythm — every direct child of #step-body is one row. */
#step-body { display: flex; flex-direction: column; gap: var(--wiz-row-gap); }
.builder-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  gap: 12px;
}

/* ── Template picker ─────────────────────────────── */
.template-groups { display: flex; flex-direction: column; gap: 32px; }
.template-group-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.template-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  position: relative;
}
.template-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.12);
}
.template-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.template-card.template-recommended::before {
  content: "Recomandat";
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  background: var(--gradient-primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.template-preview-wrap {
  aspect-ratio: 3 / 4;
  background: var(--slate-100);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.template-preview-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.template-card .template-meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.template-card .template-meta strong { font-size: 14px; font-weight: 600; color: var(--text); }
.template-card .template-meta span { font-size: 12px; color: var(--text-soft); }
.template-check {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: var(--white);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.template-card.active .template-check { display: flex; }
.template-demo-link {
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  background: var(--slate-50);
  transition: color 0.2s var(--ease);
}
.template-demo-link:hover { color: var(--primary); }

/* ── Check & radio groups ────────────────────────── */
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-size: 14px;
}
.check-item:hover { border-color: var(--primary); }
.check-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.check-item input[type="checkbox"] { display: none; }
.check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--slate-300);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  background: var(--white);
}
.check-item.active .check-box { background: var(--primary); border-color: var(--primary); }
.check-item.active .check-box::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-size: 14px;
}
.radio-item:hover { border-color: var(--primary); }
.radio-item.active { border-color: var(--primary); background: var(--primary-soft); }
.radio-item input[type="radio"] { display: none; }
.radio-dot {
  width: 18px; height: 18px;
  border: 1.5px solid var(--slate-300);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  background: var(--white);
}
.radio-item.active .radio-dot { border-color: var(--primary); }
.radio-item.active .radio-dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--primary);
  border-radius: 50%;
}

/* ── Items editor ────────────────────────────────── */
.items-editor { display: flex; flex-direction: column; gap: 12px; }
.item-row {
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}
.item-field { display: flex; flex-direction: column; gap: 4px; }
.item-field > span { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.item-field input, .item-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
}
.item-field input:focus, .item-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.08);
}
.item-delete-col { display: flex; align-items: flex-start; padding-top: 18px; }
.btn-item-delete {
  background: transparent;
  border: 0;
  color: var(--slate-400);
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s var(--ease);
}
.btn-item-delete:hover { background: var(--danger-soft); color: var(--danger); }
.btn-item-add {
  background: var(--white);
  border: 1.5px dashed var(--slate-300);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s var(--ease);
}
.btn-item-add:hover { border-color: var(--primary); color: var(--primary); border-style: solid; background: var(--primary-soft); }
.items-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
}
.item-spacer { margin-top: 4px; }

/* ── Color & font controls ───────────────────────── */
/* Color-scheme picker cards — shared between the wizard step 5 and the editor's
   CULORI accordion. Grid layout/columns are set inline by renderColorSchemesGrid. */
.color-scheme-card {
  min-width: 0;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}
.color-scheme-card:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}
.color-scheme-card.active {
  border-color: var(--primary);
  border-width: 2px;
  padding: 11px;
}
.color-scheme-card .color-circles {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
}
.color-scheme-card .color-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  display: inline-block;
  flex: 0 0 auto;
}
.color-scheme-card .color-scheme-name {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
}
/* Compact variant — used in the narrow editor sidebar. */
.color-schemes-grid.compact .color-scheme-card { padding: 10px; }
.color-schemes-grid.compact .color-scheme-card.active { padding: 9px; }
.color-schemes-grid.compact .color-scheme-card .color-circle { width: 18px; height: 18px; }
.color-schemes-grid.compact .color-scheme-card .color-circles { gap: 4px; }
.color-schemes-grid.compact .color-scheme-card .color-scheme-name { font-size: 12px; }
.color-swatches-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.color-swatch-btn:hover { transform: scale(1.06); }
.color-swatch-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--primary);
}
.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(15,23,42,0.08);
}
.color-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 6px;
}
.color-active-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.color-active-label {
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.color-hex-display {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text-soft);
  background: var(--slate-100);
  padding: 4px 8px;
  border-radius: 4px;
}
.custom-colors { display: flex; gap: 8px; align-items: center; }
.custom-color-pick {
  width: 36px; height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: var(--white);
  cursor: pointer;
}
.color-custom-btn {
  font-size: 12px;
  color: var(--text-soft);
  background: transparent;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}
.color-custom-btn:hover { border-color: var(--primary); color: var(--primary); }

.font-groups { display: flex; flex-direction: column; gap: 14px; }
.font-group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.font-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.font-pill {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.font-pill:hover { border-color: var(--primary); color: var(--primary); }
.font-pill.active { border-color: var(--primary); background: var(--gradient-primary); color: var(--white); }
.typo-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.typo-row-label { font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; }

/* ── Swatches / pills / badges ───────────────────── */
.swatch-group { display: flex; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(15,23,42,0.08); }
.swatch-label { font-size: 12px; color: var(--text-soft); }
.swatch-preview { font-size: 14px; }

/* Color palette picker (step 5) — 4-column grid of pills with color dots
   on the left and a readable label on the right. */
.color-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.color-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s var(--ease);
  min-height: 48px;
}
.color-pill:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99,102,241,0.10);
}
.color-pill.active {
  border-color: var(--primary);
  background: rgba(99,102,241,0.04);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}
.color-pill-dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
  display: inline-block;
}
.color-pill-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  line-height: 1.3;
  text-align: left;
}
@media (max-width: 980px) {
  .color-palette-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .color-palette-grid { grid-template-columns: repeat(2, 1fr); }
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--slate-100);
  color: var(--slate-700);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}
.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
}
/* .pill is also used as a clickable pill (language picker, makePillGroup).
   Needs cursor/transitions and a visible active state — without these the
   click handler runs but the user sees no visual change. */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s var(--ease);
}
.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 600;
}
/* Re-declared here AFTER .pill.active so combined-class elements
   (<div class="pill font-pill active">) keep the gradient font-pill style. */
.font-pill.active { border-color: var(--primary); background: var(--gradient-primary); color: var(--white); }
.pill-group, .bg-pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.bg-pill {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.bg-pill:hover { border-color: var(--primary); color: var(--primary); }
.bg-pill.active { background: var(--gradient-primary); border-color: var(--primary); color: var(--white); }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--slate-100);
  color: var(--slate-700);
}
.site-card-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--slate-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-card-header .template-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--white);
  color: var(--slate-700);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.admin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  background: var(--accent);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 3px;
  vertical-align: middle;
}
.badge-demo { background: var(--primary-soft); color: var(--primary); }
.badge-generated { background: var(--success-soft); color: var(--success); }
.badge-session { background: var(--success-soft); color: var(--success); }
.badge-generating {
  background: var(--warning-soft);
  color: var(--accent);
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--slate-300);
}
.status-dot.active { background: var(--success); }

/* ── Editor (panel + iframe) ─────────────────────── */
.editor-shell {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: calc(100vh - 60px);
}
.editor-panel {
  background: var(--slate-50);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 20px;
}
.editor-frame-wrap {
  background: var(--slate-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
  min-height: calc(100vh - 60px);
}
.editor-frame-outer {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: none;
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: calc(100vh - 100px);
  transition: width 0.25s ease, max-width 0.25s ease;
}
.editor-frame-outer iframe { display: block; width: 100%; height: 100%; min-height: calc(100vh - 100px); border: 0; }
.preview-frame-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 24px;
  min-height: calc(100vh - 100px);
}
.preview-main iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 100px);
  border: 0;
}

.editor-viewport-switcher {
  display: inline-flex;
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 0;
}
.vp-btn {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.vp-btn:hover { color: var(--text); }
.vp-btn.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }

.editor-text-sections { display: flex; flex-direction: column; gap: 8px; }
.editor-collapsible {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.editor-collapsible.open {
  border-left: 3px solid var(--primary);
}
.editor-collapsible-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  background: var(--white);
  border: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-800);
  text-transform: none;
  letter-spacing: 0;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.editor-collapsible-head > * {
  flex: 0 0 auto;
  margin: 0;
  text-align: left;
}
.editor-collapsible-head:hover {
  background: var(--slate-100);
}
.editor-collapsible.open .editor-collapsible-head {
  background: var(--slate-50);
  border-bottom-color: var(--border);
}
.editor-collapsible-head::-webkit-details-marker { display: none; }
.editor-collapsible-title { font-size: 14px; font-weight: 600; color: var(--slate-800); letter-spacing: 0; text-transform: none; }
.editor-collapsible-arrow {
  color: var(--slate-400);
  font-size: 12px;
  transition: transform 0.2s var(--ease);
}
.editor-collapsible.open .editor-collapsible-arrow { color: var(--primary); }
.editor-collapsible-body {
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 14px;
}
.editor-collapsible.open .editor-collapsible-body { display: flex; }
.editor-field { display: flex; flex-direction: column; gap: 6px; }
.editor-field-label { font-size: 12px; font-weight: 600; color: var(--text); }
.editor-field-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.editor-field input, .editor-field textarea, .editor-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: all 0.2s var(--ease);
}
.editor-field input:focus, .editor-field textarea:focus, .editor-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.08);
}
.editor-field textarea { min-height: 70px; resize: vertical; }
.editor-row-label { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.editor-counter { font-size: 11px; color: var(--slate-400); text-align: right; margin-top: 2px; }
.editor-divider { height: 1px; background: var(--border); margin: 10px 0; }
.editor-section-hint {
  font-size: 11px;
  color: var(--text-soft);
  background: var(--slate-50);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--slate-300);
}
.editor-save-btn {
  position: sticky;
  bottom: 0;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-size: 13px;
  background: var(--gradient-primary);
  color: var(--white);
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.editor-save-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.3); }

.editor-regen-banner {
  background: var(--primary-soft);
  border: 1px solid rgba(99,102,241,0.25);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 12px 0;
}
.editor-regen-title { font-size: 14px; font-weight: 700; color: var(--primary); margin: 0 0 4px; }
.editor-regen-hint { font-size: 12px; color: var(--text-soft); margin: 0 0 10px; }
.editor-regen-actions { display: flex; gap: 6px; }

.section-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}
#step-body > .section-header { margin-top: calc(var(--wiz-section-gap) - var(--wiz-row-gap)); }
#step-body > .section-header:first-child { margin-top: 0; }
.section-color-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.section-color-label { font-size: 12px; font-weight: 600; color: var(--text); }

.img-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.img-slot-label { font-size: 11px; font-weight: 600; color: var(--text-soft); }
.img-slot-row { display: flex; gap: 10px; align-items: center; }
.img-slot-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.img-thumb {
  width: 56px;
  height: 56px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.opacity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.opacity-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.opacity-value {
  font-size: 12px;
  font-family: 'SF Mono', Menlo, monospace;
  color: var(--text-soft);
  min-width: 32px;
  text-align: right;
}
.hero-opacity-slot { margin-top: 6px; }

/* ── Stats (admin) ───────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-num {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-label { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--slate-50);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.data-table td { color: #333; }
.data-table tr:last-child td { border-bottom: 0; }

/* ── Dashboard intro cards & demo modal ──────────── */
.dashboard-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0 32px;
}
@media (max-width: 768px) {
  .dashboard-intro-grid { grid-template-columns: 1fr; }
}
.intro-card {
  display: block;
  padding: 24px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.intro-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
}
.intro-card-primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(99, 102, 241, 0.02));
  border-color: rgba(99, 102, 241, 0.3);
}
.intro-card-icon { font-size: 32px; margin-bottom: 12px; }
.intro-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--slate-900); }
.intro-card p { margin: 0 0 16px; font-size: 16px; line-height: 1.6; color: #333; }
.intro-card-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--slate-700);
}
.intro-card-meta li {
  background: var(--slate-100);
  padding: 4px 10px;
  border-radius: 999px;
}
.intro-card-options {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: #333;
}
.intro-card-options li {
  position: relative;
  padding-left: 18px;
}
.intro-card-options li::before {
  content: "›";
  position: absolute;
  left: 6px;
  top: 0;
  color: var(--primary);
  font-weight: 700;
}
.intro-card-options strong {
  color: var(--slate-900);
}
.intro-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 4px;
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  user-select: none;
}
.intro-card-cta::after {
  content: "→";
  transition: transform 0.15s;
}
.intro-card:hover .intro-card-cta::after { transform: translateX(3px); }

.intro-card-btn-primary {
  background: var(--primary);
  color: var(--white);
}
.intro-card-primary:hover .intro-card-btn-primary {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.intro-card-btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 8px 18px;
}
.intro-card-secondary:hover .intro-card-btn-secondary {
  background: var(--primary);
  color: var(--white);
}
.dashboard-empty {
  margin: 16px 0 24px;
  padding: 18px 20px;
  background: var(--slate-50);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-soft);
}

/* Demo modal — class names match what app.js renders:
   .demo-modal-backdrop = full-screen overlay (outer wrapper)
   .demo-modal          = white container (max-width, padding, scrollable)
   .demo-modal-body     = scrollable list of category sections inside
   Previously these were inverted in CSS, causing the overlay not to cover
   the full page. */
.demo-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  animation: demo-fade 0.2s ease;
}
@keyframes demo-fade { from { opacity: 0; } to { opacity: 1; } }
.demo-modal {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: demo-pop 0.25s var(--ease);
}
@keyframes demo-pop {
  from { transform: scale(0.97); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.demo-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--white);
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.demo-modal-head > div:first-child { flex: 1; min-width: 0; }
.demo-modal-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.demo-modal-sub { color: var(--text-soft); font-size: 14px; margin: 0; }
.demo-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.demo-modal-close:hover { background: var(--slate-50); color: var(--text); border-color: var(--slate-300); }

.demo-modal-body { padding: 8px 32px 32px; }
.demo-modal-section { margin-top: 8px; }
.demo-modal-section:first-child { margin-top: 16px; }
/* Group header: line + label + line — gives clear category separators */
.demo-modal-cat {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.demo-modal-cat::before,
.demo-modal-cat::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.demo-modal-section:first-child .demo-modal-cat { margin-top: 8px; }

.demo-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 8px;
}
.demo-modal-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s var(--ease);
}
.demo-modal-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(99,102,241,0.1);
  transform: translateY(-2px);
}
/* Fixed thumb height so cards align perfectly. */
.demo-modal-card-preview {
  position: relative;
  height: 160px;
  background: var(--slate-50);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.demo-modal-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.demo-modal-card-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
}
.demo-modal-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.demo-modal-card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin: 0;
}
.demo-modal-card-cat {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.demo-modal-card-desc {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
  flex: 1;
  margin-bottom: 12px;
}
.demo-modal-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
/* Consistent equal-width buttons — preview outline + use solid indigo. */
.demo-modal-card-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
}
@media (max-width: 760px) {
  .demo-modal-backdrop { padding: 16px 12px; }
  .demo-modal { max-height: 92vh; }
  .demo-modal-head, .demo-modal-body { padding-left: 18px; padding-right: 18px; }
}

/* ── Pricing modal ───────────────────────────────── */
.pricing-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.pricing-dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1080px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.pricing-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--slate-100);
  border: 0;
  color: var(--text-soft);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pricing-close:hover { background: var(--slate-200); color: var(--text); }
.pricing-head { text-align: center; margin-bottom: 24px; }
.pricing-head h2 { font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.pricing-head p { color: var(--text-soft); font-size: 14px; margin: 0; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.pricing-loading, .pricing-error { grid-column: 1 / -1; text-align: center; padding: 36px; color: var(--text-soft); }
.pricing-card {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s var(--ease);
}
.pricing-card:hover { border-color: var(--primary); box-shadow: var(--shadow-colored); }
.pricing-card-feat { border: 2px solid var(--primary); box-shadow: 0 16px 40px rgba(99,102,241,0.15); }
.pricing-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-primary);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pricing-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.pricing-tag { font-size: 13px; color: var(--text-soft); margin: 0; }
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.pricing-price strong {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
}
.pricing-price span { color: var(--text-soft); font-size: 13px; }
.pricing-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  font-size: 13px;
}
.pricing-features li { line-height: 1.4; }
.pricing-feat-yes::first-letter { color: var(--success); font-weight: 800; }
.pricing-feat-no { color: var(--slate-400); }
.pricing-feat-no::first-letter { color: var(--slate-300); font-weight: 800; }
.pricing-ideal {
  background: var(--slate-50);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-soft);
}
.pricing-ideal strong { color: var(--text); }
.pricing-domain {
  background: var(--slate-50);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.pricing-domain label { display: block; font-size: 11px; color: var(--text-soft); margin-bottom: 4px; }
.pricing-domain-row { display: flex; gap: 6px; }
.pricing-domain-row input {
  flex: 1; min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
}
.pricing-domain-row input:focus { outline: none; border-color: var(--primary); }
.pricing-domain-row select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--white);
}
.pricing-cta {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.pricing-cta:hover { border-color: var(--primary); color: var(--primary); }
.pricing-cta:disabled { opacity: 0.6; cursor: wait; }
.pricing-cta-feat {
  background: var(--gradient-primary);
  color: var(--white);
  border-color: transparent;
}
.pricing-cta-feat:hover { color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.3); }
.pricing-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
}

/* ── Recommendations / group sections ────────────── */
.group-line { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; }
.group-name {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rec-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.rec-label {
  font-size: 12px;
  color: var(--text-soft);
  background: var(--slate-50);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 2px solid var(--slate-300);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--wiz-col-gap); align-items: start; }

/* ── Toast notifications ─────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
#toast-container > div {
  pointer-events: all;
  background: var(--gradient-primary);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  max-width: 340px;
  animation: toast-in 0.25s var(--ease);
}
#toast-container > div.success { background: var(--gradient-primary); }
#toast-container > div.error { background: var(--danger); }
#toast-container > div.info { background: var(--gradient-primary); }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Generation banner (sticky top) ──────────────── */
.generation-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: var(--gradient-primary);
  color: var(--white);
  padding: 12px 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.25);
}
/* `display: flex` above would otherwise win over the [hidden] attribute's UA
   default of display:none. Adding this rule (higher specificity than the
   class-only one) makes hideGenerationBanner()'s `banner.hidden = true` work. */
.generation-banner[hidden] { display: none; }
body.has-generation-banner { padding-top: 46px; }
body.has-generation-banner .topbar { top: 46px; }

/* ── Loading overlay ─────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 980px) {
  .sites-grid { grid-template-columns: repeat(2, 1fr); }
  .builder { grid-template-columns: 1fr; }
  .builder-steps {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  .builder-step { min-width: 200px; flex-shrink: 0; }
  .editor-shell { grid-template-columns: 1fr; }
  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 50vh;
  }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: 1fr; }
  .demo-modal-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; max-width: 460px; margin-left: auto; margin-right: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .sites-grid { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .demo-modal-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
  .otp-inputs input { width: 42px; height: 50px; font-size: 20px; }
  .dashboard-head { flex-direction: column; align-items: flex-start; }
  .builder-content { padding: 22px 18px; }
  .pricing-dialog { padding: 24px 18px; }
}

/* ── App footer (global, sticky-to-bottom) ───────── */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#app { flex: 1 0 auto; }

.app-footer {
  flex-shrink: 0;
  background: var(--slate-900);
  color: var(--slate-300);
  margin-top: 48px;
  font-size: 14px;
  line-height: 1.6;
}
body.editor-mode .app-footer,
body.preview-mode .app-footer,
body.builder-mode .app-footer { display: none; }

/* "Salvează tot" — appears in editor top-bar only when state.editorDirty has
   entries. Orange / accent to stand out from the regular dashboard button. */
.save-all-btn {
  background: var(--accent, #e8571a);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: save-all-pulse 2s ease-in-out infinite;
}
/* `display: inline-flex` above would otherwise win over the [hidden] attribute
   (UA default display:none). Higher-specificity rule keeps the button hidden
   when updateSaveAllButton() flips state.editorDirty.size to 0. */
.save-all-btn[hidden] { display: none !important; }
.save-all-btn:hover:not(:disabled) {
  background: var(--accent-hover, #c94510);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(232,87,26,0.4);
}
.save-all-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 100px;
  background: rgba(255,255,255,0.25);
  font-size: 11px;
  font-weight: 700;
}
@keyframes save-all-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(232,87,26,0.3); }
  50% { box-shadow: 0 4px 20px rgba(232,87,26,0.55); }
}
/* Unsaved-changes warning — red border, pink-tinted header, and a "Nesalvat"
   badge next to the title. The .dirty rule lands AFTER the .open border so
   the red wins even on an expanded section that still has pending edits. */
.editor-collapsible.dirty {
  border-left: 3px solid var(--danger, #dc2626);
}
.editor-collapsible.dirty .editor-collapsible-head {
  background: rgba(220, 38, 38, 0.05);
}
.editor-collapsible.dirty .editor-collapsible-head:hover {
  background: rgba(220, 38, 38, 0.09);
}
.editor-collapsible.dirty .editor-collapsible-title {
  color: var(--danger, #dc2626);
}
.editor-collapsible.dirty .editor-collapsible-title::after {
  content: "● Nesalvat";
  color: var(--danger, #dc2626);
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.editor-collapsible.dirty.open {
  border-left-color: var(--danger, #dc2626);
}

.app-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 768px) {
  .app-footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .app-footer-brand-col { grid-column: 1 / -1; }
}

.app-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 16px;
  color: var(--white);
}
.app-footer-logo { width: 28px; height: 28px; }
.app-footer-tagline { margin: 0 0 16px; color: var(--slate-400); }
.app-footer-hosting {
  margin: 0;
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}
.app-footer-hosting strong { color: var(--white); }
.app-footer-hosting a {
  color: #a5b4fc;
  font-weight: 600;
  text-decoration: none;
}
.app-footer-hosting a:hover { text-decoration: underline; }
.app-footer-hosting .nowrap { white-space: nowrap; }

.app-footer-col h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
}
.app-footer-col > a {
  display: block;
  padding: 4px 0;
  color: var(--slate-400);
  text-decoration: none;
  transition: color 0.15s;
}
.app-footer-col > a:hover { color: var(--white); }

.app-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--slate-500);
}
@media (max-width: 600px) {
  .app-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
.app-footer-meta { display: inline-flex; align-items: center; gap: 6px; }
.app-footer-version { color: var(--slate-500); }

.status-dot-ok {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
