/* ---------- Design tokens ---------- */
:root {
  --color-bg: #faf7f2;
  --color-bg-alt: #f1ece2;
  --color-surface: #ffffff;
  --color-text: #2b2a26;
  --color-text-muted: #625f57;
  --color-primary: #3f6659;      /* deep sage */
  --color-primary-dark: #2c493f;
  --color-accent: #c98a5e;       /* warm terracotta */
  --color-border: #e4ddd0;
  --color-notice-bg: #fbeee0;
  --color-notice-border: #e8c9a3;

  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 14px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-primary-dark);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }

p { margin: 0 0 1em; }

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

ul, ol { padding-left: 1.2em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.98rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: transparent;
  color: var(--color-primary-dark);
  border: 1.5px solid var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
}
.logo-main {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}
.logo-sub {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  text-transform: uppercase;
}

.main-nav a {
  margin-left: 24px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--color-primary); }

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 56px;
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 1em;
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 2em;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* ---------- Notice strip ---------- */
.notice-strip {
  background: var(--color-notice-bg);
  border-top: 1px solid var(--color-notice-border);
  border-bottom: 1px solid var(--color-notice-border);
  padding: 16px 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  text-align: center;
}
.notice-strip p { margin: 0; }
.notice-strip a { color: var(--color-primary-dark); font-weight: 600; }

/* ---------- Offer ---------- */
.offer { padding: 72px 0; }

.section-sub {
  color: var(--color-text-muted);
  margin-bottom: 2.2em;
}

.offer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.offer-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
}

.offer-list {
  color: var(--color-text-muted);
  margin-bottom: 1.6em;
}

/* ---------- Steps ---------- */
.steps {
  background: var(--color-bg-alt);
  padding: 72px 0;
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.steps-list li {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--color-border);
}

/* ---------- FAQ ---------- */
.faq { padding: 72px 0; }

.faq details {
  border-bottom: 1px solid var(--color-border);
  padding: 18px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.faq p { margin-top: 0.8em; color: var(--color-text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 0;
  background: var(--color-bg-alt);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-nav a {
  margin-left: 18px;
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--color-primary); }

/* ---------- Legal pages ---------- */
.legal { padding: 64px 0 96px; }
.legal h2 { margin-top: 1.6em; }
.legal .container { max-width: 760px; }

/* ---------- Chat page ---------- */
.chat-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.chat-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.chat-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-mode-label {
  font-weight: 600;
  color: var(--color-primary-dark);
}

.chat-crisis-note {
  background: var(--color-notice-bg);
  border-bottom: 1px solid var(--color-notice-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 10px 0;
  text-align: center;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0 24px;
  min-height: 40vh;
}

.msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.98rem;
  white-space: pre-wrap;
}

.msg-assistant {
  align-self: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.msg-user {
  align-self: flex-end;
  background: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-system {
  align-self: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.chat-form {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: none;
}

.chat-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.chat-send {
  border: none;
  cursor: pointer;
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.chat-error {
  color: #a3402b;
  font-size: 0.9rem;
  margin-top: 8px;
  display: none;
}
