/* Design tokens lifted from drlinagarcia.com (the practice site this platform
   has to look like a part of). Values marked "from practice site" were read
   out of its compiled stylesheet; values marked "derived" are not defined
   there and were interpolated to fill gaps the practice site never needed —
   those are the ones to review.

   Typography note: the practice site sets futura-pt (headings) and
   adelle-sans (body), both Adobe Fonts, which we can't license through this
   app. Jost stands in for futura-pt and Archivo for adelle-sans. */

:root {
  /* brand — from practice site */
  --brand: #89b937;
  --brand-dk: #72992e;
  --footer-bg: #189ef2;

  /* surfaces — from practice site */
  --bg: #efeae6;
  --panel: #ffffff;

  /* ink — from practice site */
  --ink: #362b2b;
  --ink-strong: #1c1c1c;

  /* derived */
  --ink-muted: #6b5f5f;
  --border: #ded5cd;
  --brand-tint: #f2f7e9;
  --panel-shadow: 0 1px 3px rgba(54, 43, 43, 0.06);

  /* semantic — derived; the practice site defines no status colors */
  --success: #3f7d33;
  --success-bg: #eaf4e4;
  --danger: #a33327;
  --danger-bg: #fbeae7;
  --warning: #9a6a15;
  --warning-bg: #fbf1dd;
  --info: #2d6f8f;
  --info-bg: #e7f1f6;

  /* type — Jost ≈ futura-pt, Archivo ≈ adelle-sans */
  --font-display: "Jost", "Futura", "Century Gothic", sans-serif;
  --font-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* geometry — content width from practice site (1020px) */
  --content-width: 1020px;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* Sticky footer: short pages (sign-in, confirmations) otherwise leave the
     footer band floating with dead space beneath it. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: 42px; color: var(--ink-strong); }
h2 { font-size: 32px; color: var(--brand); }
h3 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 2px;
  line-height: 1.3;
  color: var(--brand);
}

@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 26px; }
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); text-decoration: underline; }

/* ---- layout shell ---- */

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
}

.site-header__inner,
.site-main,
.site-footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 72px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-strong);
}
.brand:hover { text-decoration: none; color: var(--brand); }
.brand__tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: var(--ink); font-size: 14px; font-weight: 400; }
.site-nav a:hover { color: var(--brand); text-decoration: none; }
.spacer { flex: 1; }

.site-main { padding-top: 48px; padding-bottom: 64px; flex: 1 0 auto; width: 100%; }

.site-footer { flex-shrink: 0; }

.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.77);
  font-size: 14px;
}
.site-footer__inner { padding-top: 32px; padding-bottom: 32px; }
.site-footer a { color: #fff; }
.site-footer__legal { margin-top: 14px; font-size: 12.5px; line-height: 1.6; }

/* ---- components ---- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--panel-shadow);
}
.card--narrow { max-width: 480px; }
.card__title { margin-top: 0; }

.row { display: flex; gap: 18px; flex-wrap: wrap; }
.row > .card { flex: 1 1 240px; }

.button,
button,
input[type="submit"] {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.button:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--brand);
  color: #fff;
  text-decoration: none;
}

.button-primary {
  background: var(--brand);
  color: #fff;
}
.button-primary:hover { background: var(--brand-dk); border-color: var(--brand-dk); }

.button-danger { border-color: var(--danger); color: var(--danger); }
.button-danger:hover { background: var(--danger); color: #fff; }

button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: none;
  padding: 3px 12px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-muted { background: var(--brand-tint); color: var(--ink-muted); }

.messages { list-style: none; margin: 0 0 20px; padding: 0; }
.messages li {
  padding: 10px 14px;
  border-radius: 9px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 400;
  border: 1px solid var(--info);
  background: var(--info-bg);
  color: var(--info);
}
.messages li.success { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.messages li.error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.messages li.warning { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-muted);
  padding: 9px 10px;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
.muted { color: var(--ink-muted); }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 12px 0 4px;
  letter-spacing: 0.2px;
}
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(137, 185, 55, 0.18);
}

.form-actions { margin-top: 20px; display: flex; gap: 12px; align-items: center; }

.disclaimer {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.disclaimer-banner {
  background: var(--brand-tint);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 8px 24px;
}

.kpi { font-family: var(--font-display); font-size: 30px; font-weight: 400; color: var(--ink-strong); }

/* ---- chat ---- */

.chat { display: grid; gap: 16px; }
.chat__log {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  height: min(60vh, 600px);
  overflow-y: auto;
  display: grid;
  gap: 14px;
  align-content: start;
}
.msg { max-width: 82%; padding: 12px 14px; border-radius: 12px; line-height: 1.5; }
.msg--user { margin-left: auto; background: var(--brand); color: #fff; }
.msg--assistant { margin-right: auto; background: var(--brand-tint); border: 1px solid var(--border); }
.msg--assistant p:first-child { margin-top: 0; }
.msg--assistant p:last-child { margin-bottom: 0; }
.msg__disclaimer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.chat__composer { display: grid; gap: 10px; }
.chat__composer textarea { min-height: 92px; resize: vertical; }
.chat__actions { display: flex; gap: 10px; }

/* ---- allauth pages (login, signup, password reset, email confirmation) ----
   These render through allauth's own element templates, re-parented onto the
   site shell in templates/allauth/layouts/base.html. */

body.auth .site-main {
  max-width: 480px;
}

body.auth .site-main > h1 {
  font-size: 32px;
  text-align: center;
  margin-bottom: 8px;
}

body.auth .site-main > p {
  text-align: center;
  color: var(--ink-muted);
  font-size: 15px;
  margin-top: 0;
}

.auth-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--panel-shadow);
}

.auth-form p { margin: 0 0 14px; }
.auth-form p:last-of-type { margin-bottom: 0; }

/* allauth renders field help text and errors as bare elements. */
.auth-form .helptext,
.auth-form span {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.auth-form ul.errorlist {
  list-style: none;
  margin: 0 0 8px;
  padding: 10px 14px;
  border: 1px solid var(--danger);
  border-radius: 9px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13.5px;
}

.auth-form input[type="checkbox"] { width: auto; margin-right: 8px; }
.auth-form label[for$="remember"] { display: inline; font-weight: 400; }

.form-actions--vertical {
  flex-direction: column;
  align-items: stretch;
}

body.auth .form-actions .button { width: 100%; text-align: center; }
body.auth .form-actions--vertical .button { margin-bottom: 10px; }
