/* LaunchLogic sales floor — PHONE-FIRST stylesheet (Stage 4).
   Base rules are the phone layout (~360–430px): single column, full-width
   tap targets (>=48px), 16px form text (prevents focus-zoom on phones).
   Wider layouts are layered on with min-width media queries only:
   >=720px relaxes spacing, >=1024px (desktop, e.g. 1280px) goes two-column.
   No fixed pixel widths on layout containers — everything is fluid (%,
   rem, min()) so nothing can overflow a phone viewport horizontally.

   Stage 8 (gospel alignment, GUIDEBOOK.md §6): the visual system now
   follows the owner's own Enterprise homepage evidence — deep navy
   #0b1020 background, white primary text, gray support text, cyan
   #22d3ee accent, white/10 borders, a subtle cyan radial glow, generous
   spacing, and rounded-2xl (16px) buttons: filled cyan primary,
   outlined secondary. Type is Arial, per his global stylesheet. No
   gimmicky AI visuals, no excessive animation. Green/amber/red survive
   only as build-status colors (done / working / failed), never as the
   brand accent. */

:root {
  --bg: #0b1020;
  --panel: #0e1730;
  --panel-border: rgba(255, 255, 255, 0.1);
  --field-bg: #0b1020;
  --field-border: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: #d1d5db;
  --accent: #22d3ee;
  --accent-dark: #083344;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 90% 55% at 50% -10%, rgba(34, 211, 238, 0.13), rgba(34, 211, 238, 0) 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- header (stacked + centered on phone; his hero treatment) ---------- */
.header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--panel-border);
}
.brand { text-align: center; }
.header h1 { margin: 0; font-size: 2rem; color: #fff; }
.tagline { margin: 8px auto 0; color: var(--muted); max-width: 640px; }
.account-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  border: 1px solid var(--field-border);
  color: var(--text);
}
.pill-free { background: rgba(255, 255, 255, 0.06); }
.pill-pro { background: var(--accent); color: var(--accent-dark); border-color: var(--accent); }

/* ---------- layout (single column on phone) ---------- */
.main { flex: 1; width: 100%; padding: 28px 0; }
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 20px;
  min-width: 0;
}
.panel h2 { margin: 0 0 12px; color: #fff; font-size: 1.25rem; }
.subheading { margin: 20px 0 10px; color: #fff; font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
code { overflow-wrap: anywhere; }

/* ---------- forms (phone-first) ---------- */
.field-label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
  font-size: 0.9375rem;
}
input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
}
textarea { min-height: 180px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; resize: vertical; }
input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }

/* ---------- buttons: >=48px tall, rounded-2xl (16px), full-width rows on phone ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
}
.btn:hover { opacity: 0.95; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-dark); }
.btn-secondary { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.4); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--field-border); }
.btn-block { width: 100%; margin-top: 16px; }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.actions .btn { width: 100%; }

/* ---------- auth tabs ---------- */
.tabs { display: flex; gap: 8px; margin: 8px 0 4px; }
.tab {
  flex: 1;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.tab-active { background: var(--accent); color: var(--accent-dark); border-color: var(--accent); }

/* ---------- status / subscription ---------- */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--panel-border);
}
.status-label { color: var(--muted); }
.status-value { font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.message { min-height: 1.5em; margin: 12px 0 0; overflow-wrap: anywhere; }
.message-error { color: #fca5a5; }

/* ---------- model editor ---------- */
.models { display: flex; flex-direction: column; gap: 14px; }
.model-card {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}
.model-head { display: flex; flex-direction: column; gap: 8px; }
.model-head .actions { margin-top: 4px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px dashed var(--panel-border);
}
.field-row .req-label { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; }

.spec-details { margin-top: 20px; }
.spec-details summary { cursor: pointer; font-weight: 700; padding: 10px 0; }

/* ---------- jobs ---------- */
.jobs-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.job-item {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.job-item .job-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.job-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8125rem; overflow-wrap: anywhere; }
.job-status { font-weight: 800; }
.job-status-completed { color: var(--green); }
.job-status-failed { color: var(--red); }
.job-status-pending, .job-status-generating { color: var(--amber); }
.current-job { margin-bottom: 8px; }

.footer { padding: 20px 0 28px; border-top: 1px solid var(--panel-border); color: #9ca3af; font-size: 0.875rem; }

.hidden { display: none !important; }

/* ---------- >=720px: breathing room, horizontal action rows ---------- */
@media (min-width: 720px) {
  .shell { padding: 0 24px; }
  .panel { padding: 28px; }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions .btn { width: auto; flex: 1 1 auto; }
  .model-head { flex-direction: row; align-items: flex-end; }
  .model-head > * { flex: 1; }
  .field-row { grid-template-columns: 2fr 1fr auto auto; align-items: end; }
}

/* ---------- >=1024px: desktop two-column (covers 1280px) ---------- */
@media (min-width: 1024px) {
  .header { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .brand { text-align: left; }
  .tagline { margin: 8px 0 0; }
  .account-bar { justify-content: flex-start; }
  .grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .header h1 { font-size: 2.25rem; }
}

/* ---------- Stage 6: guided steps + plain-language helpers ---------- */
.steps { margin-bottom: 20px; }
.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  min-width: 0;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 800;
  flex: 0 0 auto;
}
.step-current { color: #fff; border-color: var(--accent); background: rgba(34, 211, 238, 0.12); }
.step-current .step-num { background: var(--accent); color: var(--accent-dark); }
.step-done { color: var(--text); border-color: var(--green); }
.step-done .step-num { background: var(--green); color: #052e12; }

.helper { color: var(--muted); font-size: 0.9375rem; margin: 10px 0 0; }
.plan-list { margin: 8px 0 4px; padding-left: 20px; color: var(--muted); }
.plan-list li { margin: 6px 0; }
.plan-list strong { color: var(--text); }

.check-group { display: flex; flex-direction: column; gap: 8px; }
.check-group .req-label { display: flex; align-items: flex-start; gap: 8px; font-size: 0.9375rem; }
.models-intro { margin-top: 0; }

@media (min-width: 720px) {
  .steps-list { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ---------- Stage 7: layout gallery + options (Stage 8: profiles) ---------- */
.layout-gallery { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.layout-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  text-align: left;
}
.layout-card:hover { opacity: 0.95; }
.layout-card-title { font-weight: 800; color: #fff; }
.layout-card-tag { color: var(--muted); font-size: 0.9375rem; }
.layout-card-keeps { font-size: 0.875rem; }
.layout-selected { border-color: var(--accent); background: rgba(34, 211, 238, 0.1); }
.layout-options { display: flex; flex-direction: column; }
.option-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 48px;
  padding: 10px 0;
  cursor: pointer;
  border-top: 1px dashed var(--panel-border);
}
.option-row strong { display: block; }
.option-help { display: block; color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 720px) {
  .layout-gallery { grid-template-columns: 1fr 1fr; }
}

/* ---------- Stage 14: landing hero + trust pages ---------- */
.panel a:not(.btn), .footer a { color: var(--accent); }
.hero h2 { font-size: 1.75rem; line-height: 1.25; }
.hero .actions { margin-top: 20px; }
#firstRunNote {
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--text);
}
.legal h1 { font-size: 1.75rem; margin: 0 0 6px; }
.legal h2 { font-size: 1.125rem; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--text); }
.legal ul, .legal ol { margin: 8px 0 8px 20px; padding: 0; }
.legal li { margin: 6px 0; }
.legal .backlink { display: inline-block; margin-bottom: 16px; }

/* Stage 13: dashboard (P7) surfaces */
#dashboardPanel h3 { margin: 22px 0 8px; font-size: 17px; }
.runtime-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 12px;
  background: rgba(255, 255, 255, 0.03);
}
.runtime-card .runtime-title { font-weight: 700; margin: 0 0 4px; }
.runtime-card p { margin: 0 0 6px; }
.p7-activity { list-style: none; margin: 0; padding: 0; }
.p7-activity li {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14.5px;
}
.p7-activity li:last-child { border-bottom: none; }

/* Stage 16 Part A: "Make it yours" appearance controls */
.bundle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 8px 0 18px; }
.bundle-card {
  text-align: left; cursor: pointer; color: inherit;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 12px 14px; font: inherit;
}
.bundle-card:hover { border-color: var(--accent); }
.bundle-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bundle-card-title { display: block; font-weight: 700; margin-bottom: 4px; }
.bundle-card-help { display: block; font-size: 13.5px; opacity: 0.75; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.swatch {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.25); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.swatch:hover { border-color: var(--accent); }
.swatch-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mode-row { display: flex; gap: 10px; margin: 8px 0 18px; }
.mode-btn {
  cursor: pointer; color: inherit; font: inherit;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border); border-radius: 999px;
  padding: 8px 18px;
}
.mode-btn:hover { border-color: var(--accent); }
.mode-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
