/* SwiftForms — shared styles. Plain CSS, no framework. */
:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --brand: #5b5bd6;
  --brand-dark: #4646b8;
  --brand-soft: #eef2ff;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 16px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* --- header / nav --- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.logo span { color: var(--brand); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); font-size: 15px; }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav .btn { color: #fff; }

/* --- buttons --- */
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-size: 15px;
  font-weight: 600; padding: 11px 20px; border-radius: 10px;
  background: var(--brand); color: #fff; text-align: center;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f3f4f6; }
.btn.small { padding: 7px 13px; font-size: 14px; border-radius: 8px; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #991b1b; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* --- hero / landing --- */
.hero { padding: 72px 0 56px; text-align: center; background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%); }
.hero h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -.03em; margin-bottom: 16px; }
.hero p.lede { font-size: 19px; color: #374151; max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--muted); }
.section { padding: 56px 0; }
.section h2 { font-size: 30px; letter-spacing: -.02em; text-align: center; margin-bottom: 8px; }
.section .sub { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 36px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { font-size: 18px; margin-bottom: 6px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card .icon { font-size: 26px; margin-bottom: 10px; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step b.num {
  display: inline-flex; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  align-items: center; justify-content: center; margin-bottom: 12px;
}

/* --- pricing --- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 760px; margin: 0 auto; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.price-card.featured { border: 2px solid var(--brand); position: relative; }
.price-card .tag {
  position: absolute; top: -13px; left: 24px; background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.price { font-size: 44px; font-weight: 800; letter-spacing: -.03em; }
.price small { font-size: 16px; font-weight: 500; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 18px 0; }
.checklist li { padding: 5px 0 5px 28px; position: relative; font-size: 15px; }
.checklist li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 800; }
.checklist li.no { color: var(--muted); }
.checklist li.no::before { content: "–"; color: var(--muted); }
.compare { font-size: 14px; color: var(--muted); text-align: center; margin-top: 20px; }

/* --- forms (inputs) --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="date"], textarea, select {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 13px;
  border: 1px solid #d1d5db; border-radius: 9px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.error { color: var(--red); font-size: 14px; margin: 8px 0; }
.ok-msg { color: var(--green); font-size: 14px; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* --- app layout --- */
.app-shell { display: grid; grid-template-columns: 230px 1fr; gap: 0; min-height: calc(100vh - 60px); }
.sidebar { border-right: 1px solid var(--line); background: #fff; padding: 20px 14px; }
.sidebar a.side-link {
  display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-size: 15px;
}
.sidebar a.side-link:hover { background: #f3f4f6; text-decoration: none; }
.sidebar a.side-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sidebar .side-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 12px 6px; }
.main { padding: 28px 28px 60px; min-width: 0; }
.main h1 { font-size: 26px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 20px; }
.toolbar .spacer { flex: 1; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
.table th { background: #f9fafb; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.grey { background: #f3f4f6; color: var(--muted); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); }

/* --- builder --- */
.builder-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.q-card .q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.q-card .q-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); background: var(--brand-soft); padding: 3px 8px; border-radius: 6px; }
.q-card .q-actions { margin-left: auto; display: flex; gap: 4px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 9px; cursor: pointer; font-size: 14px; }
.icon-btn:hover { background: #f3f4f6; }
.icon-btn.danger { color: var(--red); }
.type-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-palette button {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 10px;
  cursor: pointer; font: inherit; font-size: 14px; text-align: left;
}
.type-palette button:hover { border-color: var(--brand); background: var(--brand-soft); }
pre.snippet {
  background: #111827; color: #e5e7eb; padding: 14px; border-radius: 10px;
  font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600;
  padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* --- public form (one question at a time) --- */
.form-stage { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.progress { height: 4px; background: #e5e7eb; }
.progress > div { height: 100%; background: var(--brand); transition: width .3s ease; }
.form-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 20px 60px; }
.form-inner { width: 100%; max-width: 640px; }
.form-inner .q-num { color: var(--brand); font-weight: 700; font-size: 14px; }
.form-inner h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -.02em; margin: 8px 0 10px; }
.form-inner .q-help { color: var(--muted); margin-bottom: 20px; }
.form-inner .req { color: var(--red); font-size: 13px; }
.answer-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.answer-row input, .answer-row select, .answer-row textarea { flex: 1; min-width: 220px; font-size: 17px; padding: 13px 15px; }
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid #d1d5db; background: #fff; border-radius: 10px; padding: 13px 15px;
  font: inherit; font-size: 16px; cursor: pointer;
}
.choice:hover { border-color: var(--brand); }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.choice .key {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid #d1d5db;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); flex-shrink: 0;
}
.choice.selected .key { background: var(--brand); color: #fff; border-color: var(--brand); }
.stars { display: flex; gap: 6px; }
.stars button { border: 0; background: none; font-size: 40px; cursor: pointer; color: #d1d5db; padding: 0 2px; line-height: 1; }
.stars button.lit { color: #f59e0b; }
.yn-row { display: flex; gap: 10px; }
.yn-row .choice { width: auto; flex: 1; justify-content: center; font-weight: 600; }
.form-nav { display: flex; gap: 10px; margin-top: 24px; align-items: center; }
.form-nav .spacer { flex: 1; }
.form-foot { text-align: center; padding: 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.form-foot a { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* --- auth --- */
.auth-card { max-width: 440px; margin: 60px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.divider { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0; position: relative; }
.divider::before, .divider::after { content: ""; display: inline-block; width: 38%; height: 1px; background: var(--line); vertical-align: middle; margin: 0 8px; }

/* --- footer --- */
.footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; background: #fff; }
.footer-inner { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer .spacer { flex: 1; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--muted); }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; gap: 4px; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .side-label { display: none; }
  .sidebar a.side-link { white-space: nowrap; }
  .builder-grid { grid-template-columns: 1fr; }
  .nav .hide-m { display: none; }
  .main { padding: 20px 16px 48px; }
}
