/* ==========================================================================
   Área acadêmica de saúde — segundo nível do DOD
   Camada aditiva sobre styles.css. Não altera o andar de baixo.
   Regra forte embutida: a camada de honestidade (.honesty) nunca é opcional.
   ========================================================================== */

:root {
  --gate: #1c2230;
  --gate-line: #2f3a4d;
  --pro: #b59bff;        /* roxo do andar de cima, ecoa o diagrama */
  --pro-soft: #1d1b33;
  --ok: #54d699;         /* verde — acesso liberado */
  --ok-soft: #112019;
  --ok-line: #2f5e4b;
  --warn: #f2b84b;       /* âmbar — a honestidade */
  --warn-soft: #2a2212;
  --warn-line: #5e4a17;
}

/* ---- Faixa ética sob o cabeçalho ------------------------------------------ */
.gate-strip {
  position: sticky;
  top: 72px;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 11, 18, 0.92);
  backdrop-filter: blur(12px);
}

.gate-strip .gate-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.ethic-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.ethic-line strong {
  color: #ffffff;
}

.verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--ok-line);
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.verified-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok);
}

.demo-note {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 0.74rem;
  font-weight: 700;
}

.profile-reset {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--gate-line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.profile-reset:hover,
.profile-reset:focus-visible {
  border-color: var(--pro);
  color: #ffffff;
}

/* ---- Marca do andar de cima ----------------------------------------------- */
.floor-tag {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 9px;
  border: 1px solid #3a3463;
  border-radius: 5px;
  background: var(--pro-soft);
  color: var(--pro);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  vertical-align: middle;
}

/* ---- Linha de revelação progressiva --------------------------------------- */
.disclosure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.disclosure-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #14171f;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.disclosure-toggle .chevron {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted-2);
  transition: transform 0.18s ease;
}

.disclosure-toggle[aria-expanded="true"] {
  border-color: #4a4173;
  background: var(--pro-soft);
  color: #ffffff;
}

.disclosure-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
  color: var(--pro);
}

.disclosure-step {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #20243033;
  border: 1px solid var(--gate-line);
  color: var(--pro);
  font-size: 0.66rem;
  font-weight: 900;
}

/* ---- Painéis reveláveis ---------------------------------------------------- */
.panel {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.008)), var(--surface-2);
}

.panel[hidden] {
  display: none;
}

.panel h3 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 900;
}

.panel .panel-hint {
  margin: 0 0 16px;
  color: var(--muted-2);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
}

.pico-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-stack {
  display: grid;
  gap: 7px;
}

.field-stack label {
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0d1118;
  color: #ffffff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.ghost-button.is-primary {
  border-color: #4a4173;
  background: var(--pro-soft);
  color: var(--pro);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 4px;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--pro);
  cursor: pointer;
}

.check-row label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
}

/* ---- Aviso de honestidade — a regra forte, sempre visível quando importa --- */
.honesty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--warn-line);
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: var(--warn-soft);
}

.honesty[hidden] {
  display: none;
}

.honesty .honesty-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 1.2rem;
  font-weight: 900;
}

.honesty h4 {
  margin: 0 0 5px;
  color: var(--warn);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.honesty p {
  margin: 0;
  color: #e9d7ab;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 650;
}

.honesty .honesty-foot {
  margin-top: 8px;
  color: #c2ad7e;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ---- Painel de síntese (panorama) ----------------------------------------- */
.synthesis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.synthesis-block {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}

.synthesis-block strong {
  display: block;
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.synthesis-block p,
.synthesis-block ul {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  font-weight: 650;
}

.synthesis-block ul {
  padding-left: 18px;
}

/* ---- Barra de exportação --------------------------------------------------- */
.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ---- Responsivo ------------------------------------------------------------ */
@media (max-width: 680px) {
  .gate-strip {
    top: 0;
    position: static;
  }
  .pico-grid {
    grid-template-columns: 1fr;
  }
  .demo-note {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .disclosure-toggle .chevron {
    transition: none;
  }
}

/* ==========================================================================
   Cadastro acadêmico local — sem autenticação remota ou confirmação
   A atenção (honestidade) só reativa depois de identificar o perfil.
   ========================================================================== */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(74, 65, 115, 0.22), transparent 42%),
    rgba(3, 6, 10, 0.96);
  backdrop-filter: blur(8px);
  overflow: auto;
}

.gate-overlay[hidden] {
  display: none;
}

.gate-card {
  width: min(520px, 100%);
  padding: 30px 28px;
  border: 1px solid #343b47;
  border-radius: 12px;
  background:
    radial-gradient(circle at 14% 0%, rgba(74, 65, 115, 0.18), transparent 36%),
    var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.gate-card .gate-eyebrow {
  margin: 0 0 12px;
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.gate-card h2 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: 920;
}

.gate-card .gate-sub {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
  font-weight: 650;
}

.gate-ethic {
  display: flex;
  gap: 10px;
  margin: 16px 0 22px;
  padding: 13px 15px;
  border: 1px solid var(--ok-line);
  border-left: 3px solid var(--ok);
  border-radius: 8px;
  background: var(--ok-soft);
  color: #cdeedd;
  font-size: 0.86rem;
  line-height: 1.5;
  font-weight: 700;
}

.gate-form {
  display: grid;
  gap: 14px;
}

.gate-form .field-stack label {
  color: var(--muted-2);
  font-size: 0.74rem;
  font-weight: 850;
}

.gate-declaration {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 4px 2px;
}

.gate-declaration input[type="checkbox"] {
  width: 19px;
  height: 19px;
  min-height: 0;
  margin-top: 1px;
  accent-color: var(--pro);
  cursor: pointer;
}

.gate-declaration label {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 650;
  cursor: pointer;
}

.gate-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border: 1px solid var(--ok-line);
  border-radius: 7px;
  background: #143026;
  color: #ffffff;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

.gate-foot {
  margin: 16px 0 0;
  color: var(--muted-2);
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 700;
}

.gate-error {
  margin: 6px 0 0;
  color: #f0997b;
  font-size: 0.82rem;
  font-weight: 750;
  min-height: 18px;
}

@media (max-width: 680px) {
  .gate-card { padding: 24px 20px; }
  .gate-card h2 { font-size: 1.4rem; }
}
