/* style.css — MultiAgent Brainstorm (Cloud API Token 100% BYOK web app) */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2330;
  --border: #2b3648;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #4f8cff;
  --accent-2: #7ee2b8;
  --danger: #ff6b6b;
  --warn: #ffd166;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", Roboto, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.topbar { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #131a26, #0d1117); }
.topbar .wrap { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 18px; flex-wrap: wrap; }
.brand h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: 0.2px; }
.subtitle { margin: 0; color: var(--accent-2); font-weight: 600; max-width: 640px; font-size: 14px; }
.lang-switch { display: flex; gap: 6px; }
.lang-btn { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.lang-btn.active { color: #fff; border-color: var(--accent); background: rgba(79, 140, 255, 0.18); }

/* ---------- panels ---------- */
main { padding: 22px 0 40px; display: grid; gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; max-width: 720px; }

/* ---------- provider cards ---------- */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.provider-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.provider-card.ready { border-color: var(--accent-2); }
.provider-card.custom-card { grid-column: span 1; }
.provider-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.provider-name { font-weight: 700; }
.ready-dot { font-size: 12px; color: var(--muted); }
.provider-card.ready .ready-dot { color: var(--accent-2); }
.field { display: block; margin: 8px 0 0; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; letter-spacing: 0.3px; }
.input {
  width: 100%; background: #0b0f16; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px;
}
.input:focus { outline: none; border-color: var(--accent); }
.textarea { resize: vertical; font-family: inherit; }
.select { max-width: 420px; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- buttons / status ---------- */
.run-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.status { color: var(--muted); font-size: 13px; }
.cost { font-size: 14px; font-weight: 700; color: var(--accent-2); }
.fatal {
  background: rgba(255, 107, 107, 0.12); border: 1px solid var(--danger);
  color: #ffb3b3; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px;
}
.hidden { display: none; }

/* ---------- phase cards ---------- */
.phases { display: grid; gap: 12px; }
.phase { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; opacity: 0.72; transition: opacity 0.2s, border-color 0.2s; }
.phase.active { opacity: 1; border-color: var(--accent); }
.phase.done { opacity: 1; border-color: var(--accent-2); }
.phase.outdated { opacity: 1; border-color: #d4a017; }
.phase.outdated .phase-state { color: #d4a017; }
.supp-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.supp-count { font-size: 12px; color: var(--muted); white-space: nowrap; padding-bottom: 8px; }
.phase header { display: flex; align-items: center; gap: 10px; }
.phase header h3 { margin: 0; font-size: 15px; flex: 1; }
.phase-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--border);
  font-size: 12px; font-weight: 700;
}
.phase-state { font-size: 12px; color: var(--muted); font-weight: 600; }
.phase.active .phase-state { color: var(--accent); }
.phase.done .phase-state { color: var(--accent-2); }
.phase-desc { color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.result {
  background: #0b0f16; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-top: 8px;
}
.result-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.result-provider { font-weight: 700; font-size: 13px; }
.result-meta { color: var(--muted); font-size: 12px; }
.result-meta .cost { font-size: 12px; }
.result pre {
  margin: 8px 0 0; white-space: pre-wrap; word-wrap: break-word; font-size: 13px;
  max-height: 320px; overflow: auto; color: #d7e0ea;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.result.error { border-color: var(--danger); }
.result.error .result-provider { color: var(--danger); }
.result.final { border-color: var(--accent-2); }

.footer { padding: 18px 20px 34px; color: var(--muted); font-size: 12.5px; }
.footer p { margin: 0; }

@media (max-width: 640px) {
  .topbar .wrap { flex-direction: column; }
  .price-row { grid-template-columns: 1fr; }
}

/* ---------- chunk B: site nav, landing, pricing, draft banners ---------- */
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; border: 1px solid transparent;
}
.site-nav a:hover { color: #fff; border-color: var(--accent); background: rgba(79, 140, 255, 0.14); }

.hero { padding: 34px 0 10px; }
.hero h2 { margin: 0 0 10px; font-size: 30px; line-height: 1.3; max-width: 760px; }
.hero-en { color: var(--accent-2); font-weight: 600; max-width: 720px; margin: 0 0 18px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.hero-cta .btn { text-decoration: none; display: inline-block; }
.feature-list { margin: 0; padding-left: 20px; color: var(--text); }
.feature-list li { margin: 8px 0; }
.feature-list code, .legal-body code {
  background: #0b0f16; border: 1px solid var(--border); border-radius: 6px;
  padding: 1px 5px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.phase-mini { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.phase-mini h3 { margin: 0 0 6px; font-size: 14.5px; display: inline; }
.phase-mini .phase-num { margin-right: 8px; }
.phase-mini p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 14px 0; }
.price-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.price-card h3 { margin: 0; font-size: 17px; }
.price-card .price { margin: 0; font-size: 30px; font-weight: 800; color: #fff; }
.price-card .price .per { font-size: 13px; font-weight: 600; color: var(--muted); }
.price-card ul { margin: 0; padding-left: 20px; flex: 1; }
.price-card li { margin: 6px 0; font-size: 13.5px; }
.price-card.pro { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.35) inset; }

.draft-banner {
  background: rgba(255, 209, 102, 0.12); border: 1px solid var(--warn);
  color: #ffe7a8; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px;
  font-weight: 700; font-size: 13.5px;
}
.draft-banner.en { font-weight: 500; }
.panel .draft-banner:last-child { margin-bottom: 0; }

.legal-body h3 { font-size: 15px; margin: 18px 0 6px; }
.legal-body p { margin: 6px 0; }
.legal-body ul { margin: 6px 0; padding-left: 20px; }
.legal-body a, .footer-links a, .price-card a { color: var(--accent); }

.footer-links { margin-top: 8px; }
.btn.btn-ghost { background: transparent; }
.footer .draft-banner { margin: 12px 0 0; padding: 8px 12px; font-size: 12.5px; }
.pro-waitlist { border-style: dashed; }

@media (max-width: 640px) {
  .hero h2 { font-size: 24px; }
  .phase-grid, .pricing-grid { grid-template-columns: 1fr; }
}
