/* ============================================================
   Área de membros — design FLAT / Material (sem sombras, bordas retas)
   ============================================================ */
:root {
  --ink: #14181f;
  --bg: #eceef1;
  --surface: #ffffff;
  --line: #d7dbe0;
  --line-2: #c4cad2;
  --text: #1c2128;
  --muted: #5b6673;
  --brand: #c8ff4d;
  --brand-ink: #10130a;
  --brand-dk: #b6ee36;
  --ok: #1b7a43; --ok-bg: #e7f4ec;
  --warn: #9a5b00; --warn-bg: #fbefdd;
  --bad: #b3261e; --bad-bg: #fbe9e7;
  --radius: 3px;
  --font: "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
b { font-weight: 700; }
img { max-width: 100%; display: block; }

/* ---------- tipografia ---------- */
.h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.h2 { font-size: 20px; font-weight: 700; }
.h3 { font-size: 16px; font-weight: 700; }
.lead { font-size: 16px; color: var(--muted); margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1;
  padding: 12px 20px; border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-dk); }
.btn--accent { background: var(--ink); color: #fff; }
.btn--accent:hover { background: #232a34; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { background: #f2f4f6; border-color: var(--muted); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- inputs ---------- */
.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 11px 12px; transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); }
.textarea { resize: vertical; min-height: 96px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ---------- cards / layout ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 20px;
}
.card--narrow { max-width: 440px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 26px 18px 60px; }

/* ---------- topbar ---------- */
.topbar {
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; height: 58px;
}
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__user { font-size: 13.5px; color: #c7ccd4; }
.topbar .btn--ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.topbar .btn--ghost:hover { background: rgba(255,255,255,.08); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  background: var(--brand); color: var(--brand-ink); border-radius: var(--radius);
}
.brand--sm .brand__mark { width: 30px; height: 30px; }
.brand__txt { font-weight: 800; font-size: 14px; letter-spacing: .04em; line-height: 1.1; display: flex; flex-direction: column; }
.brand__txt em { font-style: normal; font-weight: 500; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.topbar .brand__txt em { color: #aab1bb; }

/* ---------- tela de login ---------- */
.auth-body { background: var(--bg); min-height: 100vh; }
.auth { max-width: 440px; margin: 0 auto; padding: 40px 18px 60px; }
.auth .brand { margin-bottom: 22px; }
.cta-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 3px solid var(--brand); padding: 22px;
}
.cta-box__txt { margin-bottom: 14px; }
.cta-box__txt b { display: block; font-size: 16px; }
.cta-box__txt span { color: var(--muted); font-size: 14px; }

/* ---------- alerts ---------- */
.alert { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert--error { background: var(--bad-bg); color: var(--bad); border-color: #f3c9c4; }
.alert--warn { background: var(--warn-bg); color: var(--warn); border-color: #eacfa0; }
.alert code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 2px; }

/* ---------- credenciais ---------- */
.cred { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.cred--flash { border-left-color: var(--ok); background: var(--ok-bg); }
.cred__title { font-weight: 700; margin-bottom: 14px; }
.cred__grid { display: grid; gap: 8px; margin-bottom: 14px; }
.cred__row { display: flex; gap: 12px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.cred__row span { font-size: 12px; color: var(--muted); min-width: 110px; text-transform: uppercase; letter-spacing: .04em; }
.cred__row b { font-size: 15px; font-family: ui-monospace, Consolas, monospace; }
.loglist { list-style: none; margin: 14px 0; }
.loglist li { padding: 6px 0 6px 22px; position: relative; color: var(--muted); }
.loglist li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* ---------- tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--brand); }
.tab__count { display: inline-block; font-size: 12px; background: #eef0f3; color: var(--muted); border-radius: 2px; padding: 1px 7px; margin-left: 4px; }
.tab.is-active .tab__count { background: var(--ink); color: #fff; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 2px; }
.badge.is-ok { background: var(--ok-bg); color: var(--ok); }
.badge.is-warn { background: var(--warn-bg); color: var(--warn); }
.badge.is-bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- tabela ---------- */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.empty { text-align: center; padding: 30px 0; }

/* ---------- detalhe (kv) ---------- */
.detail__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kv__row { background: var(--surface); padding: 12px 14px; }
.kv__row dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.kv__row dd { font-size: 14.5px; }
.detail__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.detail__actions form { margin: 0; }

/* ---------- área do aluno ---------- */
.hero-aluno { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 30px 26px; margin-bottom: 20px; }
.hero-aluno .h1 { color: #fff; }
.hero-aluno .lead { color: #c7ccd4; }
.hero-aluno .lead b { color: var(--brand); }
.projeto { font-size: 16px; font-weight: 600; }
.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tile { margin-bottom: 0; }
.tile__ic { font-size: 24px; display: block; margin-bottom: 8px; }
.tile .h3 { margin-bottom: 4px; }

/* ---------- responsivo ---------- */
@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .detail__head { flex-direction: column; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; }
  .table td { border: none; padding: 7px 14px; display: flex; justify-content: space-between; gap: 14px; }
  .table td::before { content: attr(data-l); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
  .table td[data-l=""]::before { display: none; }
}

/* ============================================================
   PLATAFORMA (mural, aulas, agenda, perfil)
   ============================================================ */

/* ---------- nav da plataforma ---------- */
.topbar--nav { display: block; height: auto; padding: 0; }
.topbar__bar { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; height: 56px; max-width: 980px; margin: 0 auto; }
.topbar__me { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 13.5px; font-weight: 600; }
.topbar__me-name { color: #e7e9ec; }
.mainnav { display: flex; gap: 2px; padding: 0 10px; max-width: 980px; margin: 0 auto; overflow-x: auto; border-top: 1px solid rgba(255,255,255,.08); }
.mainnav__a { padding: 12px 14px; font-size: 14px; font-weight: 600; color: #aab1bb; border-bottom: 2px solid transparent; white-space: nowrap; }
.mainnav__a:hover { color: #fff; }
.mainnav__a.is-active { color: #fff; border-bottom-color: var(--brand); }

/* ---------- utilidades ---------- */
.is-hidden { display: none !important; }

/* ---------- avatar ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: #d7dce2 no-repeat center/cover; color: var(--ink); font-weight: 700; overflow: hidden; }
.avatar--txt { background: var(--ink); color: var(--brand); }

/* ---------- cabeçalhos de página ---------- */
.wrap--feed { max-width: 680px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 12px; }
.section-label--muted { color: var(--line-2); }
.back { display: inline-block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.back:hover { color: var(--text); }

/* ---------- mural / feed ---------- */
.composer__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.composer__foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.post { padding: 18px 20px; }
.post__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post__author { font-weight: 700; display: block; line-height: 1.2; }
.post__author:hover { text-decoration: underline; }
.post__time { font-size: 12.5px; color: var(--muted); }
.post__body { font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.post__comments { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.cmt { display: flex; gap: 8px; margin-bottom: 10px; }
.cmt__bubble { background: #f2f4f6; border-radius: var(--radius); padding: 8px 12px; flex: 1; }
.cmt__author { font-weight: 700; font-size: 13.5px; }
.cmt__author:hover { text-decoration: underline; }
.cmt__time { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.cmt__bubble > div { font-size: 14px; margin-top: 2px; word-wrap: break-word; }
.cmt-form { display: flex; align-items: center; gap: 8px; }
.cmt-form .input { flex: 1; padding: 8px 12px; }
.cmt-form--block { margin-bottom: 16px; }

/* ---------- aulas ---------- */
.aulas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.aula-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color .15s; }
.aula-card:hover { border-color: var(--line-2); }
.aula-card__thumb { position: relative; aspect-ratio: 16/9; background: var(--ink); display: grid; place-items: center; }
.aula-card__play { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 16px; padding-left: 3px; }
.aula-card__num { position: absolute; top: 10px; left: 10px; font-size: 11.5px; font-weight: 700; color: #cfd4da; }
.aula-card__done { position: absolute; top: 10px; right: 10px; font-size: 11.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand); padding: 2px 8px; border-radius: 2px; }
.aula-card__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.aula-card__title { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.aula-card__desc { font-size: 13.5px; color: var(--muted); }
.aula-card__meta { margin-top: auto; display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); padding-top: 6px; }

/* ---------- player / watch ---------- */
.wrap--watch { max-width: 860px; }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.watch-meta { display: flex; gap: 14px; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.watch-desc { white-space: pre-wrap; font-size: 15px; }
.btn--ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cc; }

/* ---------- avaliação (estrelas) ---------- */
.rate { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.stars { display: inline-flex; align-items: center; gap: 4px; }
.star { background: none; border: none; font-size: 26px; line-height: 1; color: #d3d8de; cursor: pointer; padding: 0 2px; transition: color .12s, transform .12s; }
.star:hover, .star.is-hover, .star.is-on { color: #f5b301; }
.star:active { transform: scale(1.2); }
.rate__hint { font-size: 13px; color: var(--muted); }
.comments-title { display: block; margin-bottom: 14px; }

/* ---------- agenda ---------- */
.ev-list { display: flex; flex-direction: column; gap: 12px; }
.ev { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); padding: 16px; }
.ev--past { border-left-color: var(--line-2); opacity: .85; }
.ev__date { flex: none; width: 58px; text-align: center; border-right: 1px solid var(--line); padding-right: 14px; }
.ev__date b { display: block; font-size: 26px; font-weight: 800; line-height: 1; }
.ev__date span { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ev__title { font-size: 16px; font-weight: 700; }
.ev__when { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.ev__desc { font-size: 14px; white-space: pre-wrap; margin-bottom: 10px; }
.ev__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ev__actions form { margin: 0; }

/* ---------- perfil / ficha ---------- */
.perfil-foto-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ficha__top { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.ficha__id { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ficha__id .h1 { margin: 0; }
.ficha__bloco { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.ficha__bloco p { white-space: pre-wrap; margin-top: 4px; }

.alert--ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cc; }

@media (max-width: 640px) {
  .aulas-grid { grid-template-columns: 1fr 1fr; }
  .watch-head { flex-direction: column; }
  .ev__date { width: 48px; }
  .ficha__top { flex-direction: column; align-items: flex-start; text-align: left; }
}
@media (max-width: 400px) {
  .aulas-grid { grid-template-columns: 1fr; }
}

/* ---------- menção destacada no texto ---------- */
.mention { color: var(--ink); font-weight: 700; background: var(--brand); border-radius: 2px; padding: 0 3px; }

/* ---------- botão excluir (admin) ---------- */
.del-form { margin: 0; }
.del-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: var(--radius); }
.del-btn:hover { color: var(--bad); background: var(--bad-bg); }
.del-btn--sm { font-size: 12px; padding: 2px 5px; }
.post__head-id { flex: 1; min-width: 0; }
.cmt__bubble { position: relative; }
.del-form--cmt { position: absolute; top: 4px; right: 4px; }

/* ---------- composer ---------- */
.composer__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.composer__hint { font-size: 12.5px; color: var(--muted); }
.composer__hint b { color: var(--text); }

/* ---------- sino de notificações ---------- */
.bell { position: relative; }
.bell__btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: none; background: transparent; color: #e7e9ec; border-radius: var(--radius); cursor: pointer; }
.bell__btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.bell__badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; line-height: 1; }
.bell__panel { position: absolute; top: calc(100% + 8px); right: 0; width: min(340px, 92vw); max-height: 440px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); z-index: 200; color: var(--text); }
.bell__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.bell__head b { font-size: 14px; }
.bell__head a { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bell__head a:hover { color: var(--ink); }
.bell__empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.bell__item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.bell__item:last-child { border-bottom: none; }
.bell__item:hover { background: #f5f6f8; }
.bell__item.is-unread { background: #f3fae6; }
.bell__item.is-unread:hover { background: #ecf6d7; }
.bell__txt { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; line-height: 1.35; }
.bell__trecho { color: var(--muted); font-style: italic; }
.bell__time { font-size: 11.5px; color: var(--muted); }

/* ---------- autocomplete de menções ---------- */
.mention-wrap { position: relative; display: block; }
.cmt-form .mention-wrap { flex: 1; }
.mention-wrap .input, .mention-wrap .textarea { width: 100%; }
.mention-box { position: absolute; top: calc(100% + 2px); left: 0; min-width: 240px; max-width: 320px; max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); z-index: 60; }
.mention-item { padding: 9px 12px; font-size: 13.5px; cursor: pointer; display: flex; gap: 6px; align-items: baseline; }
.mention-item span { color: var(--muted); font-size: 12.5px; }
.mention-item.is-active, .mention-item:hover { background: var(--brand); color: var(--brand-ink); }
.mention-item.is-active span, .mention-item:hover span { color: var(--brand-ink); }
