/* ============================================================
   Shell da aplicação: autenticação, painel, navegação e módulos
   ============================================================ */

/* ============================================================
   Assinatura da marca — losango facetado + logotipo
   ============================================================ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.logo__gem { flex: none; width: 34px; height: 34px; }
.logo__text { display: flex; flex-direction: column; min-width: 0; }
.logo__word {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.012em;
  color: var(--ink);
  white-space: nowrap;
}
.logo__unit {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-800); /* 5,3:1 sobre branco — legível no tamanho reduzido */
  white-space: nowrap;
}

.logo--light .logo__word { color: #fff; }
.logo--light .logo__unit { color: var(--teal-300); }

.logo--sm { gap: 8px; }
.logo--sm .logo__gem { width: 28px; height: 28px; }
.logo--sm .logo__word { font-size: 1.125rem; }

.logo--lg { gap: 14px; }
.logo--lg .logo__gem { width: 52px; height: 52px; }
.logo--lg .logo__word { font-size: 2.125rem; }

/* Versão empilhada (símbolo acima do logotipo) */
.logo--stacked { flex-direction: column; gap: 8px; text-align: center; }
.logo--stacked .logo__text { align-items: center; }

/* ============================================================
   1. Tela de autenticação
   ============================================================ */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100dvh;
}

.auth__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-10);
  padding: var(--space-12) var(--space-12);
  overflow: hidden;
  color: #dceaf8;
  background:
    radial-gradient(95% 70% at 12% -8%, rgba(51, 198, 182, 0.45), transparent 58%),
    radial-gradient(80% 60% at 100% 108%, rgba(44, 113, 188, 0.55), transparent 62%),
    linear-gradient(162deg, #17599f 0%, #0f4787 44%, #0a3568 100%);
}
.auth__aside-pattern {
  position: absolute;
  inset: -20% -10% auto -25%;
  width: 135%;
  opacity: 0.26;
  pointer-events: none;
}
.auth__aside-pattern path,
.auth__aside-pattern circle,
.auth__aside-pattern ellipse { fill: none; stroke: rgba(142, 227, 217, 0.55); stroke-width: 0.4; vector-effect: non-scaling-stroke; }

.auth__aside > *:not(.auth__aside-pattern) { position: relative; z-index: 1; }

.auth__pitch { max-width: 30ch; }
.auth__pitch h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  color: #fff;
  letter-spacing: -0.01em;
}
.auth__pitch p {
  margin-top: var(--space-4);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: rgba(211, 227, 248, 0.86);
  max-width: 34ch;
}

.auth__trust { display: flex; flex-direction: column; gap: var(--space-3); }
.auth__trust li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: rgba(206, 223, 246, 0.9);
}
.auth__trust .icon { color: var(--teal-400); }

.auth__legal { font-size: var(--fs-xs); color: rgba(180, 202, 232, 0.65); line-height: var(--lh-snug); }

.auth__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-6);
  background: var(--bg-surface);
}
.auth__panel { width: 100%; max-width: 460px; }

.auth__panel-head { margin-bottom: var(--space-6); }
.auth__panel-head h2 {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.auth__panel-head p { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-muted); }

/* Abas Entrar / Criar acesso */
.tabs {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 4px;
  background: var(--bg-surface-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}
.tabs__btn {
  position: relative;
  z-index: 1;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: color var(--dur-base) var(--ease-out);
}
.tabs__btn[aria-selected="true"] { color: var(--blue-800); }
.tabs__thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-slow) var(--ease-out), width var(--dur-slow) var(--ease-out);
}

.auth__form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth__form-foot { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-2); }
.auth__switch { text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.auth__switch button {
  border: 0; background: none; padding: 0;
  color: var(--text-brand); font-weight: 600; font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}

.auth__admin-link {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  text-align: center;
}
.auth__admin-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.auth__admin-link a:hover { color: var(--text-brand); }

/* Passos do cadastro */
.steps { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-6); }
.steps__item { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 0; min-width: 0; }
.steps__dot {
  display: flex; align-items: center; justify-content: center;
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--dur-base) var(--ease-out);
}
.steps__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--dur-base) var(--ease-out);
}
.steps__item[data-state="active"] .steps__dot { border-color: var(--blue-600); background: var(--blue-600); color: #fff; }
.steps__item[data-state="active"] .steps__label { color: var(--blue-800); }
.steps__item[data-state="done"] .steps__dot { border-color: var(--green-600); background: var(--green-600); color: #fff; }
.steps__item[data-state="done"] .steps__label { color: var(--slate-700); }
.steps__bar { flex: 1 1 auto; height: 2px; background: var(--border); border-radius: 2px; min-width: 12px; }
@media (max-width: 560px) { .steps__label { display: none; } }

.step { display: flex; flex-direction: column; gap: var(--space-4); }
.step[hidden] { display: none; }
.step-enter { animation: step-in var(--dur-slow) var(--ease-out) both; }
@keyframes step-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.step-enter--back { animation-name: step-in-back; }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

/* Medidor de força de senha */
.pwmeter { display: flex; flex-direction: column; gap: 6px; }
.pwmeter__track { display: flex; gap: 4px; }
.pwmeter__seg {
  height: 4px; flex: 1;
  border-radius: 2px;
  background: var(--slate-200);
  transition: background-color var(--dur-base) var(--ease-out);
}
.pwmeter__note { font-size: var(--fs-xs); color: var(--text-muted); }
.pwmeter[data-score="1"] .pwmeter__seg:nth-child(-n+1) { background: var(--red-600); }
.pwmeter[data-score="2"] .pwmeter__seg:nth-child(-n+2) { background: var(--amber-600); }
.pwmeter[data-score="3"] .pwmeter__seg:nth-child(-n+3) { background: #0d9488; }
.pwmeter[data-score="4"] .pwmeter__seg { background: var(--green-600); }

/* Resumo da matrícula gerada */
.enroll-preview {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px dashed var(--blue-200);
  border-radius: var(--radius-md);
  background: var(--action-soft);
}
.enroll-preview__num {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--blue-800);
  font-variant-numeric: tabular-nums;
}
.enroll-preview__meta { font-size: var(--fs-xs); color: var(--blue-700); }

/* Captura de foto */
.photocap { display: grid; grid-template-columns: 132px 1fr; gap: var(--space-5); align-items: start; }
@media (max-width: 520px) { .photocap { grid-template-columns: 108px 1fr; gap: var(--space-4); } }

/* O quadro redondo espelha o retrato do cartão: o que se vê é o que se grava.
   Seletor duplo para vencer o aspect-ratio 3/4 de .photocap__frame. */
.photocap__frame.photocap__frame--round { aspect-ratio: 1; border-radius: 50%; }
.photocap__frame--round img,
.photocap__frame--round video,
.photocap__frame--round canvas { border-radius: 50%; }
.photocap__frame--round .photocap__guide { inset: 8%; border-radius: 50%; }

.photocap__frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--slate-100);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}
.photocap__frame img,
.photocap__frame video { width: 100%; height: 100%; object-fit: cover; }
.photocap__frame video { transform: scaleX(-1); }
.photocap__empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2);
  height: 100%;
  color: var(--text-faint);
  font-size: var(--fs-2xs);
  text-align: center;
  padding: var(--space-2);
}
.photocap__guide {
  position: absolute;
  inset: 12% 18% 16%;
  border: 1px dashed rgba(255, 255, 255, 0.65);
  border-radius: 40% 40% 32% 32%;
  pointer-events: none;
}
.photocap__actions { display: flex; flex-direction: column; gap: var(--space-2); }
.photocap__note { font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside {
    padding: var(--space-6) var(--space-5) var(--space-6);
    gap: var(--space-5);
  }
  .auth__aside .auth__trust,
  .auth__aside .auth__legal { display: none; }
  .auth__pitch { max-width: none; }
  .auth__pitch h1 { font-size: 1.5rem; }
  .auth__pitch p { margin-top: var(--space-2); font-size: var(--fs-sm); max-width: 46ch; }
  .auth__main { padding: var(--space-6) var(--space-4) var(--space-12); align-items: flex-start; }
  .auth__panel-head h2 { font-size: var(--fs-2xl); }
}

/* ============================================================
   2. Estrutura do painel
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-4);
  background: linear-gradient(180deg, #0f4787 0%, #0a3568 62%, #082a54 100%);
  border-right: 1px solid rgba(142, 227, 217, 0.14);
  z-index: var(--z-nav);
}
.sidebar__brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
/* Fio da marca no topo da barra lateral */
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gem-1), var(--gem-2), var(--gem-3), var(--gem-4));
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.navitem {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(202, 220, 244, 0.78);
  font-size: var(--fs-sm);
  font-weight: 550;
  text-align: left;
  width: 100%;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.navitem:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.navitem[aria-current="page"] {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font-weight: 650;
}
.navitem[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: calc(var(--space-4) * -1);
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--teal-400);
}
.navitem__badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(217, 181, 107, 0.2);
  color: var(--teal-300);
  font-size: 10px;
  font-weight: 700;
}

.sidebar__section {
  padding: var(--space-3) var(--space-3) var(--space-1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tracking-caps-wide);
  text-transform: uppercase;
  color: rgba(160, 190, 228, 0.55);
}

.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-3); }
.sidebar__card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__card-title { font-size: var(--fs-xs); font-weight: 650; color: #fff; }
.sidebar__card-text { margin-top: 4px; font-size: var(--fs-2xs); color: rgba(198, 218, 244, 0.72); line-height: var(--lh-snug); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--topbar-h);
  padding: 0 var(--space-6);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__title { font-size: var(--fs-base); font-weight: 650; color: var(--text-strong); }
.topbar__crumb { font-size: var(--fs-2xs); color: var(--text-muted); letter-spacing: 0.02em; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }

.usermenu { position: relative; }
.usermenu__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.usermenu__trigger:hover { background: var(--bg-surface-3); border-color: var(--border); }
.usermenu__name { font-size: var(--fs-sm); font-weight: 600; color: var(--slate-800); max-width: 150px; }
.usermenu__chevron { color: var(--text-muted); }
@media (max-width: 1080px) { .usermenu__name { display: none; } }
@media (max-width: 900px) { .usermenu__chevron { display: none; } }

.avatar {
  position: relative;
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  /* Tons profundos do losango: garantem contraste das iniciais em branco */
  background: linear-gradient(148deg, var(--blue-600), var(--gem-4) 45%, var(--blue-900));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 76px; height: 76px; font-size: var(--fs-xl); }
.avatar--xl { width: 104px; height: 104px; font-size: var(--fs-2xl); border-radius: var(--radius-lg); }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 236px;
  padding: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-4);
  z-index: var(--z-overlay);
  transform-origin: top right;
  animation: menu-in var(--dur-base) var(--ease-out) both;
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }

.menu__head { padding: var(--space-3); border-bottom: 1px solid var(--border); margin-bottom: var(--space-2); }
.menu__name { font-size: var(--fs-sm); font-weight: 650; color: var(--text-strong); }
.menu__meta { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--slate-700);
  font-size: var(--fs-sm);
  text-align: left;
  text-decoration: none;
}
.menu__item:hover { background: var(--bg-surface-3); color: var(--slate-900); }
.menu__sep { height: 1px; background: var(--border); margin: var(--space-2) 0; }
.menu__item--danger { color: var(--red-600); }
.menu__item--danger:hover { background: var(--red-100); color: var(--red-700); }

/* ---------- Conteúdo ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.view {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-12);
}
.view[hidden] { display: none; }
.view-enter { animation: view-in var(--dur-slow) var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.view__head { margin-bottom: var(--space-6); }

/* No celular a carteirinha ocupa a tela como num app de carteira: o título
   da rota já aparece na barra superior, então este bloco fica só para
   leitores de tela. */
@media (max-width: 900px) {
  .view__head--compact {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
.view__title { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.01em; }
.view__desc { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-muted); max-width: 68ch; }

/* ============================================================
   3. Módulo Carteirinha
   ============================================================ */
.wallet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 1100px) { .wallet-layout { grid-template-columns: 1fr; gap: var(--space-6); } }

.wallet-side { display: flex; flex-direction: column; gap: var(--space-4); }

.status-panel {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(220, 245, 232, 0.55), rgba(255, 255, 255, 0)) ,
    var(--bg-surface);
  box-shadow: var(--shadow-2);
}
.status-panel[data-status="expired"] {
  background: linear-gradient(180deg, rgba(253, 232, 230, 0.6), rgba(255, 255, 255, 0)), var(--bg-surface);
}
.status-panel__top { display: flex; align-items: center; gap: var(--space-3); }
.status-panel__ico {
  display: flex; align-items: center; justify-content: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
}
.status-panel[data-status="expired"] .status-panel__ico { background: var(--red-100); color: var(--red-700); }
.status-panel__title { font-size: var(--fs-base); font-weight: 650; color: var(--text-strong); }
.status-panel__sub { font-size: var(--fs-xs); color: var(--text-muted); }
.status-panel__list { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }

.deflist { display: flex; flex-direction: column; gap: var(--space-3); }
.deflist__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--fs-sm);
}
.deflist__row + .deflist__row { padding-top: var(--space-3); border-top: 1px solid var(--border); }
.deflist__k { color: var(--text-muted); flex: none; }
.deflist__v { color: var(--text-strong); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.deflist__v--mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.validity-meter { margin-top: var(--space-4); }
.validity-meter__track { height: 6px; border-radius: 3px; background: var(--slate-200); overflow: hidden; }
.validity-meter__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 900ms var(--ease-out);
}
.validity-meter__labels {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   4. Módulo Acadêmico
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
.stat {
  position: relative;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.stat__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.stat__value {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.stat__unit { font-size: var(--fs-base); font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.stat__foot { margin-top: var(--space-2); font-size: var(--fs-xs); color: var(--text-muted); }

.progress-ring { display: flex; align-items: center; gap: var(--space-5); }
.progress-ring__svg { width: 108px; height: 108px; flex: none; transform: rotate(-90deg); }
@media (max-width: 400px) {
  .progress-ring { gap: var(--space-3); }
  .progress-ring__svg { width: 84px; height: 84px; }
}
.progress-ring__bg { fill: none; stroke: var(--slate-200); stroke-width: 9; }
.progress-ring__fg {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease-out);
}
.progress-ring__num {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.timeline { display: flex; flex-direction: column; }
.timeline__item {
  position: relative;
  display: flex;
  gap: var(--space-4);
  padding: 0 0 var(--space-5) var(--space-6);
  border-left: 1px solid var(--border-strong);
}
.timeline__item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -5px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--blue-500);
}
.timeline__item[data-tone="muted"]::before { border-color: var(--slate-300); }
.timeline__date {
  flex: none;
  width: 84px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.timeline__title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.timeline__text { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
@media (max-width: 560px) {
  .timeline__item { flex-direction: column; gap: 2px; }
  .timeline__date { width: auto; }
}

/* ============================================================
   5. Módulo Documentos
   ============================================================ */
.doclist { display: flex; flex-direction: column; }
.docitem {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border);
}
.docitem:last-child { border-bottom: 0; }
.docitem__ico {
  display: flex; align-items: center; justify-content: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--action-soft);
  color: var(--blue-700);
}
.docitem__name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.docitem__meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.docitem__action { margin-left: auto; flex: none; }
@media (max-width: 620px) {
  .docitem { flex-wrap: wrap; }
  .docitem__action { margin-left: 56px; width: calc(100% - 56px); }
  .docitem__action .btn { width: 100%; }
}

/* ============================================================
   6. Módulo Perfil
   ============================================================ */
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); align-items: start; }
@media (max-width: 1100px) { .profile-layout { grid-template-columns: 1fr; } }

.profile-hero {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  color: #e6eefb;
  overflow: hidden;
  background:
    radial-gradient(90% 130% at 0% -10%, rgba(51, 198, 182, 0.42), transparent 62%),
    linear-gradient(148deg, #17599f, #0a3568);
  box-shadow: var(--shadow-3);
}
.profile-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gem-1), var(--gem-2), var(--gem-3), var(--gem-4));
}
.profile-hero { position: relative; }
.profile-hero__name { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; color: #fff; }
.profile-hero__meta { font-size: var(--fs-sm); color: rgba(206, 223, 246, 0.82); margin-top: 4px; }
.profile-hero__id {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  color: var(--teal-300);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) { .profile-hero { flex-direction: column; text-align: center; } }

/* Cartão de destaque: seção da carteirinha dentro do perfil */
.card--accent { border-color: var(--teal-200); }
.card--accent > .card__head {
  border-bottom-color: var(--teal-200);
  background: linear-gradient(180deg, var(--teal-50), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card--accent > .card__head .card__title { color: var(--teal-900); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

hr.rule {
  height: 1px;
  border: 0;
  margin: var(--space-6) 0;
  background: var(--border);
}

/* Campo com botão acoplado (matrícula + gerar) */
.field__control--split { display: flex; align-items: stretch; gap: var(--space-2); }
.field__control--split .input { flex: 1 1 auto; }
.field__control--split .btn { flex: none; min-height: 46px; }
@media (max-width: 480px) {
  .field__control--split { flex-direction: column; }
  .field__control--split .btn { width: 100%; }
}

/* Captura de foto no perfil — variante larga com retrato circular */
.photocap--wide { grid-template-columns: 148px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.photocap__title { font-size: var(--fs-sm); font-weight: 650; color: var(--text-strong); }
.photocap__buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 600px) {
  .photocap--wide { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: var(--space-4); }
  .photocap--wide .photocap__frame { width: 148px; }
  .photocap--wide .photocap__actions { width: 100%; align-items: center; }
  .photocap__buttons { justify-content: center; }
  .photocap__note { text-align: center; }
}

.switchrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}
.switchrow + .switchrow { border-top: 1px solid var(--border); }
.switchrow__title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.switchrow__text { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; max-width: 46ch; }

/* O botão tem alvo de toque de 44×44 (WCAG/HIG); a trilha visual (::before)
   fica centralizada e menor, sem alterar a aparência do controle. */
.switch {
  position: relative;
  flex: none;
  width: 44px; height: 44px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
}
.switch::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 28px;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-pill);
  background: var(--slate-300);
  transition: background-color var(--dur-base) var(--ease-out);
}
.switch::after {
  content: "";
  position: absolute;
  top: 50%; left: calc(50% - 20px);
  width: 22px; height: 22px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-base) var(--ease-spring);
}
.switch[aria-checked="true"]::before { background: var(--blue-600); }
.switch[aria-checked="true"]::after { transform: translateY(-50%) translateX(18px); }

/* ============================================================
   7. Navegação mobile
   ============================================================ */
.bottomnav {
  position: fixed;
  z-index: var(--z-nav);
  left: 0; right: 0; bottom: 0;
  display: none;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
}
.bottomnav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 0 2px;
  transition: color var(--dur-base) var(--ease-out);
}
.bottomnav__item .icon { transition: transform var(--dur-base) var(--ease-spring); }
.bottomnav__item[aria-current="page"] { color: var(--blue-700); }
.bottomnav__item[aria-current="page"] .icon { transform: translateY(-1px) scale(1.06); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottomnav { display: flex; }
  .main { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }

  /* Barra superior compacta: a migalha vira ruído — o rótulo já se repete
     na navegação inferior, então só o título da seção permanece. */
  .topbar { height: 56px; padding: 0 var(--space-4); }
  .topbar__crumb { display: none; }
  .topbar__title { font-size: var(--fs-lg); }

  .view { padding: var(--space-4) var(--space-4) var(--space-8); }
  .view__head { margin-bottom: var(--space-4); }
  .view__title { font-size: var(--fs-xl); }
}

/* Telas de aparelho pequeno: mais um nível de compactação nas superfícies
   de cartão, para caber mais conteúdo sem rolagem excessiva. */
@media (max-width: 480px) {
  .card__head { padding: var(--space-3) var(--space-4); }
  .stat { padding: var(--space-4); }
  .status-panel { padding: var(--space-4); }
  .view { padding: var(--space-3) var(--space-4) var(--space-8); }
}

@media print {
  .sidebar, .topbar, .bottomnav, .wallet__controls, .wallet-side, .toaster, .skip-link { display: none !important; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  body { background: #fff; }
}

/* ============================================================
   8. Estados vazios e diálogo
   ============================================================ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  text-align: center;
}
.empty__ico {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-surface-3);
  color: var(--text-faint);
}
.empty__title { font-size: var(--fs-base); font-weight: 650; color: var(--text-strong); }
.empty__text { font-size: var(--fs-sm); color: var(--text-muted); max-width: 44ch; }

.dialog {
  border: 0;
  padding: 0;
  width: min(480px, calc(100vw - var(--space-8)));
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-4);
  color: var(--text-body);
}
.dialog::backdrop { background: var(--bg-scrim); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in var(--dur-slow) var(--ease-spring) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
.dialog__body { padding: var(--space-6); }
.dialog__title { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; }
.dialog__text { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-muted); }
.dialog__foot { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-6); }
@media (max-width: 520px) { .dialog__foot { flex-direction: column-reverse; } .dialog__foot .btn { width: 100%; } }

/* ============================================================
   9. Página pública de verificação
   ============================================================ */
.verify { min-height: 100dvh; display: flex; flex-direction: column; }
.verify__bar {
  position: relative;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(120deg, #17599f, #0a3568);
}
.verify__bar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gem-1), var(--gem-2), var(--gem-3), var(--gem-4));
}
.verify__main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-4) var(--space-12);
}
.verify__seal {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid #b9e7d1;
  background: linear-gradient(180deg, var(--green-100), #fff);
  margin-bottom: var(--space-6);
}
.verify__seal[data-state="invalid"] { border-color: #f5cdc9; background: linear-gradient(180deg, var(--red-100), #fff); }
.verify__seal-ico {
  display: flex; align-items: center; justify-content: center;
  flex: none; width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--green-600); color: #fff;
  animation: seal-pop 520ms var(--ease-spring) both;
}
.verify__seal[data-state="invalid"] .verify__seal-ico { background: var(--red-600); }
@keyframes seal-pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.verify__seal-title { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; color: var(--text-strong); }
.verify__seal-text { font-size: var(--fs-sm); color: var(--text-body); margin-top: 2px; }

.verify__identity { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--space-6); }
@media (max-width: 560px) { .verify__identity { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.verify__photo {
  aspect-ratio: 1;
  width: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  /* Tons profundos do losango: garantem contraste das iniciais em branco */
  background: linear-gradient(148deg, var(--blue-600), var(--gem-4) 45%, var(--blue-900));
  box-shadow: var(--shadow-3), 0 0 0 3px var(--teal-400);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-size: var(--fs-3xl);
}
.verify__photo img { width: 100%; height: 100%; object-fit: cover; }
