/* ============================================================
   Esperto AI Coach Assistant — stylesheet
   Brand: Inter / Arial · orange #f16529 · blue #3290ce
   ============================================================ */

:root {
  --orange: #f16529;
  --orange-dark: #d8511c;
  --blue: #3290ce;
  --blue-dark: #2179bf;
  --green: #009345;
  --ink: #1a1d21;
  --body: #2b3036;
  --muted: #6b747d;
  --line: #e4e8ec;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --radius: 10px;
  --maxw: 980px;
  --font: 'Inter', Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { color: var(--ink); font-size: 28px; margin: 8px 0 4px; }
.muted { color: var(--muted); }
.error { color: #b3261e; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px;
}
.topbar__logo { display: flex; align-items: center; gap: 10px; }
.topbar__logo:hover { text-decoration: none; }
.topbar__sub {
  font-weight: 600; font-size: 13px; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 10px; letter-spacing: .02em;
}
.topbar__spacer { flex: 1; }
.topbar__link { font-size: 14px; color: var(--muted); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 60px;
}

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; background: #eef1f4; }
.btn--primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-dark); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 14px; font-size: 13px; }

input[type="search"], input[type="password"], select, textarea {
  font: inherit; font-size: 15px; color: var(--body);
  padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(50,144,206,.15);
}

.searchbar { display: flex; gap: 10px; margin: 18px 0 24px; }
.searchbar input { flex: 1; border-radius: 999px; }

/* ---------- Reports table ---------- */
table.reports { width: 100%; border-collapse: collapse; font-size: 15px; }
.reports th {
  text-align: left; font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
  padding: 8px 12px; border-bottom: 2px solid var(--line);
}
.reports td { padding: 12px; border-bottom: 1px solid var(--line); }
.reports tr:hover td { background: var(--bg-soft); }

/* ---------- Report page / chat ---------- */
.backlink { font-size: 14px; color: var(--muted); }
.report-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.report-head__controls { display: flex; align-items: center; gap: 10px; font-size: 14px; }

.chat {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft);
  display: flex; flex-direction: column;
  height: calc(100vh - 260px); min-height: 420px;
}
.chat__messages { flex: 1; overflow-y: auto; padding: 20px; }
.chat__intro {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; max-width: 560px; margin: 40px auto; text-align: center;
}
.bubble {
  max-width: 85%; padding: 12px 18px; margin-bottom: 14px;
  border-radius: var(--radius); font-size: 15px;
}
.bubble--user {
  margin-left: auto; background: var(--blue); color: #fff;
  border-bottom-right-radius: 2px; white-space: pre-wrap;
}
.bubble--assistant {
  margin-right: auto; background: #fff; border: 1px solid var(--line);
  border-bottom-left-radius: 2px;
}
.bubble--assistant h1, .bubble--assistant h2, .bubble--assistant h3 {
  font-size: 16px; margin: 14px 0 6px; color: var(--ink);
}
.bubble--assistant p { margin: 8px 0; }
.bubble--assistant ul, .bubble--assistant ol { margin: 8px 0; padding-left: 22px; }
.thinking { color: var(--muted); font-style: italic; }

.chat__composer {
  display: flex; gap: 10px; padding: 14px;
  border-top: 1px solid var(--line); background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
}
.chat__composer textarea { flex: 1; resize: none; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
}
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 44px; text-align: center; max-width: 380px;
  box-shadow: 0 16px 40px rgba(20,30,40,.08);
}
.login-card h1 { font-size: 22px; margin: 14px 0 4px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

@media (max-width: 640px) {
  .reports th:nth-child(3), .reports td:nth-child(3) { display: none; }
  .chat { height: calc(100vh - 320px); }
}
