:root {
  --bg-1: #0f172a;
  --bg-2: #1e293b;
  --card: #16213a;
  --card-2: #101b33;
  --line: #334155;
  --line-soft: #26334a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #2563eb;
  --blue-soft: #bfdbfe;
  --green: #22c55e;
  --green-dark: #052e16;
  --yellow: #eab308;
  --red: #ef4444;
}

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

html {
  background: linear-gradient(150deg, var(--bg-1) 0%, #14224e 100%) fixed;
  min-height: 100%;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: -0.02em; }
button { font-family: inherit; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 34px 24px 80px; }

/* ---------------- brand bar ---------------- */
.brand {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 34px;
}
.brand-left { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex-shrink: 0; }
.wordmark {
  font-weight: 700; font-size: 16px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text); white-space: nowrap;
}
.wordmark em { font-style: normal; color: var(--green); }
.brand-tool {
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 500; white-space: nowrap;
}
.badge-gold {
  font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700; color: var(--yellow);
  border: 1px solid #eab30866; background: #eab30818;
  border-radius: 999px; padding: 6px 14px; white-space: nowrap;
}

/* ---------------- gate ---------------- */
.gate-hero { max-width: 620px; margin: 40px auto 0; text-align: center; animation: rise .5s ease both; }
.gate-hero .lock {
  width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 20px;
  background: linear-gradient(145deg, #1e3a8a66, #22c55e22);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.gate-hero h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 700; line-height: 1.12; margin-bottom: 14px; }
.gate-hero h1 em { font-style: normal; color: var(--green); }
.gate-hero .sub { color: var(--muted); font-size: 17.5px; font-weight: 300; line-height: 1.6; margin-bottom: 30px; }

.gate-form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; }
.gate-form input {
  flex: 1; padding: 15px 18px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 16px;
  outline: none; text-align: center; letter-spacing: 2px;
}
.gate-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px #22c55e22; }
.gate-form button {
  padding: 15px 26px; border-radius: 13px; border: none; background: var(--green);
  color: var(--green-dark); font-weight: 700; font-size: 16px; cursor: pointer;
  transition: transform .1s;
}
.gate-form button:hover { transform: scale(1.03); }
.gate-form button:disabled { opacity: .55; cursor: wait; }
.gate-error { color: var(--red); margin-top: 14px; font-size: 14.5px; min-height: 20px; }
.gate-hint { color: var(--muted); font-size: 13.5px; margin-top: 18px; font-weight: 300; }

.gate-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 860px; margin: 56px auto 0; }
@media (max-width: 720px) { .gate-steps { grid-template-columns: 1fr; } }
.gate-step {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 20px; text-align: left;
}
.gate-step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 10px; background: #2563eb33;
  color: var(--blue-soft); font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.gate-step h3 { font-size: 16px; margin-bottom: 6px; }
.gate-step p { color: var(--muted); font-size: 13.5px; line-height: 1.55; font-weight: 300; }

.gate-cta { text-align: center; margin-top: 54px; }
.gate-cta p { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.cta-skool {
  display: inline-block; padding: 15px 36px; border-radius: 13px;
  background: var(--green); color: var(--green-dark); font-weight: 700; text-decoration: none;
  font-size: 17px; transition: transform .12s;
}
.cta-skool:hover { transform: scale(1.04); }

/* ---------------- builder layout ---------------- */
.builder { display: grid; grid-template-columns: minmax(400px, 520px) 1fr; gap: 28px; align-items: start; }
@media (max-width: 1020px) { .builder { grid-template-columns: 1fr; } }

.pane-left { min-width: 0; }
.pane-right { min-width: 0; position: sticky; top: 24px; }
@media (max-width: 1020px) {
  .pane-right { position: static; order: -1; }
  .pane-right.collapsed .browser { display: none; }
}

/* step rail */
.rail { display: flex; gap: 6px; margin-bottom: 22px; }
.rail-step {
  flex: 1; background: none; border: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: var(--muted); font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  font-weight: 600;
}
.rail-step .bar {
  width: 100%; height: 4px; border-radius: 3px; background: var(--line-soft);
  transition: background .25s;
}
.rail-step.done .bar { background: var(--green); }
.rail-step.current .bar { background: var(--blue); }
.rail-step.current { color: var(--text); }
.rail-step.done { color: var(--green); }
.rail-step:disabled { cursor: default; }
.rail-step .lbl { white-space: nowrap; }
@media (max-width: 560px) { .rail-step .lbl { display: none; } }

/* step card — light surface for legibility inside the dark shell.
   Re-scopes the theme variables so every control inside inherits light values. */
.step-card {
  --bg-1: #f1f5f9;      /* input + tile backgrounds */
  --card: #ffffff;
  --line: #d8e0ea;
  --line-soft: #e2e8f0;
  --text: #0f172a;
  --muted: #5b6b81;
  --blue-soft: #1d4ed8;  /* links/kickers need a darker blue on white */
  --green: #16a34a;
  --red: #dc2626;
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 18px;
  padding: 28px; color: var(--text); animation: rise .35s ease both;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .45);
}
.step-card input, .step-card textarea, .step-card select { color: var(--text); }
.step-card .note { color: #1e3a8a; }
.step-card .note.ok { color: #14532d; }
.step-card .note.warn { background: #fef9c3; border-color: #fde047; color: #713f12; }
.step-card .chip { color: #1e3a8a; }
.step-card .codebox textarea { border-color: #0a1122; } /* keep the code block dark */
.step-card .valid-msg.ok { color: #15803d; }
.step-card .btn-ghost { color: #475569; border-color: #cbd5e1; }
.step-card .btn-ghost:hover { color: var(--text); border-color: #94a3b8; }
.step-card .btn-sm { background: #ffffff; border-color: #cbd5e1; }
.step-card .btn-sm:hover { border-color: var(--blue); color: var(--blue); }
.step-card .dropzone:hover, .step-card .dropzone.drag { background: #eff6ff; color: #1d4ed8; }
.step-card .link-card { background: #f0fdf4; }
.step-card .thumb button { background: rgba(15, 23, 42, .65); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }
.step-kicker {
  font-size: 11.5px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--blue-soft); font-weight: 700; margin-bottom: 8px;
}
.step-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.step-card .hint { color: var(--muted); font-size: 14.5px; font-weight: 300; line-height: 1.55; margin-bottom: 22px; }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px; font-weight: 600;
}
.field label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: #64748b; }
.field input[type="text"], .field input[type="url"], .field input[type="email"], .field input[type="tel"], .field textarea, .field select {
  width: 100%; padding: 13px 15px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-1);
  color: var(--text); font-family: inherit; font-size: 15px; outline: none;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.field textarea { min-height: 110px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* color field */
.color-field { display: flex; align-items: center; gap: 12px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.color-field input[type="color"] {
  width: 46px; height: 38px; border: none; background: none; cursor: pointer; padding: 0;
}
.color-field .hex { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* chips */
.chip-add { display: flex; gap: 10px; }
.chip-add input {
  flex: 1; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-1); color: var(--text); font-family: inherit; font-size: 15px; outline: none;
}
.chip-add input:focus { border-color: var(--blue); }
.chip-add button {
  padding: 13px 22px; border-radius: 12px; border: none; background: var(--blue);
  color: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
}
.chip-add button:hover { background: #1e40af; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #2563eb26; border: 1px solid #2563eb55; border-radius: 999px;
  padding: 8px 8px 8px 16px; font-size: 14.5px; font-weight: 500;
  animation: pop .18s ease both;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.chip button {
  width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
  background: #2563eb44; color: var(--blue-soft); font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.chip button:hover { background: var(--red); color: #fff; }
.count-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.count-note.bad { color: var(--red); }

/* buttons */
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; }
.btn-primary {
  padding: 14px 28px; border-radius: 12px; border: none; background: var(--blue);
  color: #fff; font-weight: 600; font-size: 15.5px; cursor: pointer; transition: transform .1s, background .2s;
}
.btn-primary:hover { background: #1e40af; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost {
  padding: 14px 22px; border-radius: 12px; border: 1px solid var(--line); background: none;
  color: var(--muted); font-weight: 500; font-size: 15px; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-green {
  padding: 16px 34px; border-radius: 13px; border: none; background: var(--green);
  color: var(--green-dark); font-weight: 700; font-size: 16.5px; cursor: pointer;
  transition: transform .1s;
}
.btn-green:hover { transform: scale(1.02); }
.btn-green:disabled { opacity: .5; cursor: wait; transform: none; }
.btn-sm {
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-1);
  color: var(--text); font-weight: 500; font-size: 13.5px; cursor: pointer;
}
.btn-sm:hover { border-color: var(--blue); color: var(--blue-soft); }

/* notes */
.note {
  background: #2563eb1a; border: 1px solid #2563eb44; border-radius: 12px;
  padding: 14px 16px; font-size: 14px; line-height: 1.55; margin: 16px 0; color: #dbeafe;
}
.note.ok { background: #22c55e14; border-color: #22c55e44; color: #dcfce7; }
.note.warn { background: #eab3081a; border-color: #eab30844; color: #fef9c3; }
.note strong { font-weight: 600; }
.note .btn-sm { margin-top: 10px; }

/* GPT block */
.codebox { position: relative; margin-top: 6px; }
.codebox textarea {
  width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px;
  min-height: 170px; background: #0a1122; color: #cfe3ff;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; resize: vertical; outline: none;
}
.codebox .copy-btn {
  position: absolute; top: 10px; right: 10px;
  padding: 7px 14px; border-radius: 8px; border: none; background: var(--blue);
  color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.valid-msg { margin-top: 12px; font-size: 14px; line-height: 1.5; }
.valid-msg.ok { color: var(--green); }
.valid-msg.bad { color: var(--red); }

/* dropzones + thumbs */
.dropzone {
  border: 2px dashed var(--line); border-radius: 14px; padding: 26px 18px;
  text-align: center; color: var(--muted); cursor: pointer; font-size: 14.5px;
  transition: border-color .15s, background .15s; background: var(--bg-1);
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: #2563eb12; color: var(--blue-soft); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.thumb {
  position: relative; width: 96px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); animation: pop .18s ease both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.hero-thumb { width: 100%; max-width: 300px; height: 120px; }
.thumb button {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: rgba(15,23,42,.85); color: #fff;
  cursor: pointer; font-size: 12px; line-height: 1;
}
.thumb button:hover { background: var(--red); }

/* radio option cards */
.opt-cards { display: grid; gap: 10px; margin: 14px 0; }
.opt-card {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; color: var(--text); font-size: 14.5px; width: 100%;
}
.opt-card.selected { border-color: var(--green); background: #22c55e10; }
.opt-card .dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line);
  flex-shrink: 0; margin-top: 1px;
}
.opt-card.selected .dot { border-color: var(--green); background: radial-gradient(circle at center, var(--green) 45%, transparent 50%); }
.opt-card .oc-title { font-weight: 600; display: block; margin-bottom: 3px; }
.opt-card .oc-sub { color: var(--muted); font-size: 13px; font-weight: 300; line-height: 1.5; }

/* ---------------- live preview pane ---------------- */
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.preview-title { display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { box-shadow: 0 0 0 0 #22c55e77; } 55% { box-shadow: 0 0 0 7px #22c55e00; } }
.preview-ctl { display: flex; gap: 8px; align-items: center; }
.device-toggle { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.device-toggle button {
  padding: 8px 14px; border: none; background: none; color: var(--muted);
  font-size: 13px; cursor: pointer; font-weight: 500;
}
.device-toggle button.active { background: var(--blue); color: #fff; }

.browser {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: 0 30px 80px rgba(2,6,23,.55);
}
.browser-bar {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft); background: #0d1730;
}
.traffic { display: flex; gap: 6px; }
.traffic span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.traffic .t1 { background: #f87171; } .traffic .t2 { background: #fbbf24; } .traffic .t3 { background: #34d399; }
.urlbar {
  flex: 1; background: var(--bg-1); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 7px 13px; font-size: 12.5px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.urlbar em { font-style: normal; color: var(--blue-soft); }
.browser-home {
  border: none; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px;
}
.browser-home:hover { color: var(--text); }

.frame-wrap { background: #cbd5e1; display: flex; justify-content: center; transition: padding .25s; }
.frame-wrap iframe {
  width: 100%; height: min(72vh, 780px); border: none; background: #fff; display: block;
  transition: width .25s;
}
.frame-wrap.mobile { padding: 18px 0; background: #94a3b8; }
.frame-wrap.mobile iframe { width: 390px; border-radius: 18px; box-shadow: 0 18px 50px rgba(2,6,23,.4); }

.preview-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; font-weight: 300; text-align: center; }
.preview-toggle-mobile { display: none; }
@media (max-width: 1020px) {
  .preview-toggle-mobile {
    display: block; width: 100%; margin-bottom: 14px;
    padding: 12px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .frame-wrap iframe { height: 54vh; }
}

/* ---------------- launch / success ---------------- */
.success { text-align: center; padding: 8px 0 4px; }
.success .big-check {
  width: 76px; height: 76px; margin: 6px auto 20px; border-radius: 50%;
  background: #22c55e22; border: 2px solid var(--green); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  animation: pop .35s cubic-bezier(.34,1.56,.64,1) both;
}
.success h2 { font-size: 26px; margin-bottom: 8px; }
.success .sub { color: var(--muted); font-size: 15px; font-weight: 300; margin-bottom: 22px; }
.link-card {
  display: flex; gap: 10px; align-items: center; background: var(--bg-1);
  border: 1px solid var(--green); border-radius: 13px; padding: 12px 14px; margin-bottom: 14px;
}
.link-card input {
  flex: 1; background: none; border: none; color: var(--blue-soft); font-family: inherit;
  font-size: 14px; outline: none; min-width: 0;
}
.link-card button {
  padding: 10px 18px; border-radius: 9px; border: none; background: var(--green);
  color: var(--green-dark); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.dl-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 4px; }
.stat-tile { background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; }
.stat-tile .v { font-size: 22px; font-weight: 700; color: var(--green); }
.stat-tile .l { font-size: 11.5px; color: var(--muted); margin-top: 4px; letter-spacing: .5px; text-transform: uppercase; }

.spinner {
  width: 18px; height: 18px; border: 2.5px solid #052e1655; border-top-color: var(--green-dark);
  border-radius: 50%; display: inline-block; vertical-align: -4px; margin-right: 9px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 60px; font-weight: 300; }
.foot a { color: var(--blue-soft); text-decoration: none; }
