/* Portal do Aluno — FP Institute
   Design system herdado da Calculadora de Precificação FP (accent #fd2d55 → #fd6403). */

:root {
  --background: #fbfcfd;
  --foreground: #16181d;
  --card: #ffffff;
  --card-2: #f9fafb;
  --muted: #f3f4f6;
  --muted-foreground: #646972;
  --border: #e4e5e8;
  --primary: #fd2d55;
  --primary-2: #fd6403;
  --primary-hover: #fd4733;
  --primary-foreground: #fbfbfb;
  --primary-soft: rgb(253 45 85 / 0.12);
  --primary-soft-2: rgb(253 45 85 / 0.22);
  --brand-gradient: linear-gradient(90deg, #fd2d55, #fd6403, #fd2d55);
  --positive: #157f5b;
  --positive-soft: rgb(21 127 91 / 0.12);
  --warning: #a76300;
  --warning-soft: rgb(167 99 0 / 0.12);
  --negative: #c2183c;
  --negative-soft: rgb(194 24 60 / 0.12);
  --radius: 0.625rem;
  --radius-lg: 0.875rem;
  --shadow: 0 1px 2px rgb(22 24 29 / 0.05), 0 8px 24px -16px rgb(22 24 29 / 0.25);
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html { font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@keyframes brand-pan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ============================= LOGIN ============================= */

/* No celular a página inteira é o gradiente e a ordem é: marca, formulário e,
   por último, o texto de apresentação. No desktop volta a ser duas colunas. */
.login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--brand-gradient);
  background-size: 200% 100%;
  animation: brand-pan 9s ease-in-out infinite;
  color: var(--primary-foreground);
  text-align: center;
}

.login__lado { display: contents; }          /* no celular, os filhos é que valem */
.login__brand { order: 1; }
.login__panel { order: 2; }
.login__sobre { order: 3; }

.login__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 24px 8px;
}

.login__brand img { width: 96px; height: auto; filter: brightness(0) invert(1); }
.login__brand h1 { font-size: 1.6rem; line-height: 1.15; max-width: 18ch; }

.login__course {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgb(255 255 255 / 0.35);
  font-size: 1rem;
  font-weight: 700;
  opacity: 0.96;
}

.login__sobre {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 24px 44px;
}

.login__sobre p { max-width: 46ch; margin: 0 auto; font-size: 0.92rem; opacity: 0.92; }

.login__list { display: grid; gap: 8px; margin: 0 auto; padding: 0; list-style: none; }

.login__list li {
  display: flex;
  gap: 9px;
  align-items: baseline;
  justify-content: center;
  font-size: 0.87rem;
  opacity: 0.94;
}

.login__list li::before { content: "—"; opacity: 0.7; }

.login__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px 24px;
}

@media (min-width: 940px) {
  .login {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    text-align: left;
  }

  /* a coluna da marca fica centralizada na tela, mas com o texto à esquerda */
  .login__lado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 48px 44px;
  }

  .login__brand, .login__sobre { width: 100%; max-width: 30rem; padding: 0; }
  .login__brand { align-items: flex-start; gap: 18px; }
  .login__brand img { width: 118px; }
  .login__brand h1 { font-size: 2rem; }
  .login__sobre p { margin: 0; }
  .login__list { margin: 0; }
  .login__list li { justify-content: flex-start; }

  /* o lado do formulário volta a ser claro */
  .login__panel {
    padding: 40px 24px;
    background: var(--background);
    color: var(--foreground);
  }
}

/* no celular o formulário é um cartão branco sobre o gradiente */
.login__box {
  width: 100%;
  max-width: 380px;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 18px 40px -22px rgb(22 24 29 / 0.5);
  text-align: left;
}

@media (min-width: 940px) {
  .login__box { padding: 0; border-radius: 0; background: none; box-shadow: none; }
}

.login__box h2 { font-size: 1.35rem; }
.login__box > p { margin-top: 6px; color: var(--muted-foreground); font-size: 0.88rem; }
.login__form { display: grid; gap: 14px; margin-top: 24px; }
.login__form .btn { width: 100%; min-height: 44px; }

.login__foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.78rem;
}

.login__foot .link { color: var(--primary); font-weight: 700; text-decoration: none; }
.login__foot .link:hover { text-decoration: underline; }

.login__foot code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--muted);
  font-size: 0.95em;
}

/* ============================= SHELL ============================= */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  border-right: 1px solid var(--border);
  background: var(--card);
  transition: transform 200ms ease;
}

.sidebar__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar__head img { width: 46px; height: auto; flex: none; }
.sidebar__head strong { display: block; font-size: 0.92rem; line-height: 1.2; }
.sidebar__head span { color: var(--muted-foreground); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 14px 12px; }

.nav__group { margin-bottom: 4px; }

.nav__label {
  padding: 14px 10px 6px;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.nav__item:hover { background: var(--muted); }
.nav__item--active { background: var(--primary-soft); color: var(--primary); }
.nav__item svg { width: 17px; height: 17px; flex: none; }
.nav__item--sub { padding-left: 38px; font-weight: 500; font-size: 0.845rem; }
.nav__item--sub svg { display: none; }   /* no menu aberto o submenu é só texto recuado */
.nav__item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* grupo recolhível ("Sua pós") */
.nav__chevron {
  width: 15px;
  height: 15px;
  flex: none;
  margin-left: auto;
  color: var(--muted-foreground);
  transition: transform 180ms ease, color 140ms ease;
}

.nav__group--aberto > .nav__item--pai { color: var(--primary); }
.nav__group--aberto .nav__chevron { transform: rotate(90deg); color: var(--primary); }

.nav__sub {
  display: grid;
  gap: 2px;
  margin: 2px 0 2px 20px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.nav__sub .nav__item--sub { padding-left: 10px; }

.sidebar__foot { padding: 12px; border-top: 1px solid var(--border); }

.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--card-2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 999px;
  background: var(--brand-gradient);
  color: var(--primary-foreground);
  font-size: 0.78rem;
  font-weight: 800;
}

.userchip__txt { min-width: 0; }
.userchip__txt strong { display: block; overflow: hidden; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.userchip__txt span { color: var(--muted-foreground); font-size: 0.7rem; }

/* onde os dados estão sendo gravados — evita confundir os dois modos */
.modo {
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.modo--banco { background: var(--positive-soft); color: var(--positive); }
.modo--local { background: var(--warning-soft); color: var(--warning); }
.shell--recolhido .modo { padding: 5px 2px; font-size: 0; }
.shell--recolhido .modo::first-letter { font-size: 0.9rem; }

.sidebar__foot .btn { width: 100%; margin-top: 8px; }
#btnSair { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#btnSair svg { width: 16px; height: 16px; flex: none; }

.sidebar__backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgb(22 24 29 / 0.45);
}

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); transition: margin-left 200ms ease; }

/* menu recolhido pelo ☰ (telas largas): vira uma barra só de ícones.
   O nome de cada item continua no `title`, então aparece ao passar o mouse. */
.shell--recolhido { --sidebar-w: 72px; }
.shell--recolhido .sidebar__head { justify-content: center; padding: 18px 8px; }
.shell--recolhido .sidebar__head img { width: 34px; }
.shell--recolhido .sidebar__head > div,
.shell--recolhido .nav__item > span,
.shell--recolhido .nav__label,
.shell--recolhido .nav__chevron,
.shell--recolhido .userchip__txt,
.shell--recolhido #btnSair span { display: none; }

.shell--recolhido .sidebar__nav { padding: 12px 8px; }
.shell--recolhido .nav__item { justify-content: center; gap: 0; padding: 11px 0; }
.shell--recolhido .nav__item svg { width: 19px; height: 19px; }

/* no menu recolhido o submenu vira ícone também, sem recuo */
.shell--recolhido .nav__sub { margin: 0; padding: 0; border: 0; }
.shell--recolhido .nav__sub .nav__item--sub { padding: 11px 0; font-size: 0.845rem; }
.shell--recolhido .nav__item--sub svg { display: block; }

.shell--recolhido .userchip { justify-content: center; padding: 0; }
.shell--recolhido .sidebar__foot { padding: 10px 8px; }
.shell--recolhido #btnSair { padding: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 26px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.topbar__text { min-width: 0; }
.topbar__text h1 { font-size: 1.15rem; }
.topbar__text p { color: var(--muted-foreground); font-size: 0.83rem; }
.topbar__actions { display: flex; flex: none; gap: 8px; margin-left: auto; }

.burger { display: inline-flex; }   /* recolhe o menu em qualquer tamanho de tela */

.page { max-width: 1180px; padding: 24px 26px 72px; }

/* ============================= BOTÕES ============================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
    filter 160ms ease, box-shadow 160ms ease;
}

.btn:hover { background: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost { background: transparent; }
.btn--danger:hover { border-color: var(--negative); color: var(--negative); }
.btn--sm { min-height: 32px; padding: 0 10px; font-size: 0.79rem; }

.btn--soft { border-color: transparent; background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover { background: var(--primary-soft-2); }

.btn--primary {
  border-color: transparent;
  background: var(--brand-gradient);
  background-size: 200% 100%;
  animation: brand-pan 6s ease-in-out infinite;
  color: var(--primary-foreground);
}

/* Redeclara o gradiente porque `.btn:hover` (0,2,0) vence `.btn--primary` (0,1,0)
   e o shorthand `background` limparia a imagem de fundo. */
.btn--primary:hover {
  background: var(--brand-gradient);
  background-size: 200% 100%;
  color: var(--primary-foreground);
  filter: brightness(1.07) saturate(1.05);
  box-shadow: 0 6px 18px -8px rgb(253 45 85 / 0.65);
}

.btn--primary:active { filter: brightness(0.96); box-shadow: none; }

.btn--icon {
  min-height: 32px;
  width: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 1rem;
  line-height: 1;
}

.btn--icon:hover { background: var(--primary-soft); color: var(--primary); }

/* ============================= CARDS ============================= */

.card {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.card__head > div { min-width: 0; }
.card__head h2 { font-size: 1.05rem; }
.card__head h3 { font-size: 0.95rem; }
.card__head p { margin-top: 4px; max-width: 72ch; color: var(--muted-foreground); font-size: 0.86rem; }
.card__head .btn { flex: none; margin-left: auto; }

.card--flat { box-shadow: none; background: var(--card-2); }

.step {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient);
  background-size: 200% 100%;
  animation: brand-pan 8s ease-in-out infinite;
  color: var(--primary-foreground);
}

.hero__avatar {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
  font-size: 1.25rem;
  font-weight: 800;
}

.hero span { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; }
.hero h2 { font-size: 1.5rem; line-height: 1.2; }
.hero p { margin-top: 3px; font-size: 0.87rem; opacity: 0.92; }

/* ============================= GRIDS / STATS ============================= */

.grid { display: grid; gap: 14px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}

.stat span { color: var(--muted-foreground); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.stat strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat small { color: var(--muted-foreground); font-size: 0.76rem; }

.stat--highlight {
  border-color: transparent;
  background: var(--brand-gradient);
  background-size: 200% 100%;
  animation: brand-pan 6s ease-in-out infinite;
  color: var(--primary-foreground);
}

.stat--highlight span, .stat--highlight small { color: rgb(255 255 255 / 0.88); }

/* ============================= FORMULÁRIOS ============================= */

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.fields--1 { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field > span { color: var(--muted-foreground); font-size: 0.78rem; font-weight: 600; }
.field small { color: var(--muted-foreground); font-size: 0.74rem; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 0.92rem;
}

textarea { min-height: 84px; resize: vertical; }

/* campo de senha com o olho de mostrar/ocultar (montado pelo js/ui.js) */
.campo-senha { position: relative; display: flex; min-width: 0; }
.campo-senha input { padding-right: 44px; }

.campo-senha__olho {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--muted-foreground);
  cursor: pointer;
}

.campo-senha__olho:hover { background: var(--muted); color: var(--primary); }
.campo-senha__olho svg { width: 18px; height: 18px; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

input:disabled, select:disabled { background: var(--muted); color: var(--muted-foreground); }

/* linha editável repetível (avaliações de nota, perguntas da avaliação institucional):
   flex para o botão ✕ ficar ao lado do último campo, não numa linha própria. */
.linha-din {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.linha-din:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.linha-din .field { flex: 1 1 160px; min-width: 0; }

.linha-din__x {
  width: 40px;
  min-height: 40px;
  flex: none;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.linha-din__x:hover { border-color: var(--negative); background: var(--negative-soft); color: var(--negative); }

@media (max-width: 620px) {
  .linha-din .field { flex: 1 1 100%; }
  .linha-din__x { width: 100%; }
}

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.form-actions--end { justify-content: flex-end; }

.check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.check input { width: auto; min-height: 0; }

/* ============================= TABELAS ============================= */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }

.table th, .table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table tbody tr:hover { background: var(--card-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 800; }
.table .col-acao { width: 96px; text-align: right; white-space: nowrap; }
.table td .btn--icon { vertical-align: middle; }

/* ============================= BADGES ============================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge--brand { background: var(--primary-soft); color: var(--primary); }
.badge--ok { background: var(--positive-soft); color: var(--positive); }
.badge--warn { background: var(--warning-soft); color: var(--warning); }
.badge--bad { background: var(--negative-soft); color: var(--negative); }

.positive { color: var(--positive); font-weight: 700; }
.negative { color: var(--negative); font-weight: 700; }

/* ============================= LISTAS / VAZIO ============================= */

.empty {
  padding: 26px 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  text-align: center;
  font-size: 0.88rem;
}

.empty strong { display: block; margin-bottom: 4px; color: var(--foreground); font-size: 0.95rem; }

.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.tile__top { display: flex; align-items: flex-start; gap: 10px; }
.tile__top h3 { font-size: 1rem; }
.tile__top .badge { margin-left: auto; flex: none; }
.tile__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted-foreground); font-size: 0.8rem; }
.tile__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }

/* ============================= ABAS ============================= */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover { color: var(--foreground); }
.tab--active { border-bottom-color: var(--primary); color: var(--primary); }

/* ============================= SANFONA (módulos) ============================= */

.acc { display: grid; gap: 8px; }

.acc__item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: border-color 160ms ease;
}

.acc__item--aberto { border-color: var(--primary-soft-2); }
.acc__item--atual { border-left: 3px solid var(--primary); }

.acc__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.acc__head:hover { background: var(--card-2); }
.acc__head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.acc__num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--radius);
  background: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.acc__item--aberto .acc__num, .acc__item--atual .acc__num { background: var(--primary-soft); color: var(--primary); }

.acc__title { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 700; }
.acc__head .badge { flex: none; }

.acc__chevron {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted-foreground);
  transition: transform 180ms ease;
}

.acc__item--aberto .acc__chevron { transform: rotate(90deg); color: var(--primary); }

.acc__body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.acc__body > .grid { margin-top: 14px; }

.trilha {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}

.trilha--dentista { border-color: rgb(167 99 0 / 0.35); background: var(--warning-soft); }
.trilha p { margin-top: 8px; font-size: 0.88rem; }
.trilha__quem { color: var(--muted-foreground); font-size: 0.78rem !important; font-weight: 500; }

/* ============================= CALENDÁRIO ============================= */

.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }

.month {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.month__name {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.month--empty .month__name { color: var(--muted-foreground); }
.month__empty { color: var(--muted-foreground); font-size: 0.8rem; }

.evt { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.evt:last-child { border-bottom: 0; }

.evt__day {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--radius);
  background: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}

.evt__day small { display: block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; opacity: 0.7; }
.evt--aula .evt__day { background: var(--primary-soft); color: var(--primary); }
.evt--prova .evt__day { background: var(--negative-soft); color: var(--negative); }
.evt--entrega .evt__day { background: var(--warning-soft); color: var(--warning); }
.evt--evento .evt__day { background: var(--positive-soft); color: var(--positive); }
.evt__txt { min-width: 0; }
.evt__txt strong { display: block; font-size: 0.87rem; font-weight: 700; }
.evt__txt span { color: var(--muted-foreground); font-size: 0.78rem; }

/* ============================= AVALIAÇÃO INSTITUCIONAL ============================= */

.q { padding: 16px 0; border-bottom: 1px solid var(--border); }
.q:last-of-type { border-bottom: 0; }
.q__txt { margin-bottom: 10px; font-size: 0.92rem; font-weight: 700; }
.q__txt em { display: block; margin-top: 2px; color: var(--muted-foreground); font-size: 0.78rem; font-style: normal; font-weight: 500; }

/* ============ HISTÓRICO DO ALUNO (sanfona por módulo) ============ */

.hist { display: grid; gap: 6px; }

.hist__item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.hist__item--aberto { border-color: var(--primary-soft-2); }
.hist__item--parado { background: var(--card-2); }

.hist__linha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.hist__linha--btn { cursor: pointer; }
.hist__linha--btn:hover { background: var(--card-2); }
.hist__linha--btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.hist__mod { flex: 1 1 260px; min-width: 0; font-size: 0.89rem; }
.hist__mod strong { font-weight: 800; }
.hist__num { width: 62px; text-align: right; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.hist__num.strong { font-weight: 800; }
.hist__sit { width: 132px; text-align: right; }

.hist__chevron {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--muted-foreground);
  transition: transform 160ms ease;
}

.hist__item--aberto .hist__chevron { transform: rotate(90deg); color: var(--primary); }

.hist__corpo { padding: 4px 14px 14px; border-top: 1px solid var(--border); }

.hist__aviso {
  margin: 12px 0;
  padding: 11px 13px;
  border-left: 3px solid var(--negative);
  border-radius: var(--radius);
  background: var(--negative-soft);
  font-size: 0.85rem;
}

/* uma tentativa do módulo */
.tent {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}

.tent--atual { border-color: var(--primary-soft-2); background: var(--card); }

.tent__topo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tent__topo strong { font-size: 0.88rem; }
.tent__media { margin-left: auto; color: var(--muted-foreground); font-size: 0.8rem; }

.tent__lista { margin: 11px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }

.tent__lista li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.85rem;
}

.tent__lista li:last-child { border-bottom: 0; }
.tent__lista li span { flex: 1; min-width: 0; }
.tent__lista li strong { font-variant-numeric: tabular-nums; }

.tent__vazio { margin-top: 10px; color: var(--muted-foreground); font-size: 0.83rem; }

.tent__dias { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 11px; }
.tent__dia { display: flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 0.79rem; }
.tent__dia .ponto { width: 11px; height: 11px; cursor: default; }

.tent__obs { margin-top: 11px; font-size: 0.83rem; color: var(--muted-foreground); }

@media (max-width: 720px) {
  .hist__mod { flex: 1 1 100%; }
  .hist__num, .hist__sit { width: auto; text-align: left; }
  .tent__media { margin-left: 0; flex: 1 1 100%; }
}

.bar { height: 7px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand-gradient); }

/* ============================= MODAL ============================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(22 24 29 / 0.5);
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 620px;
  margin: auto;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 24px 60px -20px rgb(22 24 29 / 0.4);
}

.modal--lg { max-width: 860px; }

.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal__head h2 { font-size: 1.02rem; }
.modal__head p { margin-top: 2px; color: var(--muted-foreground); font-size: 0.82rem; }
.modal__head .btn--icon { margin-left: auto; }
.modal__body { padding: 20px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* ============================= PRESENÇA ============================= */

.hint-inline { align-self: center; color: var(--muted-foreground); font-size: 0.8rem; }

.tabs--sm { margin: 0 0 14px; gap: 4px; }
.tabs--sm .tab { padding: 8px 12px; font-size: 0.84rem; }
.tabs--sm .tab .badge { margin-left: 6px; }

/* seletor da tentativa, embaixo do nome de quem está refazendo */
.sel-tentativa {
  width: auto;
  min-height: 26px;
  margin-top: 4px;
  padding: 2px 22px 2px 8px !important;
  border-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.72rem !important;
  font-weight: 700;
}

/* aviso no topo do modal quando o módulo já foi aprovado */
.lancamento-fechado {
  padding: 11px 14px;
  margin-bottom: 16px;
  border-left: 3px solid var(--positive);
  border-radius: var(--radius);
  background: var(--positive-soft);
  font-size: 0.86rem;
}

.sub-titulo {
  margin: 18px 0 8px;
  color: var(--muted-foreground);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* os três dias do encontro, em lista */
.lista-dias { display: grid; gap: 8px; margin-top: 16px; }

.dia {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}

.dia--aberta { border-left: 3px solid var(--positive); background: var(--card); }
.dia > strong { font-size: 0.9rem; }
.dia__data { color: var(--muted-foreground); font-size: 0.83rem; font-variant-numeric: tabular-nums; }
.dia__contagem { color: var(--muted-foreground); font-size: 0.79rem; }

.dia__acoes { position: relative; display: flex; gap: 4px; margin-left: auto; }
.dia__acoes .btn--icon { width: 34px; min-height: 34px; border: 1px solid var(--border); }

/* o campo do link fica fora da vista, mas precisa existir para a cópia
   funcionar quando o portal roda em file:// (sem a API de clipboard) */
.dia__link {
  position: absolute;
  left: -9999px;
  width: 320px;
  opacity: 0;
}

@media (max-width: 620px) {
  .dia__contagem { flex: 1 1 100%; }
  .dia__acoes { margin-left: auto; }
}

/* legenda das bolinhas */
.legenda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-bottom: 12px;
  color: var(--muted-foreground);
  font-size: 0.79rem;
}

.legenda span { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.legenda em { font-style: normal; opacity: 0.8; }
.legenda .ponto { width: 13px; height: 13px; cursor: default; }

/* bolinha de presença */
.ponto {
  display: inline-block;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 140ms ease;
}

button.ponto:hover { transform: scale(1.18); }
button.ponto:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.ponto--ok { background: var(--positive); }
.ponto--vazio { background: #e8b21f; }
.ponto--falta { background: var(--negative); }
.ponto--just { background: #e8b21f; border-color: var(--positive); }

/* quem assinou no check-in ganha um anel claro em volta */
.ponto--assinado { box-shadow: 0 0 0 3px var(--card), 0 0 0 4.5px currentColor; }
.ponto--assinado.ponto--ok { color: var(--positive); }
.ponto--assinado.ponto--falta { color: var(--negative); }
.ponto--assinado.ponto--vazio, .ponto--assinado.ponto--just { color: #e8b21f; }

/* balão com a assinatura ao passar o mouse */
.balao-ass {
  position: fixed;
  z-index: 90;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 30px -12px rgb(22 24 29 / 0.4);
  pointer-events: none;
}

.balao-ass__txt { color: var(--muted-foreground); font-size: 0.7rem; white-space: nowrap; }

.table--presenca { min-width: 640px; }
.table--presenca .cel-presenca { text-align: center; white-space: nowrap; }
.table--presenca thead th { vertical-align: bottom; }

.aluno-cel { display: flex; align-items: center; gap: 8px; }
.aluno-cel > div { min-width: 0; }

.card__acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.card__acoes .btn { margin-left: 0; }

/* avisa que a tela se atualiza sozinha */
.ao-vivo {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--positive-soft);
  color: var(--positive);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: default;
}

@keyframes pulsa-vivo { 50% { opacity: 0.35; } }
.ao-vivo::first-letter { animation: pulsa-vivo 2s ease-in-out infinite; }

.btn--assinatura {
  width: 32px;
  min-height: 32px;
  flex: none;
  margin-left: auto;
  border: 1px solid var(--border);
  color: var(--positive);
}

/* bloco de frequência do modal de notas: módulo + os três dias do encontro */
.freq { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.freq__modulo { flex: 1 1 320px; }
.freq__manual { flex: 0 1 200px; }

/* os três dias ficam lado a lado, um por coluna */
.freq__dias {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}

.freq__dia { display: flex; flex: 1 1 170px; align-items: center; gap: 10px; min-width: 0; }
.freq__dia-txt { min-width: 0; }
.freq__dia-txt strong { display: block; font-size: 0.87rem; }
.freq__dia-txt span { display: block; color: var(--muted-foreground); font-size: 0.76rem; }
.freq__checkin { display: block; color: var(--positive); font-size: 0.72rem; font-weight: 600; }

.freq__rodape {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 10px;
}

.legenda--sm { margin: 0; font-size: 0.75rem; }
.legenda--sm .ponto { width: 11px; height: 11px; }

.freq__resumo {
  margin-left: auto;
  color: var(--muted-foreground);
  font-size: 0.84rem;
}

.freq__resumo strong { color: var(--foreground); }

@media (max-width: 620px) {
  .freq__dia { flex: 1 1 100%; }
  .freq__resumo { margin-left: 0; }
}

/* ============================= ASSINATURA ============================= */

.assinatura-pad {
  position: relative;
  margin: 14px 0 6px;
  height: 190px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

.assinatura-pad canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;      /* o dedo assina, não rola a página */
  cursor: crosshair;
}

.assinatura-pad__linha {
  position: absolute;
  right: 26px;
  bottom: 46px;
  left: 26px;
  z-index: 1;
  border-bottom: 1px solid var(--border);
}

.assinatura-pad__dica {
  position: absolute;
  bottom: 22px;
  left: 26px;
  z-index: 1;
  color: var(--muted-foreground);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.assinatura-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}

.assinatura { max-width: 100%; height: auto; color: var(--foreground); }

/* ===================== CHECK-IN (formulário guiado) =====================
   Uma pergunta por tela, ritmo de conversa. Sotaque laranja da marca FP,
   para separar visualmente do portal (que é o vermelho/rosa). */

.checkin {
  --tf: #fd6403;
  --tf-2: #ff8a2b;
  --tf-soft: rgb(253 100 3 / 0.12);
  --tf-soft-2: rgb(253 100 3 / 0.24);
  --tf-grad: linear-gradient(100deg, #fd6403, #ff8a2b);

  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 88% -140px, rgb(253 100 3 / 0.13), transparent 68%),
    radial-gradient(720px 420px at 6% 108%, rgb(253 100 3 / 0.08), transparent 70%),
    var(--background);
}

.tf {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* barra de progresso presa no topo */
.tf__barra {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  height: 5px;
  background: var(--muted);
}

.tf__barra > i {
  display: block;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: var(--tf-grad);
  transition: width 320ms ease;
}

.tf__topo { display: flex; align-items: center; gap: 11px; padding: 24px 0 0; }
.tf__topo img { width: 38px; height: auto; flex: none; }
.tf__topo strong { display: block; font-size: 0.82rem; font-weight: 700; line-height: 1.25; }
.tf__topo span { color: var(--muted-foreground); font-size: 0.74rem; }

.tf__palco { display: flex; flex: 1; align-items: center; padding: 26px 0; }

.tf__passo { width: 100%; animation: tf-entra 340ms cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes tf-entra {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.tf__num {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--tf);
  font-size: 0.85rem;
  font-weight: 700;
}

.tf__tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--tf-soft);
  color: var(--tf);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.tf__marca { font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.1; }

.tf__chamada {
  margin-top: 10px;
  color: var(--tf);
  font-size: 1.05rem;
  font-weight: 700;
}

.tf__titulo {
  font-size: clamp(1.25rem, 4.2vw, 1.85rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.tf__opcional {
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tf__ajuda {
  margin-top: 12px;
  max-width: 56ch;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  line-height: 1.55;
}

.tf__recado {
  margin-top: 12px;
  max-width: 46ch;
  font-size: 1.02rem;
  line-height: 1.5;
  font-weight: 600;
}

.tf__passo--fim { text-align: center; }
.tf__passo--fim .tf__recado { margin-inline: auto; }

/* cartão com a aula do link (turma, módulo, dia) */
.tf__aula {
  display: grid;
  gap: 3px;
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--tf-grad);
  color: #fff;
}

.tf__aula strong { font-size: 1.02rem; }
.tf__aula span { font-size: 0.85rem; opacity: 0.94; }
.tf__aula--fim { margin-inline: auto; max-width: 420px; text-align: left; }

.tf__modulo {
  display: grid;
  gap: 2px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 2px solid var(--tf-soft-2);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.tf__modulo span { color: var(--tf); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.tf__modulo strong { font-size: 1rem; }
.tf__modulo small { color: var(--muted-foreground); font-size: 0.76rem; }

.tf__aluno {
  margin-top: 16px;
  padding: 13px 16px;
  border-left: 3px solid var(--tf);
  border-radius: var(--radius);
  background: var(--tf-soft);
}

.tf__aluno strong { display: block; font-size: 1rem; }
.tf__aluno span { color: var(--muted-foreground); font-size: 0.79rem; }

.tf__anonimo {
  margin-top: 16px;
  color: var(--muted-foreground);
  font-size: 0.82rem;
}

.tf__hora { margin-top: 10px; color: var(--muted-foreground); font-size: 0.8rem; }

.tf__fechar {
  margin-top: 22px;
  color: var(--muted-foreground);
  font-size: 0.9rem;
  font-weight: 600;
}

/* campo de texto grande, sem caixa — jeito Typeform */
.tf__campo {
  width: 100%;
  margin-top: 22px;
  padding: 6px 2px 10px;
  border: 0;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-size: clamp(1.1rem, 3.4vw, 1.5rem);
  font-weight: 600;
}

.tf__campo::placeholder { color: var(--muted-foreground); opacity: 0.55; font-weight: 500; }
.tf__campo:focus { border-bottom-color: var(--tf); outline: none; }
.tf__campo:focus-visible { outline: none; }

.tf__campo--texto {
  min-height: 108px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  font-size: 1rem;
  font-weight: 500;
  resize: vertical;
}

.tf__campo--texto:focus { border-color: var(--tf); }

/* escala 1 a 5 */
.tf__escala { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.tf__nota {
  width: 60px;
  height: 60px;
  border: 2px solid var(--tf-soft-2);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--tf);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background 140ms ease, color 140ms ease;
}

.tf__nota:hover { background: var(--tf-soft); transform: translateY(-2px); }
.tf__nota:focus-visible { outline: 2px solid var(--tf); outline-offset: 2px; }

.tf__nota--on {
  border-color: transparent;
  background: var(--tf-grad);
  color: #fff;
  box-shadow: 0 8px 18px -10px var(--tf);
}

.tf__ancoras {
  display: flex;
  justify-content: space-between;
  max-width: 370px;
  margin-top: 9px;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  font-weight: 600;
}

/* matriz "Experiência geral": uma linha por item */
.tf__linhas { display: grid; gap: 4px; margin-top: 20px; }

.tf__linha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
}

.tf__linha:last-child { border-bottom: 0; }
.tf__linha > span { flex: 1 1 190px; font-size: 0.95rem; font-weight: 600; }

.tf__escala--mini { margin-top: 0; gap: 7px; }
.tf__escala--mini .tf__nota { width: 44px; height: 44px; font-size: 0.95rem; }

/* alternativas (Sim / Não) */
.tf__opcoes { display: grid; gap: 10px; max-width: 440px; margin-top: 22px; }

.tf__opcao {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 2px solid var(--tf-soft-2);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, transform 120ms ease;
}

.tf__opcao:hover { background: var(--tf-soft); transform: translateX(3px); }
.tf__opcao:focus-visible { outline: 2px solid var(--tf); outline-offset: 2px; }
.tf__opcao--on { border-color: var(--tf); background: var(--tf-soft); }

.tf__letra {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border: 1px solid var(--tf-soft-2);
  border-radius: 6px;
  color: var(--tf);
  font-size: 0.78rem;
  font-weight: 800;
}

.tf__opcao--on .tf__letra { border-color: transparent; background: var(--tf); color: #fff; }

/* quadro de assinatura */
.tf__pad {
  position: relative;
  margin-top: 18px;
  height: 210px;
  border: 2px dashed var(--tf-soft-2);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

.tf__pad canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;      /* o dedo assina, não rola a página */
  cursor: crosshair;
}

.tf__pad-linha {
  position: absolute;
  right: 28px;
  bottom: 52px;
  left: 28px;
  z-index: 1;
  border-bottom: 1px solid var(--border);
}

.tf__pad-dica {
  position: absolute;
  bottom: 27px;
  left: 28px;
  z-index: 1;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.tf__limpar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.tf__limpar:hover { border-color: var(--tf); color: var(--tf); }

.tf__assinatura {
  display: flex;
  justify-content: center;
  margin: 16px auto 0;
  padding: 12px;
  max-width: 340px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

/* botão de avançar */
.tf__acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; }

.tf__ok {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--radius);
  background: var(--tf-grad);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px -12px var(--tf);
  transition: transform 120ms ease, filter 140ms ease;
}

.tf__ok:hover { transform: translateY(-1px); filter: brightness(1.05); }
.tf__ok:active { transform: none; }
.tf__ok:focus-visible { outline: 2px solid var(--tf); outline-offset: 3px; }
.tf__ok svg { width: 15px; height: 15px; }

.tf__passo--fim .tf__ok { margin-top: 24px; }

.tf__dica { color: var(--muted-foreground); font-size: 0.78rem; }
.tf__dica b { font-weight: 800; }

.tf__erro {
  margin-top: 14px;
  padding: 9px 13px;
  border-radius: var(--radius);
  background: var(--negative-soft);
  color: var(--negative);
  font-size: 0.85rem;
  font-weight: 600;
}

.tf__ok-grande {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--tf-grad);
  color: #fff;
  font-size: 2.1rem;
  font-weight: 800;
  box-shadow: 0 14px 30px -14px var(--tf);
}

/* rodapé com as setinhas de navegação */
.tf__rodape {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 20px;
}

.tf__setas { display: flex; gap: 6px; }

.tf__seta {
  width: 38px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--tf);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.tf__seta:hover:not(:disabled) { background: var(--tf-soft); }
.tf__seta:disabled { opacity: 0.4; cursor: not-allowed; }

.tf__rodape-txt { margin-left: auto; color: var(--muted-foreground); font-size: 0.74rem; }

@media (max-width: 560px) {
  .tf { padding: 0 16px; }
  .tf__nota { width: 52px; height: 52px; }
  .tf__escala--mini .tf__nota { width: 40px; height: 40px; font-size: 0.88rem; }
  .tf__linha > span { flex: 1 1 100%; }
}

/* ============================= TOAST ============================= */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--positive);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 600;
}

.toast--err { border-left-color: var(--negative); color: var(--negative); }

/* ============================= RESPONSIVO ============================= */

@media (max-width: 940px) {
  /* aqui o menu vira gaveta: some por padrão e abre por cima do conteúdo */
  .sidebar, .shell--recolhido .sidebar { transform: translateX(-100%); }
  .sidebar--open, .shell--recolhido .sidebar--open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgb(22 24 29 / 0.25);
  }
  .main, .shell--recolhido .main { margin-left: 0; }
  .topbar { padding: 13px 16px; }
  .page { padding: 18px 16px 64px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .card__head { flex-wrap: wrap; }
  .card__head .btn { margin-left: 0; }
}

/* ===================== CELULAR E TABLET (até 720px) =====================
   As tabelas deixam de rolar para o lado e viram cartões: cada linha é um
   bloco e cada célula mostra o próprio rótulo (o `data-rotulo` do <td>).
   É o que faz o portal caber num celular sem apertar nada. */

@media (max-width: 720px) {
  .table-wrap { overflow: visible; }
  .table { min-width: 0; }
  .table--presenca { min-width: 0; }

  .table, .table tbody, .table tfoot, .table tr, .table td, .table th { display: block; }
  .table thead { display: none; }

  .table tbody tr,
  .table tfoot tr {
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
  }

  .table tbody tr:hover { background: var(--card); }
  .table tbody tr:last-child { margin-bottom: 0; }

  .table tbody td,
  .table tfoot th {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px dashed var(--border);
    text-align: left;
  }

  .table tbody td:last-child,
  .table tfoot th:last-child { border-bottom: 0; }

  /* o rótulo da coluna vem do atributo, à esquerda de cada valor */
  .table tbody td::before,
  .table tfoot th::before {
    content: attr(data-rotulo);
    flex: 0 0 42%;
    color: var(--muted-foreground);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* a primeira célula é o título do cartão: sem rótulo e sem linha */
  .table tbody td:first-child {
    display: block;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
  }

  .table tbody td:first-child::before,
  .table tfoot th:first-child::before { content: none; }

  /* célula vazia não vira linha em branco no cartão */
  .table tbody td:empty,
  .table tfoot th:empty { display: none; }

  /* o Safari do iPhone dá zoom sozinho em campo com fonte menor que 16px */
  input[type="text"], input[type="password"], input[type="email"], input[type="number"],
  input[type="date"], input[type="tel"], select, textarea {
    font-size: 16px;
  }

  .sel-tentativa { font-size: 13px !important; }

  .table .num { text-align: left; }
  .table .col-acao { width: auto; white-space: normal; }
  .table td.col-acao { gap: 6px; flex-wrap: wrap; }
  .table td.col-acao::before { flex-basis: 100%; margin-bottom: 4px; }

  /* presença: as bolinhas ficam à esquerda, junto do dia */
  .table--presenca .cel-presenca { text-align: left; }
  .aluno-cel { align-items: flex-start; }

  /* espaço um pouco menor nos cartões e cabeçalhos */
  .card { padding: 16px 14px; }
  .card__head { gap: 10px; }
  .card__head h2 { font-size: 1rem; }
  .page { padding: 16px 12px 64px; }

  .card__acoes { width: 100%; margin-left: 0; }
  .card__acoes .btn { flex: 1 1 auto; }

  /* seletores do cabeçalho (módulo, turma, ano) ocupam a linha inteira */
  .card__head .field,
  .card__head > label.field { width: 100%; min-width: 0 !important; margin-left: 0 !important; }
  .card__head .btn { width: 100%; }

  .topbar__actions { flex-wrap: wrap; }

  /* modal ocupa a tela toda, com o rodapé fácil de alcançar */
  .modal-backdrop { padding: 0; place-items: stretch; }
  .modal, .modal--lg { max-width: 100%; min-height: 100%; margin: 0; border-radius: 0; }
  .modal__head { position: sticky; top: 0; z-index: 2; background: var(--card); }
  .modal__body { padding: 16px 14px; }
  .modal__foot { flex-direction: column-reverse; gap: 8px; padding: 14px; }
  .modal__foot .btn { width: 100%; margin: 0 !important; }

  .fields { grid-template-columns: 1fr; }
  .grid--stats { grid-template-columns: 1fr 1fr; }
  .grid--2, .grid--cards { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .grid--stats { grid-template-columns: 1fr; }
  .table tbody td::before, .table tfoot th::before { flex-basis: 46%; }
}

@media print {
  .sidebar, .topbar__actions, .burger, .toasts, .form-actions { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
}
