/* frontend/css/styles.css — identidade visual eduCAT (cores e formas tiradas da logo) */

/* Fontes guardadas no próprio sistema (funcionam sem internet): títulos em Poppins, textos em Open Sans */
@font-face { font-family: 'Open Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/open-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/open-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/open-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
  --brand-petrol: #23607a;
  --brand-blue: #46c0f5;
  --brand-yellow: #f5c246;
  --brand-green: #87db55;
  --bg: #f1f7fb;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --text: #1d2a33;
  --text-muted: #5f7280;
  --border: #d5e2eb;
  --accent: #23607a;
  --accent-hover: #1a4b5f;
  --accent-soft: #e7f6fd;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --font-body: 'Open Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-title: 'Poppins', 'Open Sans', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
/* Faixa com as três cores das barrinhas da logo */
body::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--brand-blue) 0 33.34%, var(--brand-yellow) 33.34% 66.67%, var(--brand-green) 66.67% 100%);
}
/* Marca d'água: as três barras da logo, grandes, no meio da tela e bem suaves */
body::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 55%;
  width: min(58vmin, 560px);
  aspect-ratio: 157 / 170;
  transform: translate(-50%, -50%);
  background: url('../img/bars.svg') center / contain no-repeat;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}
.app-shell, .auth-screen, .org-picker { position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--font-title); font-weight: 700; color: var(--brand-petrol); margin: 0; }
:focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 2px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
.muted { color: var(--text-muted); font-size: 14px; }

.brand-logo { display: block; height: 40px; width: auto; }
.brand-logo.large { height: 60px; }
.brand-link { display: inline-block; line-height: 0; }

/* ---------- login ---------- */
.auth-screen { min-height: calc(100vh - 6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface-glass); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 8px 28px rgba(35, 96, 122, 0.12); }
.auth-card .brand-logo { height: 52px; margin: 0 auto 22px; }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; text-align: center; }
.auth-card .muted { text-align: center; margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.auth-card label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 10px; }

input[type="text"], input[type="email"], input[type="password"] {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; font: inherit; background: #fff;
}

button { cursor: pointer; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; padding: 11px 18px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; border: 1px solid var(--border); color: var(--text); padding: 10px 16px; }
.btn-secondary:hover { border-color: var(--brand-blue); }
.btn-primary:disabled { background: #b8c7cf; cursor: not-allowed; }
.link-button { display: inline-block; text-decoration: none; font-size: 14px; font-weight: 600; font-family: inherit; border-radius: 8px; }

.error-message { background: var(--danger-bg); color: var(--danger); border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* ---------- escolher organização ---------- */
.org-picker { min-height: calc(100vh - 6px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px; }
.org-picker .brand-logo { margin: 0 auto 18px; height: 60px; }
.org-grid { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.org-card { background: var(--surface-glass); border: 1px solid var(--border); border-radius: 12px; padding: 28px 36px; font-size: 16px; min-width: 160px; font-family: var(--font-title); font-weight: 600; color: var(--brand-petrol); border-top: 5px solid var(--brand-blue); cursor: pointer; }
.org-card:nth-child(3n+2) { border-top-color: var(--brand-yellow); }
.org-card:nth-child(3n+3) { border-top-color: var(--brand-green); }
.org-card:hover { border-color: var(--brand-petrol); box-shadow: 0 6px 18px rgba(35, 96, 122, 0.16); }
.org-picker-actions { display: flex; gap: 10px; align-items: center; justify-content: center; }

/* ---------- telas do sistema (chat e administração) ---------- */
.app-shell { max-width: 1040px; margin: 0 auto; padding: 24px 24px 40px; }
.app-header {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 26px; padding: 16px 22px;
  background: var(--surface-glass); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 6px 20px rgba(35, 96, 122, 0.08);
}
.header-left { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.header-title { border-left: 4px solid var(--brand-blue); padding-left: 18px; }
.header-title h1 { font-size: 22px; line-height: 1.2; }
.header-title .muted { margin: 4px 0 0; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-name { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

table { border-collapse: collapse; width: 100%; background: var(--surface-glass); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
th { color: var(--brand-petrol); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 14px 20px; border-bottom: 1px solid var(--border); }
td { padding: 14px 20px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

.chat-panel { background: var(--surface-glass); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-height: 360px; box-shadow: 0 4px 14px rgba(35, 96, 122, 0.06); }
.chat-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chat-hint { margin: auto; text-align: center; color: var(--text-muted); font-size: 14px; max-width: 360px; }
.chat-message { padding: 12px 14px; border-radius: 12px; max-width: 80%; line-height: 1.5; }
.chat-message.question { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-message.answer { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand-blue); border-bottom-left-radius: 4px; }
.chat-sources { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.chat-input-row { display: flex; gap: 8px; margin-top: 12px; }
.chat-input-row input { flex-grow: 1; }

[hidden] { display: none !important; }

.folder-list { display: flex; flex-direction: column; gap: 6px; }
.folder-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font-family: inherit; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-weight: 600; color: var(--text); }
.folder-item::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--brand-blue); }
.folder-item:nth-child(3n+2)::before { background: var(--brand-yellow); }
.folder-item:nth-child(3n+3)::before { background: var(--brand-green); }
.folder-item:hover { border-color: var(--brand-blue); }
.folder-item.active { background: var(--accent-soft); border-color: var(--brand-blue); color: var(--brand-petrol); box-shadow: inset 4px 0 0 var(--brand-blue); }
.empty-state { background: var(--surface-glass); border: 1px dashed var(--brand-blue); border-radius: 14px; padding: 44px 28px; text-align: center; color: var(--text-muted); }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; }
