/* Sodeepo AI — shared stylesheet. Professional, clean, responsive. No frameworks. */

:root {
  --ink: #1b2430;
  --ink-soft: #4a5568;
  --bg: #ffffff;
  --bg-warm: #f7f5f0;
  --line: #e6e1d8;
  --brand: #1f6f54;          /* deep green — professional, calm */
  --brand-dark: #17573f;
  --brand-tint: #e9f3ee;
  --accent: #c9962e;         /* restrained gold */
  --sidebar-bg: #16212b;
  --sidebar-ink: #eef2f4;
  --sidebar-dim: #9aa7b4;
  --danger: #b3372f;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(27, 36, 48, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

a { color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: var(--font);
  background: #eef1f4;
  color: var(--ink);
}
.btn:hover { filter: brightness(0.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--ink); padding: 6px 10px; border-radius: 6px;
}
.icon-btn:hover { background: var(--bg-warm); }

/* ---------- Landing page ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { font-size: 22px; font-weight: 700; color: var(--brand); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.nav a:hover { color: var(--ink); }

.hero {
  background: linear-gradient(160deg, var(--sidebar-bg) 0%, #234a3d 100%);
  color: #fff;
  padding: 96px 0 88px;
  text-align: center;
}
.hero h1 { font-size: 40px; line-height: 1.2; margin: 0 0 18px; max-width: 760px; margin-left: auto; margin-right: auto; }
.hero .lead { font-size: 19px; max-width: 640px; margin: 0 auto 32px; color: #dfe8e3; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,0.35); }

.different { padding: 72px 0; }
.section-lede { text-align: center; max-width: 720px; margin: -18px auto 36px; color: var(--ink-soft); font-size: 18px; }
.features { padding: 72px 0; background: var(--bg-warm); }
.features h2, .different h2, .pricing h2, .faq h2 { text-align: center; font-size: 30px; margin: 0 0 36px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 10px; font-size: 18px; color: var(--brand-dark); }
.card p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.pricing { padding: 72px 0; }
.pricing-grid {
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 8px;
}
.pricing-card {
  width: 340px; max-width: 100%; text-align: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 36px 30px;
  box-shadow: var(--shadow); background: #fff;
}
.pricing-card.featured { border: 2px solid var(--brand); }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #fff; background: var(--brand);
  border-radius: 999px; padding: 2px 10px; vertical-align: middle;
}
.pricing-card h3 { margin: 0 0 6px; font-size: 22px; }
.price { font-size: 52px; font-weight: 700; margin: 6px 0 18px; color: var(--brand-dark); }
.price .per { font-size: 18px; font-weight: 400; color: var(--ink-soft); }
.pricing-card ul { list-style: none; padding: 0; margin: 0 0 26px; text-align: left; }
.pricing-card li { padding: 8px 0 8px 30px; position: relative; color: var(--ink-soft); }
.pricing-card li::before { content: "\2713"; position: absolute; left: 6px; color: var(--brand); font-weight: 700; }
.fine { font-size: 13px; color: var(--ink-soft); margin-top: 14px; }

.faq { padding: 72px 0 84px; background: var(--bg-warm); }
.faq details {
  max-width: 720px; margin: 0 auto 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
}
.faq summary { font-weight: 600; cursor: pointer; font-size: 16px; }
.faq details p { color: var(--ink-soft); margin: 10px 0 0; }

.site-footer { background: var(--sidebar-bg); color: var(--sidebar-dim); padding: 36px 0; text-align: center; }
.site-footer .disclaimer { font-size: 13px; max-width: 760px; margin: 0 auto 10px; }
.site-footer .copyright { font-size: 13px; margin: 0; }
.footer-links { font-size: 13px; margin: 0 0 10px; }
.footer-links a { color: inherit; }

/* ---------- Policy pages ---------- */
.policy { max-width: 760px; }
.policy h2 { margin-bottom: 6px; }
.policy-updated { font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; text-align: center; }
.policy h3 { margin: 28px 0 10px; font-size: 19px; }
.policy p, .policy li { color: var(--ink-soft); line-height: 1.65; }
.policy ul { padding-left: 22px; }
.policy a { color: var(--brand-dark); }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--sidebar-bg) 0%, #234a3d 100%);
  padding: 24px;
}
.auth-card {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 40px 36px; width: 100%; max-width: 400px;
}
.auth-card .brand { display: block; text-align: center; font-size: 26px; }
.auth-sub { text-align: center; color: var(--ink-soft); margin: 8px 0 22px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tab {
  flex: 1; background: none; border: none; padding: 12px; font-size: 15px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent;
  font-family: var(--font);
}
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 12px; font-size: 15px; font-family: var(--font);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.field input:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.error {
  background: #fbeceb; color: var(--danger); border: 1px solid #f0c4c0;
  border-radius: var(--radius); padding: 10px 12px; font-size: 14px; margin: 0 0 16px;
}
.info {
  background: #eef6ee; color: #2f6b2f; border: 1px solid #c4ddc4;
  border-radius: var(--radius); padding: 10px 12px; font-size: 14px; margin: 0 0 16px;
}

/* ---------- App shell ---------- */
.app-body { height: 100vh; }
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 300px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-ink);
  display: flex; flex-direction: column;
}
.sidebar-top { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.convo-list { flex: 1; overflow-y: auto; padding: 8px; }
.convo-item {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 14px; margin-bottom: 2px;
}
.convo-item:hover { background: rgba(255,255,255,0.08); }
.convo-item.active { background: rgba(255,255,255,0.14); }
.convo-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-title-input {
  flex: 1; background: #fff; border: none; border-radius: 4px;
  font-size: 14px; padding: 3px 6px; font-family: var(--font);
}
.convo-del {
  background: none; border: none; color: var(--sidebar-dim); cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px;
}
.convo-del:hover { color: #ff8a80; background: rgba(255,255,255,0.08); }
.convo-empty { color: var(--sidebar-dim); font-size: 13px; padding: 12px; text-align: center; }

.sidebar-bottom {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.12);
  display: flex; flex-direction: column; gap: 8px;
}
.user-email { margin: 0; font-size: 13px; color: var(--sidebar-dim); word-break: break-all; }
.sub-badge { margin: 0; font-size: 13px; font-weight: 600; }
.sub-badge.active { color: #8fd6b4; }
.sub-badge.inactive { color: #e8c46a; }
.sidebar-bottom .btn-outline { color: #fff; border-color: rgba(255,255,255,0.3); }
.sidebar-bottom .btn-ghost { color: var(--sidebar-dim); }

.chat-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; }
.chat-header {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line); padding: 12px 18px;
}
.chat-header h2 {
  margin: 0; font-size: 17px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#sidebar-toggle { display: none; }

/* Paywall */
.paywall {
  border-bottom: 1px solid var(--line); background: var(--brand-tint);
  padding: 22px 24px; text-align: center;
}
.trial-banner {
  text-align: center; font-size: 13px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-tint);
  border-bottom: 1px solid var(--line); padding: 8px 12px;
}
.paywall-title { font-size: 19px; font-weight: 700; margin: 0 0 8px; color: var(--brand-dark); }
.paywall p { margin: 0 0 14px; color: var(--ink-soft); }
.paywall-tiers { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 4px 0 6px; }
.paywall-tier {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 14px 18px; min-width: 200px; max-width: 260px;
}
.paywall-tier .tier-name { font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.paywall-tier .fine { margin: 0 0 12px; }

/* Attachments */
.attachment-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line); padding: 8px 18px; background: var(--bg-warm);
  flex-wrap: wrap;
}
.attachment-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px;
}
.chip button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; padding: 0 6px 0 0; }

/* Messages */
.message-list { flex: 1; overflow-y: auto; padding: 24px 18px; display: flex; flex-direction: column; gap: 18px; }
.message { max-width: 780px; width: 100%; margin: 0 auto; }
.message .role { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; color: var(--ink-soft); }
.message.user .role { color: var(--brand-dark); }
.message .bubble {
  background: var(--bg-warm); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px;
}
.message.user .bubble { background: var(--brand-tint); border-color: #cfe3d8; }
.message.assistant.streaming .bubble::after { content: "\258d"; animation: blink 1s steps(1) infinite; color: var(--brand); }
@keyframes blink { 50% { opacity: 0; } }
.message .bubble h1, .message .bubble h2, .message .bubble h3 { margin: 14px 0 8px; color: var(--ink); }
.message .bubble h1:first-child, .message .bubble h2:first-child, .message .bubble h3:first-child { margin-top: 0; }
.message .bubble h1 { font-size: 21px; } .message .bubble h2 { font-size: 18px; } .message .bubble h3 { font-size: 16px; }
.message .bubble p { margin: 8px 0; }
.message .bubble ul, .message .bubble ol { margin: 8px 0; padding-left: 24px; }
.message .bubble li { margin: 4px 0; }
.message .bubble code {
  background: rgba(27,36,48,0.08); padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
}
.message .bubble pre {
  background: var(--sidebar-bg); color: #e8edf1; padding: 14px; border-radius: 8px;
  overflow-x: auto; font-size: 13px;
}
.message .bubble pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.chat-empty { text-align: center; color: var(--ink-soft); margin-top: 12vh; }
.chat-empty h3 { color: var(--ink); margin-bottom: 6px; }

/* Composer */
.composer {
  display: flex; gap: 10px; align-items: flex-end;
  border-top: 1px solid var(--line); padding: 14px 18px; background: #fff;
}
.composer textarea {
  flex: 1; resize: none; font-family: var(--font); font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px;
  max-height: 160px;
}
.composer textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

/* Toasts */
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--sidebar-bg); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow); animation: toast-in 0.25s ease-out;
}
.toast.success { background: var(--brand-dark); }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .hero { padding: 64px 0 56px; }
  .nav a:not(.btn) { display: none; }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); transition: transform 0.25s ease;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  #sidebar-toggle { display: inline-block; }
  .message-list { padding: 16px 12px; }
  .composer { padding: 10px 12px; }
  .attachment-bar { padding: 8px 12px; }
}

/* ---------- Four-tier paywall & projects ---------- */
.paywall-tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.paywall-tier {
  border: 1px solid #e5e1d8;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  background: #fff;
}
.paywall-tier .tier-name {
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 8px;
}
.paywall-tier .fine {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6b6455;
}
.pay-instructions {
  border: 1px solid #e5e1d8;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
  background: #faf8f3;
}
.pay-instructions h3 { margin: 0 0 8px; font-size: 17px; }
.pay-instructions ul { margin: 8px 0 8px 20px; padding: 0; }
.pay-instructions li { margin: 4px 0; }
.disclaimer {
  font-size: 12.5px;
  color: #6b6455;
  line-height: 1.5;
  border-top: 1px solid #e5e1d8;
  padding-top: 12px;
  margin-top: 16px;
}
.project-filter {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e1d8;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.project-filter .field { flex: 1; margin: 0; }
.project-filter select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d8d2c4;
  border-radius: 8px;
  background: #fff;
}
.convo-move {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #8a8272;
  padding: 2px 4px;
}
.convo-move:hover { color: #333; }
.upload-hint { margin: 4px 0 0; font-size: 12px; }
@media (max-width: 900px) {
  .paywall-tiers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .paywall-tiers { grid-template-columns: 1fr; }
}

/* Demo box (3 free wishes) */
.demo-box { max-width: 640px; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: #fff; box-shadow: var(--shadow); }
.demo-messages { min-height: 120px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.demo-msg { padding: 10px 14px; border-radius: 12px; max-width: 85%; white-space: pre-wrap; }
.demo-user { align-self: flex-end; background: #f0eaff; }
.demo-ai { align-self: flex-start; background: #f6f6f6; }
.demo-form { display: flex; gap: 8px; }
.demo-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; }
.demo-count { text-align: center; margin-top: 8px; }
.demo-converted { text-align: center; padding: 16px 0; }
.demo-converted-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }

/* Sodeepo Voice: listen + mic buttons */
.listen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 0.95rem;
  line-height: 1.4;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.listen-btn:hover { background: #f0eaff; }
.listen-btn:disabled { opacity: 0.6; cursor: default; }
.demo-ai .listen-btn { margin-top: 8px; }
#mic-btn.listening, #demo-mic-btn.listening {
  border-color: #d33;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(221, 51, 51, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(221, 51, 51, 0); }
}
