/* =========================================================
   VMESTE — design tokens + landing + app shell
   Palette: warm milky bg + calm blue + coral accent
   ========================================================= */

:root {
  --bg:        #FFF9F6;
  --bg-alt:    #FAFBFF;
  --card:      #FFFFFF;
  --blu:       #2457A6;
  --blu-2:     #2E63C2;
  --blu-soft:  #EAF0FA;
  --coral:     #FF7E63;
  --coral-2:   #FF9276;
  --coral-soft:#FFEDE7;
  --txt:       #102A56;
  --mut:       #60708F;
  --bor:       rgba(36, 87, 166, 0.12);
  --bor-strong:rgba(36, 87, 166, 0.20);
  --shadow-sm: 0 1px 2px rgba(16, 42, 86, 0.04);
  --shadow:    0 8px 28px rgba(36, 87, 166, 0.08);
  --shadow-lg: 0 18px 48px rgba(36, 87, 166, 0.12);
  --radius:    24px;
  --radius-sm: 14px;
  --radius-lg: 28px;

  /* legacy aliases (used by auth/chat code) */
  --pri: var(--blu);
  --sec: var(--coral);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blu); text-decoration: none; }
a:hover { color: var(--blu-2); }

.hidden { display: none !important; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--txt);
  cursor: pointer;
  transition: box-shadow .25s ease, transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
  text-align: center;
  line-height: 1.2;
}
.btn:focus-visible {
  outline: 3px solid rgba(36, 87, 166, .35);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--blu);
  color: #fff;
  box-shadow: 0 6px 18px rgba(36, 87, 166, 0.18);
}
.btn-primary:hover { background: var(--blu-2); box-shadow: 0 10px 24px rgba(36, 87, 166, 0.24); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--blu);
  border-color: var(--bor-strong);
}
.btn-ghost:hover { background: var(--blu-soft); color: var(--blu-2); border-color: var(--blu-2); }

.btn-coral {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 126, 99, 0.22);
}
.btn-coral:hover { background: var(--coral-2); }

.btn-sm  { padding: 10px 18px; font-size: 14px; border-radius: 12px; }
.btn-lg  { padding: 16px 28px; font-size: 16px; border-radius: 16px; }

/* =========================================================
   LANDING — header
   ========================================================= */
.landing { color: var(--txt); }

.lp-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.lp-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--txt);
}
.lp-logo-mark { display: block; flex-shrink: 0; }
.lp-logo-text { font-size: 18px; }

.lp-nav {
  margin-left: auto;
  display: flex;
  gap: 28px;
}
.lp-nav a {
  color: var(--mut);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.lp-nav a:hover { color: var(--txt); border-bottom-color: var(--coral); }
.lp-nav a:focus-visible { outline: 2px solid rgba(36, 87, 166, .35); outline-offset: 4px; border-radius: 2px; }

/* =========================================================
   HERO
   ========================================================= */
.lp-hero {
  max-width: 1180px;
  margin: 24px auto 0;
  padding: 56px 24px 72px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  position: relative;
}
.lp-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 0 0;
  background: radial-gradient(60% 70% at 85% 20%, rgba(255,126,99,.08), transparent 60%),
              radial-gradient(50% 60% at 10% 80%, rgba(36,87,166,.06), transparent 60%);
  pointer-events: none;
  z-index: -1;
}
.lp-eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}
.lp-hero-text h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 20px;
}
.lp-lead {
  font-size: 18px;
  color: var(--mut);
  max-width: 560px;
  margin-bottom: 28px;
}
.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.lp-note {
  font-size: 14px;
  color: var(--mut);
}

/* =========================================================
   HERO ILLUSTRATION
   ========================================================= */
.lp-hero-illustration {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lp-hero-illustration-glow {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,126,99,.18), rgba(36,87,166,.10) 60%, transparent 75%);
  filter: blur(8px);
  z-index: 0;
}
.lp-hero-img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
}

/* =========================================================
   DIALOG CARD (own section)
   ========================================================= */
.lp-section-dialog .dialog-card { max-width: 720px; margin: 0 auto; }
.dialog-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--bor);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.dialog-card::after {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: calc(var(--radius-lg) + 12px);
  background: linear-gradient(135deg, rgba(255,126,99,.06), rgba(36,87,166,.06));
  z-index: -1;
}
.dialog-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-coral { background: var(--coral); }
.dot-blue  { background: var(--blu); }
.dialog-card-title {
  margin-left: auto;
  font-size: 13px;
  color: var(--mut);
  font-weight: 500;
}
/* Two private chat panes */
.chat-pane {
  border-radius: 18px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--bor);
}
.chat-pane-p1 { background: #F4F8FE; }
.chat-pane-p2 { background: #FFF6F2; }
.chat-pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.chat-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chat-badge-p1 { background: var(--blu); color: #fff; }
.chat-badge-p2 { background: var(--coral); color: #fff; }
.chat-private {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--mut);
  font-weight: 500;
}
.chat-private svg { display: block; }

.dialog-msg {
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 92%;
  background: #fff;
  border: 1px solid var(--bor);
}
.dialog-msg p { font-size: 14.5px; line-height: 1.5; color: var(--txt); }
.dialog-author {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--blu);
}

/* User (partner) message: aligned right, slight tint */
.chat-pane-p1 .msg-user { align-self: flex-end; background: var(--blu-soft); border-color: rgba(36,87,166,.18); border-bottom-right-radius: 5px; }
.chat-pane-p2 .msg-user { align-self: flex-end; background: var(--coral-soft); border-color: rgba(255,126,99,.22); border-bottom-right-radius: 5px; }

/* AI reply: aligned left, white card */
.msg-ai { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; }

/* Privacy divider between the two panes */
.chat-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 2px;
}
.chat-divider-line {
  flex: 1;
  height: 1px;
  background: var(--bor);
}
.chat-divider-text {
  font-size: 11.5px;
  color: var(--mut);
  letter-spacing: 0.02em;
  font-weight: 500;
  white-space: nowrap;
}

/* =========================================================
   SECTIONS — generic
   ========================================================= */
.lp-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px;
}
.lp-section-head {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}
.lp-section-head h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--txt);
  letter-spacing: -0.01em;
}
.lp-section-head p {
  font-size: 17px;
  color: var(--mut);
}

/* HOW IT WORKS */
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step-card {
  background: var(--card);
  border: 1px solid var(--bor);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.step-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--bor-strong);
}
.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--coral-soft);
  color: var(--coral);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step-num {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mut);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.step-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--txt);
}
.step-card p { color: var(--mut); font-size: 15px; }

/* CASES */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.case-card {
  background: var(--card);
  border: 1px solid var(--bor);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.case-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--bor-strong);
}
.case-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--blu-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.case-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--txt);
}
.case-card p { color: var(--mut); font-size: 14px; }

/* TRUST */
.lp-section-trust { background: linear-gradient(180deg, transparent, rgba(36, 87, 166, .03)); border-radius: 32px; }
.trust-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
}
.trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--bor);
  border-radius: 18px;
  font-size: 15px;
  color: var(--txt);
  line-height: 1.5;
}
.trust-list li strong { font-weight: 700; }
.trust-check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* BEFORE / AFTER */
.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 880px;
  margin: 0 auto;
  align-items: stretch;
}
.ba-card {
  background: var(--card);
  border: 1px solid var(--bor);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.ba-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.ba-before { background: #FBF6F4; }
.ba-before .ba-tag { background: #FFE8E0; color: #B8533A; }
.ba-before p { color: var(--txt); font-size: 17px; line-height: 1.5; }
.ba-after { border-color: var(--bor-strong); box-shadow: var(--shadow); }
.ba-after .ba-tag { background: var(--blu-soft); color: var(--blu); }
.ba-after p { color: var(--txt); font-size: 17px; line-height: 1.5; font-weight: 500; }

/* FINAL CTA */
.lp-final {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}
.lp-final-card {
  background: linear-gradient(135deg, var(--blu) 0%, var(--blu-2) 100%);
  color: #fff;
  border-radius: 32px;
  padding: 56px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.lp-final-card h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.lp-final-card p {
  color: rgba(255,255,255,.85);
  margin-bottom: 28px;
  font-size: 17px;
}
.lp-final-card .btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,0.16);
}
.lp-final-card .btn-primary:hover { background: var(--coral-2); box-shadow: 0 12px 28px rgba(0,0,0,0.22); }

/* FOOTER */
.lp-footer {
  border-top: 1px solid var(--bor);
  background: var(--bg-alt);
}
.lp-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.lp-footer-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 360px;
}
.lp-footer-brand strong { display: block; font-size: 15px; margin-bottom: 4px; }
.lp-footer-brand p { color: var(--mut); font-size: 14px; }
.lp-footer-links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.lp-footer-links a {
  color: var(--mut);
  font-size: 14px;
}
.lp-footer-links a:hover { color: var(--txt); }
.lp-footer-copy {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 28px;
  color: var(--mut);
  font-size: 13px;
}

/* =========================================================
   REVEAL ANIMATIONS
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .lp-hero { grid-template-columns: 1fr; gap: 36px; padding: 36px 20px 56px; }
  .step-grid { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-list { grid-template-columns: 1fr; }
  .ba-grid { grid-template-columns: 1fr; }
  .lp-section { padding: 56px 20px; }
}
@media (max-width: 640px) {
  .lp-header { padding: 18px 18px; gap: 14px; flex-wrap: wrap; }
  .lp-nav { display: none; }
  .lp-hero { padding: 24px 18px 48px; }
  .lp-hero-text h1 { font-size: 30px; }
  .lp-lead { font-size: 16px; }
  .case-grid { grid-template-columns: 1fr; }
  .lp-final-card { padding: 40px 22px; border-radius: 24px; }
  .lp-footer-inner { flex-direction: column; gap: 18px; }
  .lp-footer-links { margin-left: 0; }
  .btn { padding: 13px 20px; }
}

/* =========================================================
   APP SHELL — auth/chat (existing SPA, restyled to new tokens)
   ========================================================= */
.app-shell { background: var(--bg); }

.hdr {
  background: var(--txt);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 22px; font-weight: 700; color: var(--coral); letter-spacing: 0.04em; }
.hrr { display: flex; align-items: center; gap: 12px; }
.uname { font-size: 13px; opacity: .9; cursor: pointer; }
.uname:hover { opacity: 1; text-decoration: underline; }

.ctr { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }

.card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bor);
}

h2 { font-size: 22px; margin-bottom: 14px; font-weight: 700; }
h3 { font-size: 17px; margin-bottom: 10px; font-weight: 600; }

input, textarea, select {
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--bor);
  width: 100%;
  margin-bottom: 10px;
  font-family: inherit;
  background: #fff;
  color: var(--txt);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blu);
  box-shadow: 0 0 0 3px rgba(36, 87, 166, .12);
}

button {
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.bp { background: var(--blu); color: #fff; box-shadow: 0 4px 14px rgba(36, 87, 166, .18); }
.bp:hover { background: var(--blu-2); }
.bs { background: var(--coral); color: #fff; box-shadow: 0 4px 14px rgba(255, 126, 99, .20); }
.bs:hover { background: var(--coral-2); }
.bsm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
.bicon { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; border: none; background: transparent; color: var(--mut); font-size: 20px; }
.bicon:hover { background: var(--blu-soft); color: var(--txt); }
.bsend { width: 44px !important; height: 44px !important; padding: 0 !important; border-radius: 50% !important; display: inline-flex !important; align-items: center; justify-content: center; flex-shrink: 0; }

.cbox { max-height: 480px; overflow-y: auto; padding: 8px 0; margin-bottom: 14px; }
.msg { margin-bottom: 12px; padding: 12px 16px; border-radius: 16px; max-width: 82%; line-height: 1.45; font-size: 14px; word-break: break-word; }
.msg.u  { background: var(--coral-soft); color: var(--txt); margin-left: auto; border-bottom-right-radius: 6px; }
.msg.ai { background: var(--blu); color: #fff; border-bottom-left-radius: 6px; }

/* System bubbles (file uploads, analysis summaries, info notes) */
.msg.sys {
  background: var(--blu-soft);
  color: var(--txt);
  border: 1px solid var(--bor);
  font-size: 13.5px;
  line-height: 1.55;
  text-align: left;
  max-width: 92%;
  margin: 6px 0;
  padding: 14px 16px;
  border-radius: 14px;
}
.msg.sys.err-bubble { background: #fff0ed; border-color: #f4baad; color: #b8533a; }

/* ---- Markdown rendering inside any .msg bubble ---- */
.msg strong { font-weight: 700; }
.msg code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(16, 42, 86, 0.08);
}
.msg .msg-h    { font-weight: 700; font-size: 15px;   margin: 4px 0 8px;  line-height: 1.35; }
.msg .msg-sub  { font-weight: 700; font-size: 13.5px; margin: 12px 0 6px; line-height: 1.35; }
.msg .msg-h:first-child, .msg .msg-sub:first-child { margin-top: 0; }
.msg .msg-list { margin: 4px 0 8px; padding-left: 1.4em; list-style: disc; }
.msg .msg-list li { margin: 3px 0; line-height: 1.55; }

/* AI bubbles (white text on blue) — adjust contrast for code */
.msg.ai code { background: rgba(255, 255, 255, 0.18); color: #fff; }
.msg.ai .msg-sub { opacity: 0.92; }

/* System bubble accent: blue heading, calm text */
.msg.sys .msg-h   { color: var(--blu); }
.msg.sys .msg-sub { color: var(--txt); }

/* Animated "typing" / analysing bubble */
.msg.typing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  animation: vmTypingBlink 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.30s; }
@keyframes vmTypingBlink {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35%           { opacity: 1;    transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: none; opacity: 0.7; }
}

/* Locked composer while a file is being analysed */
.input-row.disabled { opacity: 0.6; pointer-events: none; }
.input-row.disabled textarea { background: #f6f7fb; cursor: not-allowed; }

.irw { display: flex; gap: 8px; align-items: flex-end; }
.irw textarea { flex: 1; height: 44px; resize: none; padding: 10px 14px; font-size: 14px; margin-bottom: 0; border-radius: 22px; }
.fwrap { position: relative; }
.fwrap input[type=file] { position: absolute; opacity: 0; width: 0; height: 0; }

.invbx {
  background: linear-gradient(135deg, var(--blu), var(--blu-2));
  color: #fff;
  padding: 18px;
  border-radius: 14px;
  text-align: center;
  margin: 14px 0;
}
.invcd { font-size: 26px; letter-spacing: 4px; font-family: monospace; font-weight: 700; margin: 10px 0; }
.invhi { font-size: 12px; opacity: .85; }

.err { background: #fff0ed; border: 1px solid #f4baad; color: #b8533a; padding: 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.suc { background: #eef5ff; border: 1px solid #b6cdee; color: #1f4a8a; padding: 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }

.rsec { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--bor); }
.rbtn { background: transparent; border: 1px solid #d44; color: #d44; padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 12px; }
.rbtn:hover { background: #d44; color: #fff; }
.rpend { background: #fff3e0; padding: 10px; border-radius: 10px; font-size: 13px; color: #e65100; margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.rcbtn { background: #d44; color: #fff; border: none; padding: 6px 14px; border-radius: 10px; cursor: pointer; font-size: 12px; }

.stitle { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.stitle svg { width: 22px; height: 22px; color: var(--blu); }
.ustat { font-size: 12px; color: var(--coral); margin-left: 8px; display: none; }
.ustat.on { display: inline; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(16, 42, 86, 0.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-content { background: var(--card); border-radius: var(--radius-sm); padding: 24px; max-width: 420px; width: 90%; box-shadow: var(--shadow-lg); }
.modal h2 { margin-bottom: 16px; }
.modal-close { float: right; cursor: pointer; font-size: 20px; color: var(--mut); }
.modal-close:hover { color: var(--txt); }

/* Couple bar / chat extras */
.couple-bar { text-align: center; color: var(--mut); font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.couple-bar svg { color: var(--blu); }
.chat-box { max-height: 55vh; overflow-y: auto; padding: 8px 0; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.input-row { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.input-row textarea { flex: 1; height: 44px; resize: none; padding: 10px 14px; font-size: 14px; border-radius: 22px; border: 1px solid var(--bor); font-family: inherit; background: #fff; margin-bottom: 0; }
.input-row textarea:focus { outline: none; border-color: var(--blu); box-shadow: 0 0 0 3px rgba(36, 87, 166, .12); }
.send-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--blu); color: #fff; border: none; cursor: pointer; }
.send-btn:hover { background: var(--blu-2); }
.reset-status { margin-top: 8px; }
.reset-status:empty { display: none; }

/* Danger zone inside profile modal */
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--bor); }
.danger-zone h3 { font-size: 15px; color: #b8533a; margin-bottom: 6px; }
.danger-zone p { font-size: 13px; color: var(--mut); margin-bottom: 12px; line-height: 1.5; }
.danger-zone .rbtn { width: 100%; padding: 10px 14px; font-size: 14px; }
.danger-sep { height: 1px; background: var(--bor); margin: 18px 0 16px; }
.rbtn.rbtn-danger { background: #d44; color: #fff; border-color: #d44; }
.rbtn.rbtn-danger:hover { background: #b73838; border-color: #b73838; color: #fff; }

/* =========================================================
   SURVEYS — list cards + fill modal
   ========================================================= */
.surveys-empty p { color: var(--mut); font-size: 14px; margin-bottom: 8px; }
.surveys-empty .hint { font-size: 13px; padding: 12px 14px; background: var(--blu-soft); border-radius: 12px; color: var(--txt); }

.survey-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.survey-card {
  background: #fff;
  border: 1px solid var(--bor);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .15s ease, border-color .2s ease;
}
.survey-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--bor-strong); }
.survey-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.survey-card h3 { font-size: 16px; font-weight: 700; color: var(--txt); margin: 0; }
.survey-format {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blu-soft);
  color: var(--blu);
  font-size: 12px;
  font-weight: 700;
}
.survey-pct { font-size: 13px; font-weight: 700; color: var(--blu); white-space: nowrap; }
.survey-topic { font-size: 13.5px; color: var(--mut); margin: 4px 0 10px; line-height: 1.45; }
.survey-bar { display: block; width: 100%; height: 6px; background: var(--blu-soft); border-radius: 999px; overflow: hidden; }
.survey-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blu), var(--blu-2)); border-radius: 999px; transition: width .3s ease; }
.survey-bar.full > span { background: linear-gradient(90deg, var(--coral), var(--coral-2)); }
.survey-card footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 10px; }
.survey-meta { font-size: 12.5px; color: var(--mut); }
.btn-link {
  background: transparent; border: none; padding: 6px 0;
  color: var(--blu); font-weight: 600; font-size: 13.5px;
  cursor: pointer; font-family: inherit;
}
.btn-link:hover { color: var(--blu-2); text-decoration: underline; }

/* Survey modal */
.survey-modal { padding: 20px; align-items: flex-start; padding-top: 5vh; }
.survey-modal-content { max-width: 640px; width: 100%; max-height: 90vh; padding: 0; display: flex; flex-direction: column; }
.survey-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 22px 24px 14px; border-bottom: 1px solid var(--bor);
}
.survey-modal-head h2 { font-size: 19px; margin: 0 0 4px; }
.survey-modal-head .survey-format { margin: 2px 0 8px; }
.survey-modal-head .survey-topic { margin: 0; }
.survey-modal-head .modal-close { float: none; }
.survey-progress { display: flex; align-items: center; gap: 12px; padding: 12px 24px 0; }
.survey-progress .survey-bar { flex: 1; height: 8px; }
.survey-progress .survey-pct { font-size: 13px; min-width: 40px; text-align: right; }
.survey-questions { padding: 16px 24px 4px; overflow-y: auto; flex: 1; min-height: 0; }
.survey-q { display: block; margin-bottom: 18px; }
.survey-q-num { display: inline-block; font-weight: 700; color: var(--blu); margin-right: 6px; }
.survey-q-text { display: inline; font-weight: 500; color: var(--txt); font-size: 14.5px; line-height: 1.5; }
.survey-q textarea {
  display: block; width: 100%; margin-top: 8px;
  min-height: 76px; resize: vertical; padding: 11px 13px;
  border: 1px solid var(--bor); border-radius: 12px;
  font-family: inherit; font-size: 14px; line-height: 1.5;
  background: #fff; color: var(--txt);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.survey-q textarea:focus { outline: none; border-color: var(--blu); box-shadow: 0 0 0 3px rgba(36, 87, 166, .12); }
.survey-saved { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--mut); min-height: 16px; }
.survey-saved:not(:empty) { color: var(--blu); }
.survey-modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 24px 22px; border-top: 1px solid var(--bor);
}

/* =========================================================
   ANALYSIS tab
   ========================================================= */
.analysis-intro { color: var(--mut); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.analysis-empty { text-align: center; padding: 24px 12px 12px; }
.analysis-empty p { color: var(--mut); font-size: 14px; margin-bottom: 18px; max-width: 520px; margin-left: auto; margin-right: auto; line-height: 1.55; }
.analysis-result {
  background: var(--blu-soft);
  border: 1px solid var(--bor);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--txt);
}
.analysis-result .msg-h { color: var(--blu); }
.analysis-result .msg-sub { color: var(--txt); }
.analysis-result .msg-list { padding-left: 1.4em; }
.analysis-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff7ed;
  border: 1px solid #f4d3a8;
  border-radius: 10px;
  font-size: 13px;
  color: #8c5a18;
}
.analysis-meta { font-size: 12.5px; color: var(--mut); margin-top: 12px; }
.analysis-actions { margin-top: 16px; display: flex; gap: 10px; }
.analysis-running .typing { background: var(--blu); color: #fff; border-radius: 14px; padding: 14px 18px; max-width: none; }

/* Tabs */
.tab-bar { display: flex; gap: 0; margin-bottom: 16px; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--bor); }
.tab-btn { flex: 1; padding: 12px 8px; font-size: 14px; font-weight: 600; border: none; background: transparent; color: var(--mut); cursor: pointer; border-bottom: 3px solid transparent; transition: all .2s; border-radius: 0; }
.tab-btn.active { color: var(--blu); border-bottom-color: var(--coral); background: var(--blu-soft); }
.tab-btn:hover { color: var(--txt); }
.tab-panel.hidden { display: none !important; }

/* BotUI overrides (in case BotUI is later turned on) */
.botui-container { background: transparent !important; min-height: 70vh; }
.botui-message-content { font-size: 14px; line-height: 1.5; }
.botui-message-content.html { background: var(--blu); color: #fff; border-radius: 16px 16px 16px 4px; padding: 12px 16px; }
.botui-message-content.human { background: var(--coral-soft); color: var(--txt); border-radius: 16px 16px 4px 16px; padding: 12px 16px; margin-left: auto; }
.botui-actions-text-input { border: 1px solid var(--bor); border-radius: 22px !important; padding: 10px 16px !important; font-size: 14px !important; font-family: inherit !important; }
.botui-actions-text-input:focus { outline: none; border-color: var(--blu); }
.botui-actions-text-submit { background: var(--blu) !important; border-radius: 50% !important; width: 40px !important; height: 40px !important; }
.botui-actions-buttons-button { background: var(--blu) !important; border-radius: 12px !important; font-family: inherit !important; font-weight: 600 !important; padding: 10px 20px !important; }
.botui-actions-buttons-button:hover { background: var(--blu-2) !important; }
.botui-app-container { max-width: 700px; margin: 0 auto; }

.invite-link { color: var(--pri); text-decoration: underline; cursor: pointer; font-weight: 600 }
.invite-link:hover { color: #a8684d }

.logo-icon { vertical-align: middle; margin-right: 8px; margin-top: -2px }


/* Format choice modal */
.format-modal { padding: 20px; }
.format-modal-content { max-width: 460px; width: 100%; position: relative; }
.format-modal-content .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  float: none;
  background: transparent;
  border: 0;
  color: var(--mut);
  font-size: 18px;
  padding: 6px;
  line-height: 1;
}
.format-modal-content h2 { margin: 0 32px 8px 0; font-size: 20px; }
.format-intro { color: var(--mut); font-size: 14px; margin-bottom: 18px; line-height: 1.45; }
.format-options { display: grid; gap: 10px; }
.format-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  border: 1px solid var(--bor-strong);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform .15s ease, box-shadow .2s ease;
  font-family: inherit;
}
.format-option:hover {
  border-color: var(--blu);
  background: var(--blu-soft);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.format-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
}
.format-desc {
  font-size: 13px;
  color: var(--mut);
  line-height: 1.45;
}

/* Choice survey buttons */
.choice-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.choice-btn {
  padding: 10px 20px;
  border: 1px solid var(--bor-strong);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--txt);
  transition: background .2s, border-color .2s, color .2s, transform .15s ease;
}
.choice-btn:hover {
  border-color: var(--blu);
  background: var(--blu-soft);
}
.choice-btn.selected {
  border-color: var(--blu);
  background: var(--blu);
  color: #fff;
}
