/* services/enlite-chat/src/enlite_chat/static/client.css
   Client pages only (client/templates/*.html): a light theme in the enlite.energy palette.
   On the chat page it is layered last, over the portal's style.css and the staff chat.css,
   so staff pages never load it. No web fonts: the CSP allows none from other origins. */
:root {
  --ink: #1c2f28;        /* enlite.energy ink-600: text and primary buttons */
  --ink-hover: #162520;  /* ink-700 */
  --accent: #2f6f63;     /* links, focus: 5.9:1 on white */
  --tint: #e3eee9;       /* ink-50: user bubble, active row */
  --bg: #fafaf9;         /* stone-50 */
  --card: #ffffff;
  --line: #e7e5e4;       /* stone-200 */
  --muted: #57534e;      /* stone-600: 7.4:1 on white */
  --red: #e63236;
  --font: Barlow, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); }
[hidden] { display: none !important; }  /* class display rules must not unhide */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons: dark pill (primary) and outlined pill (secondary). */
.btn, .req-dialog button[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 22px; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: #fff; font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none;
}
.btn:hover, .req-dialog button[type=submit]:hover { background: var(--ink-hover); }
.btn:disabled, .req-dialog button:disabled { opacity: .5; cursor: default; }
.btn-ghost, .req-dialog button[type=button] {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  font: 600 14px/1 var(--font); cursor: pointer;
}
.btn-ghost:hover, .req-dialog button[type=button]:hover { border-color: var(--ink); }

/* ---- Sign-in pages (login.html, verify.html) ---- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-top { padding: 20px 24px; }
.auth-top img { height: 34px; width: auto; display: block; }
.auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 48px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
             border-radius: 16px; padding: 32px 28px; box-shadow: 0 1px 2px rgba(28,47,40,.04), 0 8px 24px rgba(28,47,40,.06); }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.auth-card p { margin: 0 0 16px; }
.auth-lead { color: var(--muted); }
.auth-card label { display: block; margin: 8px 0 6px; font-weight: 600; font-size: 14px; }
.auth-card input[type=email] { display: block; width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 14px;
                               border: 1px solid #a8a29e; border-radius: 10px; background: #fff; color: var(--ink); font: 16px var(--font); }
.auth-card input[type=email]:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.auth-card .btn { width: 100%; margin-top: 16px; }
.auth-help { margin: 14px 0 0 !important; font-size: 13px; color: var(--muted); }
.auth-state { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; }
.auth-state p { margin: 0; }
.auth-state strong { display: block; margin-bottom: 2px; }
.auth-ok { background: var(--tint); }
.auth-warn { background: #fdf2f2; border-left: 3px solid var(--red); }
.auth-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--accent); }
.auth-warn .auth-dot { background: var(--red); }
.auth-who { font-size: 17px; }
.auth-foot { padding: 16px 24px 24px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---- Chat page (chat.html): light sidebar, no watermark ---- */
.chat-main::before { content: none; }
.content.chat-main { background: var(--bg); }
.sidebar { background: var(--card); border-right: 1px solid var(--line); }
.sidebar-header { padding: 18px 16px 14px; border-bottom: 1px solid var(--line); }
.sidebar-logo { width: 128px; display: block; margin: 0 auto; }
.sidebar .chat-new { margin: 10px 16px 4px; min-height: 40px; padding: 0 14px; border-radius: 999px;
                     border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px var(--font); }
.sidebar #new-chat { margin-top: 14px; background: var(--ink); border-color: var(--ink); color: #fff; }
.sidebar #new-chat:hover { background: var(--ink-hover); }
.sidebar #req-open:hover { border-color: var(--ink); }
.nav-links li a { color: #44403c; border-radius: 8px; margin: 1px 8px; padding: 8px 10px; font-size: 14px; }
.nav-links li a:hover { background: #f5f5f4; color: var(--ink); }
.nav-links li a.active { background: var(--tint); color: var(--ink); border-left: 0; padding-left: 10px; }
.chat-del { color: #78716c; }
.chat-clear { color: var(--muted); font-size: 13px; }
.chat-clear:hover { color: var(--ink); text-decoration: underline; }
.sidebar-footer { border-top: 1px solid var(--line); }
.logout-link { background: none; border: 0; padding: 4px 0; color: var(--muted); font: 13px var(--font); cursor: pointer; }
.logout-link:hover { color: var(--ink); text-decoration: underline; }

/* Logo on the chat area when the sidebar is hidden (phones, or collapsed with ☰). */
.client-top-logo { display: none; position: absolute; top: 10px; left: 54px; height: 26px; width: auto; z-index: 5; }
body.sidebar-collapsed .client-top-logo { display: block; left: 48px; top: 6px; }
body.sidebar-collapsed .chat-messages { padding-top: 48px; }
.chat-menu, .chat-menu:hover { background: var(--card) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }

.chat-empty { opacity: 1; color: var(--muted); }
.chat-empty h2 { color: var(--ink); font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.chat-msg { font-size: 15px; }
.chat-user { background: var(--tint); color: var(--ink); border-radius: 16px 16px 4px 16px; padding: 10px 16px; }
.chat-bot { background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 12px 18px; }
.chat-bot:has(> .chat-error):has(> .chat-body:empty) { background: none; border: 0; padding: 0; }
.chat-bot > .chat-error { background: #f5f5f4; color: #44403c; border-left: 3px solid var(--red);
                          border-radius: 10px; padding: 10px 14px; margin-top: 6px; font-size: 14px; }
.chat-thinking { color: var(--muted); }
.chat-progress { color: var(--muted); font-size: 13px; font-style: italic; }
.chat-body th, .chat-body td { border-color: var(--line); }
.chat-body th, .chat-body pre { background: #f5f5f4; }
.chat-notice { background: #fdf6dc; color: var(--ink); }
.chat-composer { border-top: 1px solid var(--line); background: var(--card); }
.chat-disclaimer { background: var(--card); color: var(--muted); }
.chat-composer textarea { border: 1px solid #a8a29e; border-radius: 14px; padding: 10px 14px; font: 15px var(--font); color: var(--ink); background: #fff; }
.chat-composer textarea:focus-visible { border-color: var(--accent); outline-offset: 1px; }
.chat-composer #send { min-height: 44px; border-radius: 999px; padding: 0 22px; background: var(--ink); color: #fff; font: 600 15px var(--font); }
.chat-composer #send:hover { background: var(--ink-hover); }
.chat-composer .chat-attach { color: var(--muted); }
.chat-file-chip { background: #f5f5f4; }

/* Request dialogs ("Send to Enerwhere", "My requests"); were inline in chat.html. */
.req-dialog { width: min(560px, 92vw); border: 1px solid var(--line); border-radius: 16px; padding: 24px; color: var(--ink); box-shadow: 0 16px 48px rgba(28,47,40,.18); }
.req-dialog h3 { margin-bottom: 8px; font-size: 19px; }
.req-dialog::backdrop { background: rgba(28,47,40,.35); }
.req-dialog label { display: block; margin: 12px 0; font-size: 14px; font-weight: 600; }
.req-dialog select, .req-dialog input:not([type=checkbox]), .req-dialog textarea {
  display: block; width: 100%; margin-top: 6px; padding: 8px 12px; font: 400 15px var(--font); color: var(--ink);
  border: 1px solid #a8a29e; border-radius: 10px; background: #fff; box-sizing: border-box; }
.req-dialog .req-check { font-weight: 400; }
.req-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.req-note, .req-head { font-size: 13px; color: var(--muted); }
.req-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.req-answer { white-space: pre-wrap; margin: 6px 0 0; }
#req-result:empty { display: none; }
#req-result { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--tint); }

@media (max-width: 768px) {
  .client-top-logo { display: block; }
  .sidebar { box-shadow: 4px 0 24px rgba(28,47,40,.15); }
  .chat-composer { padding: 10px 12px 8px; gap: 6px; }
  .chat-composer #send { padding: 0 16px; }
  .auth-card { padding: 24px 20px; }
  .auth-top { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
