/* Penal MM — layout de aprovação
   Público: famílias e, sobretudo, escritórios.
   Papel de cartório + chrome navy. Dourado só no monograma e num CTA. */

@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --azul-100: #e1e6ed;
  --azul-200: #b4c1d1;
  --azul-300: #8399b3;
  --azul-400: #547396;
  --azul-500: #2a4f78;
  --azul-600: #1e3a5f;
  --azul-700: #162c4a;
  --azul-800: #0f1d33;
  --azul-900: #070f1c;
  --dourado-100: #fff9e6;
  --dourado-300: #e8d48a;
  --dourado-500: #d4af37;
  --dourado-600: #b8962e;
  --preto-500: #64748b;
  --preto-700: #334155;
  --preto-800: #1e293b;
  --preto-900: #0f172a;
  --branco-100: #ffffff;
  --branco-200: #f7f5f1;
  --branco-300: #efece6;
  --branco-400: #e4e0d8;
  --branco-500: #d4d0c8;
  --alerta-50: #fef2f2;
  --alerta-500: #dc2626;
  --aviso-50: #fff7ed;
  --aviso-500: #ea580c;
  --sucesso-50: #f0fdf4;
  --sucesso-500: #15803d;
  --font-sans: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Libre Baskerville", Georgia, serif;
  --sidebar: 15.5rem;
  --radius: 12px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow-card: 0 18px 50px color-mix(in srgb, var(--azul-900) 10%, transparent);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--branco-200);
  color: var(--preto-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.font-display { font-family: var(--font-display); }

/* ── Brand ── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.brand-word {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  background: linear-gradient(115deg, #8a6f1f, #d4af37 30%, #f8efc0 48%, #c9a227);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid color-mix(in srgb, var(--dourado-500) 55%, transparent);
  color: var(--dourado-500);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand-mark.sm { width: 1.75rem; height: 1.75rem; font-size: 0.6rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-block { width: 100%; min-height: 2.85rem; }
.btn-ink {
  background: var(--azul-900);
  color: #fff;
}
.btn-ink:hover { background: var(--azul-700); }
.btn-primary {
  background: var(--dourado-500);
  color: var(--azul-900);
}
.btn-primary:hover { background: var(--dourado-600); color: #fff; }
.btn-secondary {
  background: transparent;
  border-color: var(--azul-400);
  color: var(--azul-500);
}
.btn-secondary:hover { background: var(--azul-100); }
.btn-ghost { color: var(--azul-500); padding-inline: 0.25rem; }
.btn-ghost:hover { text-decoration: underline; }
.btn-danger { color: var(--alerta-500); background: transparent; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ── Fields ── */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field > label,
.field-label { font-size: 0.8125rem; font-weight: 600; color: var(--preto-800); }
.field .hint { font-size: 0.75rem; color: var(--preto-500); }
.field .error { font-size: 0.75rem; color: var(--alerta-500); }
.field-control,
.field input,
.field select,
.field textarea,
.select-trigger {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--branco-300);
  color: var(--preto-900);
  font: inherit;
}
.field textarea,
.field-control.textarea { min-height: 6.5rem; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder,
.field-control::placeholder { color: var(--preto-500); }
.field input:focus,
.field select:focus,
.field textarea:focus,
.field-control:focus,
.select-trigger:focus,
.select-trigger:focus-visible {
  outline: 2px solid var(--azul-200);
  border-color: var(--azul-500);
}
.field.is-invalid .field-control,
.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid .select-trigger,
.field-control.is-invalid,
.select-trigger.is-invalid {
  border-color: var(--alerta-500);
  background: #fdecec;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--alerta-500) 18%, transparent);
}
.field.is-disabled,
.field-control:disabled,
.select-trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'><path d='M4 6l4 4 4-4' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

/* Custom select / multi (substitui o menu nativo do SO) */
.select { position: relative; }
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
}
.select-trigger .value { min-width: 0; flex: 1; }
.select-trigger .placeholder { color: var(--preto-500); }
.select-chevron {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--preto-500);
  transition: transform 0.15s;
}
.select.is-open .select-chevron { transform: rotate(180deg); }
.select-menu {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--branco-100);
  border-radius: 16px;
  box-shadow: 0 12px 36px color-mix(in srgb, var(--azul-900) 14%, transparent);
  max-height: 16rem;
  overflow: auto;
}
.select.is-open .select-menu { display: block; }
.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--preto-900);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.select-option:hover,
.select-option.is-active { background: var(--branco-200); }
.select-option[aria-selected="true"] {
  background: var(--azul-900);
  color: #fff;
}
.select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 0;
}

/* Switch binário */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.switch-track {
  position: relative;
  width: 2.75rem;
  height: 1.55rem;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--branco-400);
  transition: background 0.15s;
}
.switch-thumb {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--azul-900) 18%, transparent);
  transition: transform 0.15s;
}
.switch input:checked + .switch-track { background: var(--azul-900); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(1.2rem); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--azul-200); outline-offset: 2px; }
.switch.is-disabled { opacity: 0.45; cursor: not-allowed; }
.switch-copy { font-size: 0.9rem; font-weight: 600; color: var(--preto-800); }
.switch-copy small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--preto-500); }
.row { display: grid; gap: 0.9rem; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-13 { grid-template-columns: 1fr 2fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.row-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Paper / chrome ── */
.paper {
  background: var(--branco-100);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--preto-500);
}
.page-head h1 {
  font-family: var(--font-sans);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--azul-900);
  margin-top: 0.2rem;
}
.lede { color: var(--preto-500); max-width: 40rem; margin-top: 0.4rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--azul-100);
  color: var(--azul-600);
}
.chip-gold { background: var(--dourado-100); color: var(--dourado-600); }
.chip-warn { background: var(--aviso-50); color: var(--aviso-500); }
.chip-ok { background: var(--sucesso-50); color: var(--sucesso-500); }
.chip-remove {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--alerta-500);
  background: transparent;
  color: var(--alerta-500);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.result-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.run-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.run-tags .chip-ink {
  background: var(--azul-900);
  color: var(--dourado-300);
}

.credit-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--dourado-100);
  color: var(--dourado-700);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.credit-tag strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--dourado-600);
  line-height: 1;
}
.credit-tag.on-navy {
  width: 100%;
  justify-content: center;
  background: color-mix(in srgb, var(--dourado-500) 22%, transparent);
  color: var(--dourado-300);
}
.credit-tag.on-navy strong { color: var(--dourado-300); }
.credit-tag.on-navy:hover {
  background: color-mix(in srgb, var(--dourado-500) 34%, transparent);
}
.who + .credit-tag { margin-bottom: 0.65rem; }

.activity-log-wrap {
  margin-top: 1.25rem;
}
.activity-log-wrap summary {
  cursor: pointer;
  width: fit-content;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--preto-500);
}
.activity-log-wrap summary:hover { color: var(--azul-900); }
.activity-log {
  margin: 0.55rem 0 0;
  padding: 0.65rem 0.8rem;
  max-height: 10rem;
  overflow: auto;
  list-style: none;
  background: var(--branco-100);
  border-radius: 16px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--preto-500);
  line-height: 1.5;
}
.activity-log li + li {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--branco-300);
}

.banner {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
}
.banner-aviso { background: var(--aviso-50); border-color: color-mix(in srgb, var(--aviso-500) 25%, transparent); color: #9a3412; }
.banner-ok { background: var(--sucesso-50); border-color: color-mix(in srgb, var(--sucesso-500) 25%, transparent); color: var(--sucesso-500); }
.banner-alerta { background: var(--alerta-50); border-color: color-mix(in srgb, var(--alerta-500) 25%, transparent); color: var(--alerta-500); }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--preto-500);
}
.pager-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.pager button {
  border: 0;
  background: var(--branco-100);
  color: var(--azul-900);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.pager button.is-current {
  background: var(--azul-900);
  color: var(--branco-100);
}
.pager-gap {
  min-width: 1rem;
  text-align: center;
  font-weight: 600;
}
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager.compact { margin-top: 0.45rem; font-size: 0.75rem; }
.pager.compact button {
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
}
.pager.compact .pager-gap { font-size: 0.72rem; }
.paper-scroll {
  overflow: auto;
  max-height: min(32rem, 58vh);
}
.paper-scroll .table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--branco-100);
}
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--preto-500);
  font-weight: 600;
  padding: 0.85rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--branco-300);
}
.table td { padding: 0.95rem 1.1rem; border-bottom: 1px solid var(--branco-300); vertical-align: top; }
.table tbody tr:hover td { background: var(--branco-200); }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--azul-500); font-weight: 600; }
.muted { color: var(--preto-500); }
.num { font-variant-numeric: tabular-nums; }

/* ── App shell ── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  background: var(--branco-200);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(ellipse 140% 90% at 18% -10%, var(--azul-600), transparent 52%),
    linear-gradient(168deg, var(--azul-700), var(--azul-800) 48%, var(--azul-900));
}
.sidebar-brand { padding: 1.5rem 1.15rem 0.5rem; }
.nav { flex: 1; padding: 1.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.2rem; }
.nav a,
.nav .nav-off {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.58rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  color: var(--azul-200);
}
.nav a:hover { background: var(--azul-700); color: #fff; }
.nav a.active {
  background: var(--azul-800);
  color: var(--dourado-300);
  font-weight: 600;
}
.nav .nav-off { opacity: 0.4; }
.nav-section {
  margin: 1rem 0.75rem 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--azul-300);
}
.sidebar-foot {
  padding: 0.9rem 0.85rem 1.1rem;
  border-top: 1px solid color-mix(in srgb, var(--azul-400) 25%, transparent);
}
.who { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.65rem; }
.avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: var(--azul-700);
  color: var(--dourado-300);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}
.who strong { display: block; font-size: 0.85rem; }
.who span { font-size: 0.72rem; color: var(--azul-300); }
.content { padding: 1.6rem 2rem 2.5rem; min-width: 0; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}
.toolbar .seg { margin-bottom: 0; width: auto; flex: 0 1 auto; }
.toolbar .seg span { padding-inline: 0.85rem; }
.search { flex: 1 1 14rem; max-width: 22rem; }
.search input {
  width: 100%;
  min-height: 2.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--branco-100);
  padding: 0.5rem 1rem;
  color: var(--preto-900);
}
.search input:focus { outline: 2px solid var(--azul-200); }
.quiet {
  max-width: 28rem;
  padding: 2.25rem 0.25rem;
}
.quiet h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--azul-900);
  margin: 0.35rem 0 0.55rem;
}
.result-panel.compact { min-height: 0; margin-bottom: 1.15rem; }
.section-call {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--azul-900);
  margin: 0 0 0.85rem;
}
.calc-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  align-items: stretch;
}
.calc-cards.dense {
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.calc-cards .result-panel.compact {
  margin-bottom: 0;
  height: 100%;
}
.result-panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin-top: 1.15rem;
}
.result-panel-actions a {
  font-size: 0.875rem;
  font-weight: 600;
}
.result-panel-actions .panel-link { color: var(--dourado-300); }
.result-panel-actions .panel-link-quiet { color: var(--azul-200); }
.proto-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.1rem;
  font-size: 0.75rem;
  color: var(--preto-500);
}
.proto-bar a { color: var(--azul-500); font-weight: 600; }
.brick-slot {
  min-height: 22rem;
  padding: 1.15rem 1.2rem;
  border-radius: 16px;
  background: var(--branco-300);
}
.brick-slot h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--azul-900);
  margin-bottom: 0.35rem;
}
.brick-slot p { font-size: 0.88rem; color: var(--preto-500); }
.brick-slot .actions { margin-top: 1.1rem; }

.result-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem 1.4rem;
  color: #fff;
  min-height: 16rem;
  background:
    radial-gradient(ellipse 80% 55% at 80% 0%, color-mix(in srgb, var(--dourado-500) 26%, transparent), transparent 55%),
    linear-gradient(165deg, var(--azul-700), var(--azul-900) 72%);
}
.result-panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: #fff;
}
.result-panel .timeline li { border-color: color-mix(in srgb, #fff 12%, transparent); }
.result-panel .timeline time { color: var(--dourado-300); }
.result-panel .muted { color: var(--azul-200); }
.result-panel .banner { background: color-mix(in srgb, #fff 8%, transparent); border-color: transparent; color: var(--dourado-100); }

/* ── Auth card (referência Lex-like, cores Penal MM, sem foto) ── */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--branco-200);
}
.auth-card {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(16rem, 1fr);
  width: min(920px, 100%);
  min-height: 560px;
  background: var(--branco-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.auth-form {
  padding: 2.4rem 2.6rem 1.6rem;
  display: flex;
  flex-direction: column;
}
.auth-form .brand { justify-content: center; margin-bottom: 1.4rem; }
.auth-form h1 {
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  color: var(--azul-900);
}
.auth-form .lede {
  text-align: center;
  margin: 0.35rem auto 1.4rem;
  font-size: 0.92rem;
  max-width: 28rem;
}
.auth-form form { flex: 1; }
.auth-form .foot {
  margin-top: auto;
  padding-top: 1.2rem;
  text-align: center;
  font-size: 0.8rem;
}
.auth-form .foot a { color: var(--azul-500); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.auth-copy { font-size: 0.72rem; color: var(--preto-500); text-align: center; margin-top: 1rem; }

.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  width: fit-content;
  padding: 0.28rem;
  margin-bottom: 1.15rem;
  background: var(--branco-300);
  border-radius: var(--radius-pill);
}
.seg::before {
  content: "";
  position: absolute;
  top: 0.28rem;
  bottom: 0.28rem;
  left: 0.28rem;
  border-radius: var(--radius-pill);
  background: var(--azul-900);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.seg:has(> :last-child:nth-child(2))::before { width: calc((100% - 0.56rem) / 2); }
.seg:has(> :last-child:nth-child(3))::before { width: calc((100% - 0.56rem) / 3); }
.seg:has(> :last-child:nth-child(4))::before { width: calc((100% - 0.56rem) / 4); }
.seg:has(label:nth-child(1) input:checked)::before { transform: translateX(0); }
.seg:has(label:nth-child(2) input:checked)::before { transform: translateX(100%); }
.seg:has(label:nth-child(3) input:checked)::before { transform: translateX(200%); }
.seg:has(label:nth-child(4) input:checked)::before { transform: translateX(300%); }
.seg label { position: relative; z-index: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  text-align: center;
  padding: 0.45rem 1rem;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--azul-700);
  background: transparent;
  transition: color 0.2s ease;
}
.seg input:checked + span {
  background: transparent;
  color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  .seg::before { transition: none; }
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 2.1rem 1.6rem;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 55% at 70% 20%, color-mix(in srgb, var(--dourado-500) 28%, transparent), transparent 58%),
    radial-gradient(ellipse 90% 70% at 10% 90%, var(--azul-600), transparent 50%),
    linear-gradient(165deg, var(--azul-700), var(--azul-900) 70%);
}
.auth-visual::before {
  content: "MM";
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -55%);
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 7.5rem);
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--dourado-500) 22%, transparent);
  pointer-events: none;
}
.auth-visual blockquote {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.4;
  max-width: 16ch;
}
.auth-visual cite {
  display: block;
  margin-top: 0.7rem;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dourado-300);
}

/* legado: telas que ainda usam split full-bleed */
.split { display: grid; min-height: 100vh; grid-template-columns: minmax(17rem, 38%) 1fr; }
.brand-panel {
  background:
    radial-gradient(ellipse 90% 70% at 20% 0%, var(--azul-600), transparent 50%),
    var(--azul-900);
  color: #fff;
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.brand-panel h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 400;
  line-height: 1.3;
  max-width: 16ch;
  margin-top: 2.5rem;
}
.brand-panel p { color: var(--azul-200); margin-top: 1rem; max-width: 32ch; }
.form-panel { padding: 3rem 3.5rem; max-width: 34rem; }

/* ── Landing ── */
.hero {
  min-height: 88vh;
  background:
    radial-gradient(ellipse 80% 60% at 80% 10%, var(--azul-600), transparent 45%),
    var(--azul-900);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
}
.hero-nav { display: flex; align-items: center; gap: 1rem; color: var(--azul-200); font-size: 0.9rem; }
.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2.5rem 4rem;
  max-width: 46rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.hero .lede { color: var(--azul-200); font-size: 1.1rem; margin-top: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; }
.band { padding: 3.5rem 2.5rem; }
.band-inner { max-width: 64rem; margin: 0 auto; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.col h2 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 400; margin-bottom: 0.5rem; }
.col p { color: var(--preto-500); font-size: 0.95rem; }
.site-foot {
  padding: 1.25rem 2.5rem 2rem;
  font-size: 0.75rem;
  color: var(--preto-500);
}

/* ── Calc ── */
.calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 1.25rem; align-items: start; }
.fieldset { padding: 1.15rem 1.2rem 1.3rem; }
.fieldset + .fieldset { margin-top: 0.85rem; }
.fieldset h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: 0.9rem;
}
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--branco-300);
  font-size: 0.9rem;
}
.timeline li:last-child { border-bottom: 0; }
.timeline time { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── Misc ── */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.highlight {
  border-left: 3px solid var(--dourado-500);
  padding: 1.1rem 1.2rem;
}
.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--preto-800);
  cursor: pointer;
}
.check input {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  flex: none;
  border-radius: 6px;
  background: var(--branco-300);
  border: 1px solid transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.check input::after {
  content: "";
  width: 0;
  height: 0;
  border-radius: 3px;
  background: var(--azul-900);
}
.check input:checked::after {
  width: 0.625rem;
  height: 0.625rem;
}
.check input:focus-visible { outline: 2px solid var(--azul-200); outline-offset: 2px; }
.check.is-invalid { background: var(--alerta-50); border-radius: 16px; padding: 0.65rem 0.75rem; }
.check input[type="radio"] { border-radius: 999px; }
.check input[type="radio"]::after { border-radius: 999px; }
.plan-grid {
  display: grid;
  gap: 0.9rem;
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
}
.plan-grid-1 {
  grid-template-columns: 1fr;
  max-width: 20rem;
}
.plan-grid-3 { grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); }
.plan-grid-4 { grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); }
.plan-grid-5 { grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); }
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
  min-width: min(16.5rem, 100%);
  padding: 1.15rem 1.2rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--branco-100);
  cursor: pointer;
}
.plan-card strong {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--azul-900);
  overflow-wrap: normal;
  word-break: normal;
}
.plan-card .plan-price {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--azul-900);
  white-space: nowrap;
}
.plan-card .plan-equiv {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--azul-700);
}
.plan-card .check { margin-top: auto; padding-top: 0.85rem; }
.plan-card:has(input:checked) {
  box-shadow: inset 0 0 0 2px var(--azul-900);
}
.plan-card:has(input:focus-visible) {
  outline: 2px solid var(--azul-200);
  outline-offset: 2px;
}
.link-inline {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--azul-500);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-inline:hover { color: var(--azul-700); }

.code-row {
  display: flex;
  gap: 0.35rem;
}
.code-row input {
  width: 2.35rem;
  min-height: 2.75rem;
  padding: 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* ── Drawer lateral (direita) ── */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  visibility: hidden;
}
.drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--azul-900) 46%, transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(28rem, 100%);
  display: flex;
  flex-direction: column;
  background: var(--branco-100);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: -18px 0 50px color-mix(in srgb, var(--azul-900) 16%, transparent);
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
}
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
}
.drawer-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--azul-900);
  margin-top: 0.2rem;
}
.drawer-close {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--branco-300);
  color: var(--azul-700);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}
.drawer-close:hover { background: var(--branco-400); }
.drawer-close:focus-visible { outline: 2px solid var(--azul-200); outline-offset: 2px; }
.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 0 1.5rem 1.5rem;
  color: var(--preto-700);
}
.drawer-body .stack p { max-width: 36rem; }
.drawer-foot {
  padding: 1rem 1.5rem 1.4rem;
  border-top: 1px solid var(--branco-300);
}

/* Loader — cartão com anel girando enquanto a tela prepara */
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--branco-200) 70%, transparent);
}
.loader-card {
  border-radius: var(--radius-lg);
  background: var(--branco-100);
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.loader-spin {
  display: block;
  margin: 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 3px solid var(--branco-300);
  border-top-color: var(--dourado-500);
  animation: loader-spin 0.8s linear infinite;
}
.loader-card .kicker { margin-top: 1rem; }
.loader-card .loader-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--azul-900);
  margin-top: 0.25rem;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loader-spin { animation: none; }
}

@media (max-width: 1200px) {
  .plan-grid-4,
  .plan-grid-5 { grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .split { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; min-height: 0; }
  .auth-visual { min-height: 11rem; }
  .auth-visual::before { font-size: 4.2rem; top: 38%; }
  .brand-panel { min-height: auto; padding-bottom: 1.5rem; }
  .calc, .row-2, .row-13, .row-3, .row-4, .cols-3, .calc-cards, .plan-grid, .plan-grid-3, .plan-grid-4 { grid-template-columns: 1fr; }
  .plan-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content, .form-panel, .hero-body, .hero-top, .band, .site-foot { padding-left: 1.15rem; padding-right: 1.15rem; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .drawer-panel { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; top: 12vh; }
}
@media (max-width: 520px) {
  .plan-grid-5 { grid-template-columns: 1fr; }
}
