@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Sereno DS — tokens originais */
  --teal-900: #12333C;
  --teal-700: #1F4A56;
  --teal-500: #2E6B7A;
  --teal-100: #DCE9EC;
  --orange-500: #F2A359;
  --orange-300: #F7C690;
  --orange-100: #FBE5D0;
  --ink-900: #121212;
  --ink-700: #3A3F42;
  --ink-500: #7A8488;
  --ink-300: #C2CACD;
  --paper: #F7F6F2;
  --surface: #FFFFFF;
  --mist: #D8DDDC;
  --success: #3D9970;
  --success-bg: #E3F2EB;
  --warning: #E5A33B;
  --warning-bg: #FCF0DB;
  --danger: #D9534F;
  --danger-bg: #FBE4E3;
  --info: #4A90D9;
  --info-bg: #E2EEFA;

  /* Aliases do spec (mapeados ao Sereno) */
  --cor-primaria: var(--teal-700);
  --cor-secundaria: var(--teal-500);
  --cor-destaque: var(--orange-500);
  --cor-botao-primario: var(--orange-500);
  --cor-botao-primario-texto: var(--teal-900);
  --cor-fundo: var(--paper);
  --cor-texto-primario: var(--ink-900);
  --cor-texto-secundario: var(--ink-500);
  --header-bg: rgba(247, 246, 242, 0.92);
  --app-gradient-start: var(--teal-100);
  --surface-raised: var(--surface);
  --surface-hover: var(--teal-100);
  --border-subtle: var(--teal-100);
  --focus-ring: var(--teal-100);
  --fonte-principal: 'Plus Jakarta Sans', system-ui, sans-serif;
  --border-radius: 6px;
  --sombra-cards: 0 8px 24px rgba(18, 51, 60, 0.08);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --shadow-soft: var(--sombra-cards);
  --shadow-float: 0 16px 40px rgba(18, 51, 60, 0.14);
  --shadow-btn: 0 8px 20px rgba(18, 51, 60, 0.22);
  --shadow-fab: var(--shadow-btn);
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --app-max: 480px;
  --header-h: 56px;
  --cta-h: 88px;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0C181C;
  --surface: #14282E;
  --surface-raised: #1A3239;
  --surface-hover: #1E3A42;
  --mist: #0A1417;
  --ink-900: #EEF2F3;
  --ink-700: #B8C4C8;
  --ink-500: #8A989D;
  --ink-300: #3D5259;
  --teal-100: #1A3239;
  --orange-100: #2E2218;
  --orange-300: #5C4228;
  --success-bg: #143328;
  --warning-bg: #332A18;
  --danger-bg: #331A19;
  --info-bg: #182A3D;
  --cor-fundo: var(--paper);
  --cor-texto-primario: var(--ink-900);
  --cor-texto-secundario: var(--ink-500);
  --header-bg: rgba(20, 40, 46, 0.92);
  --app-gradient-start: var(--teal-900);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --focus-ring: var(--teal-500);
  --sombra-cards: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-float: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-btn: 0 8px 20px rgba(0, 0, 0, 0.55);
  --shadow-fab: var(--shadow-btn);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--fonte-principal);
  background: var(--cor-fundo);
  color: var(--cor-texto-primario);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100dvh;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== App shell ===== */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: var(--app-max);
  margin: 0 auto;
  background: var(--cor-fundo);
  position: relative;
}

.app::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, var(--app-gradient-start) 0%, var(--cor-fundo) 220px);
  z-index: -1;
  pointer-events: none;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  min-height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.app-header__brand {
  flex: 1;
  min-width: 0;
}

.app-header__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cor-texto-primario);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  color: var(--cor-primaria);
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.app-header__back:focus-visible {
  outline: 3px solid var(--teal-100);
  outline-offset: 2px;
}

/* Progress block — amigável */
.app-progress {
  padding: 0 var(--sp-4) var(--sp-4);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

.progress-meta__step {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--cor-primaria);
  letter-spacing: 0.02em;
}

.progress-meta__pct {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cor-texto-secundario);
}

.progress-bar {
  height: 8px;
  background: var(--teal-100);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cor-primaria), var(--cor-secundaria));
  border-radius: var(--radius-pill);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 8px;
}

/* Stepper horizontal amigável */
.stepper {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-1);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-3);
}

.stepper__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  text-align: center;
}

.stepper__item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 18px);
  width: calc(100% - 18px);
  height: 3px;
  background: var(--ink-300);
  border-radius: 2px;
  z-index: 0;
}

.stepper__item--completed:not(:last-child)::after {
  background: var(--success);
}

.stepper__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--surface);
  border: 2px solid var(--ink-300);
  color: var(--cor-texto-secundario);
  position: relative;
  z-index: 1;
  transition: all 0.25s ease;
}

.stepper__item--active .stepper__dot {
  background: var(--cor-primaria);
  border-color: var(--cor-primaria);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(31, 74, 86, 0.35);
}

.stepper__item--completed .stepper__dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.stepper__label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--cor-texto-secundario);
  line-height: 1.15;
  max-width: 56px;
}

.stepper__item--active .stepper__label {
  color: var(--cor-primaria);
  font-weight: 800;
}

.stepper__item--completed .stepper__label {
  color: var(--ink-700);
}

@media (max-width: 380px) {
  .stepper__label { display: none; }
  .stepper__item--active .stepper__label { display: block; max-width: 72px; }
}

.progress-encouragement {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-700);
  text-align: center;
  padding: var(--sp-3);
  background: var(--orange-100);
  border-radius: var(--radius-md);
  line-height: 1.4;
}

.progress-sub {
  font-size: 0.72rem;
  color: var(--cor-texto-secundario);
  text-align: center;
  margin-top: var(--sp-2);
}

/* Main */
.app-main {
  flex: 1;
  padding: 0 var(--sp-4) calc(var(--cta-h) + var(--sp-6));
  animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head { margin-bottom: var(--sp-5); }

.page-head__title {
  font-size: clamp(1.35rem, 4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--sp-2);
}

.page-head__title em {
  font-style: normal;
  color: var(--cor-destaque);
}

.page-head__subtitle {
  font-size: 0.92rem;
  color: var(--cor-texto-secundario);
}

/* ===== Carteirinha page shell ===== */
.carteirinha-page .app-header,
.carteirinha-page .app-progress {
  display: none;
}

.carteirinha-page .app::before {
  display: none;
}

.carteirinha-page .app {
  background: var(--surface);
}

.carteirinha-page .app-main {
  padding-top: 0;
  padding-bottom: var(--sp-8);
  position: relative;
  z-index: 2;
}

/* ===== Entrada CPF ===== */
.page-entrada .app-progress {
  display: none;
}

.cpf-dica {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--teal-100);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  color: var(--ink-700);
  line-height: 1.5;
}

.cpf-dica strong {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--cor-primaria);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cpf-dica code {
  font-family: inherit;
  font-weight: 700;
  color: var(--cor-primaria);
}

/* Footer help */
.app-footer {
  padding: var(--sp-4);
  text-align: center;
  font-size: 0.82rem;
  color: var(--cor-texto-secundario);
}

.app-footer a {
  color: var(--cor-primaria);
  font-weight: 700;
  text-decoration: none;
}

.app-footer a:focus-visible {
  outline: 3px solid var(--teal-100);
  border-radius: var(--radius-sm);
}

/* Sticky CTA */
.app-cta {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--cor-fundo) 75%, transparent);
  z-index: 40;
}

.app-cta__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.app-cta__inner--row {
  flex-direction: row;
}

.app-cta__inner--row .btn-primary,
.app-cta__inner--row .btn-ghost {
  flex: 1;
}

/* Hub */
.hub {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--sp-6);
  padding-bottom: var(--sp-12);
}

.hub-hero {
  background: linear-gradient(155deg, var(--teal-900) 0%, var(--cor-primaria) 60%, var(--teal-500) 100%);
  color: #fff;
  padding: var(--sp-10) var(--sp-6);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  margin: calc(-1 * var(--sp-6)) calc(-1 * var(--sp-6)) var(--sp-8);
}

.hub-hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hub-hero h1 em { font-style: normal; color: var(--cor-destaque); }

.hub-hero__lead {
  color: var(--teal-100);
  margin-top: var(--sp-4);
  max-width: 560px;
  line-height: 1.55;
}

.hub-hero__cta {
  margin-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.hub-hero__cta .btn-primary {
  font-size: 1rem;
  padding: 16px 32px;
}

.hub-hero__hint {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}

.hub-section { margin-bottom: var(--sp-10); }

.hub-section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}

.hub-section__desc {
  color: var(--cor-texto-secundario);
  font-size: 0.92rem;
  margin-bottom: var(--sp-5);
  max-width: 640px;
}

.hub-flow {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.hub-flow__step {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hub-flow__num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cor-primaria);
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hub-flow__body b { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.hub-flow__body p { font-size: 0.85rem; color: var(--cor-texto-secundario); margin: 0; }
.hub-flow__body a { color: var(--cor-primaria); font-weight: 700; text-decoration: none; font-size: 0.82rem; }

.hub-flow__branch {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--teal-100);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  color: var(--ink-700);
  line-height: 1.45;
}

.hub-cenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
}

.hub-cenario {
  padding: var(--sp-5);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.hub-cenario__cpf {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--cor-primaria);
}

.hub-cenario p { font-size: 0.85rem; color: var(--cor-texto-secundario); flex: 1; }

.hub-cenario button {
  margin-top: var(--sp-2);
  align-self: flex-start;
}

.hub-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.hub-shortcuts button,
.hub-shortcuts a {
  padding: 10px 16px;
  background: var(--orange-100);
  color: var(--teal-900);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--fonte-principal);
}

.hub-shortcuts button:hover,
.hub-shortcuts a:hover {
  background: var(--orange-300);
}

.hub-shortcuts button.hub-shortcuts__dev {
  background: var(--teal-100);
  color: var(--cor-primaria);
}

.hub-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--teal-100);
  color: var(--cor-primaria);
  white-space: nowrap;
}

.hub-tag--erro { background: var(--danger-bg); color: var(--danger); }
.hub-tag--entrada { background: var(--orange-100); color: var(--teal-900); }
.hub-tag--carteirinha { background: var(--success-bg); color: var(--success); }

.hub-table-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--sombra-cards);
  overflow: auto;
}

.hub-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.hub-table th, .hub-table td { padding: 12px 16px; text-align: left; vertical-align: top; }
.hub-table th { background: var(--cor-primaria); color: #fff; position: sticky; top: 0; }
.hub-table tr:not(:last-child) td { border-bottom: 1px solid var(--teal-100); }
.hub-table a { color: var(--cor-primaria); font-weight: 600; text-decoration: none; }
.hub-table a:hover { text-decoration: underline; }

.hub-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  font-size: 0.78rem;
  color: var(--cor-texto-secundario);
}

.hub-legend span { display: inline-flex; align-items: center; gap: 6px; }

.standalone-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  max-width: var(--app-max);
  margin: 0 auto;
}

.page-alt-action {
  text-align: center;
  margin-top: var(--sp-5);
}

.page-alt-action p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--cor-texto-secundario);
  line-height: 1.5;
}

.page-alt-action p + p {
  margin-top: var(--sp-2);
}

.page-alt-action strong {
  color: var(--cor-texto-primario);
  font-weight: 800;
}

.page-alt-action a {
  color: var(--cor-primaria);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-alt-action a:focus-visible {
  outline: 3px solid var(--teal-100);
  border-radius: var(--radius-sm);
}

.text-small { font-size: 0.82rem; color: var(--cor-texto-secundario); }
.text-secondary { color: var(--cor-texto-secundario); font-size: 0.85rem; }
.valor-destaque { font-size: 1.15rem; font-weight: 800; color: var(--cor-primaria); }
.optional { font-weight: 400; color: var(--cor-texto-secundario); }

@media (min-width: 640px) and (max-width: 1023px) {
  :root { --app-max: 520px; }
  .app-main { padding-left: var(--sp-6); padding-right: var(--sp-6); }
}
/* ===== Buttons BEM ===== */
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--fonte-principal);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--cor-botao-primario);
  color: var(--cor-botao-primario-texto);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) { transform: translateY(-2px); background: var(--orange-300); }
.btn-secondary { background: var(--cor-primaria); color: #fff; }
.btn-ghost { background: transparent; color: var(--cor-primaria); border: 2px solid var(--cor-primaria); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 9px 18px; font-size: 0.82rem; }
.btn-icon { min-width: 44px; min-height: 44px; padding: 0; width: 44px; }

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible {
  outline: 3px solid var(--teal-100);
  outline-offset: 2px;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--sombra-cards);
  overflow: hidden;
  padding: var(--sp-4);
}

.card-header { padding: var(--sp-4) var(--sp-5) var(--sp-2); }
.card-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.card + .card { margin-top: var(--sp-4); }

/* ===== Alerts BEM ===== */
.alert {
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: var(--sp-4);
}

.alert p + p { margin-top: var(--sp-2); }
.alert--info { background: var(--info-bg); color: #2A6CAF; }
.alert--success { background: var(--success-bg); color: var(--success); }
.alert--warning { background: var(--warning-bg); color: #A8721F; }
.alert--error { background: var(--danger-bg); color: var(--danger); }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--modalidade { background: var(--teal-100); color: var(--cor-primaria); }
.badge--cobrado { background: var(--orange-100); color: var(--teal-900); }
.badge--ativo { background: var(--success-bg); color: var(--success); }

.plano-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--teal-100);
  color: var(--cor-primaria);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: var(--sp-4);
}

.plano-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cor-primaria);
}

/* ===== Forms BEM ===== */
.form-group { margin-bottom: var(--sp-4); }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-700);
  margin-bottom: var(--sp-2);
}

.form-input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font-family: var(--fonte-principal);
  font-size: 1rem;
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-md);
  background: var(--surface);
  outline: none;
  color: var(--cor-texto-primario);
}

.form-input:focus,
.form-group select:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px var(--teal-100);
}

.form-error {
  display: block;
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: var(--sp-1);
  min-height: 1.2em;
}

#cep-status.is-loading { color: var(--cor-texto-secundario); }
#cep-status.is-success { color: var(--success); }
#cep-status.is-error { color: var(--danger); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.form-group--checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  cursor: pointer;
}

.form-group--checkbox input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--cor-primaria);
  flex-shrink: 0;
}

@media (max-width: 400px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ===== Plano cards ===== */
.planos-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .planos-grid { grid-template-columns: repeat(2, 1fr); }
}

.plano-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.plano-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-float);
}

.plano-card__titulo { font-size: 1.15rem; font-weight: 800; margin-bottom: var(--sp-2); }

.plano-card__descricao {
  font-size: 0.88rem;
  color: var(--cor-texto-secundario);
  margin-bottom: var(--sp-3);
}

.plano-card__detalhes {
  list-style: none;
  font-size: 0.85rem;
  margin-bottom: var(--sp-4);
}

.plano-card__detalhes li {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--teal-100);
}

.plano-card__detalhes li:last-child { border-bottom: none; }

/* ===== OTP ===== */
.otp-inputs {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  flex-wrap: nowrap;
  margin: var(--sp-4) 0;
  padding: 2px 0;
}

.otp-inputs .otp-digit {
  flex: 0 0 52px;
  width: 52px;
  height: 56px;
  min-height: 56px;
  max-width: 52px;
  padding: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 56px;
  border: 2px solid var(--ink-300);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.otp-inputs .otp-digit:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 3px var(--teal-100);
  outline: none;
}

@media (max-width: 380px) {
  .otp-inputs {
    gap: 6px;
  }

  .otp-inputs .otp-digit {
    flex: 0 0 46px;
    width: 46px;
    max-width: 46px;
    height: 52px;
    min-height: 52px;
    line-height: 52px;
    font-size: 1.35rem;
  }
}

.otp-single {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  display: block;
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.5rem;
  font-weight: 800;
}

.otp-timer { text-align: center; font-size: 0.88rem; color: var(--cor-texto-secundario); margin: var(--sp-3) 0; }

#bloco-otp { animation: fadeUp 0.4s ease; }

/* ===== Beneficiários ===== */
.page-split {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

@media (min-width: 640px) {
  .page-split { flex-direction: row; align-items: flex-start; }
  .page-split__main { flex: 1; }
  .page-split__aside { width: 220px; flex-shrink: 0; }
}

.lista-beneficiarios__titulo {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: var(--sp-3);
  color: var(--cor-texto-primario);
}

.lista-beneficiarios { display: flex; flex-direction: column; gap: var(--sp-3); }

.lista-beneficiarios__vazio {
  text-align: center;
  padding: var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

#btn-add-dependente:disabled,
#btn-add-dependente.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.beneficiario-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--sombra-cards);
}

.beneficiario-item__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cor-secundaria);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.beneficiario-item--titular .beneficiario-item__avatar {
  background: var(--cor-primaria);
}

.beneficiario-item__info { flex: 1; min-width: 0; }
.beneficiario-item__info strong { display: block; font-size: 0.95rem; }
.beneficiario-item__info .badge { margin: 4px 0; }

.resumo-valores { padding: var(--sp-5); background: var(--orange-100); border-radius: var(--radius-lg); }
.resumo-valores h3 { font-size: 0.85rem; margin-bottom: var(--sp-3); color: var(--ink-700); }
.resumo-valores dl { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); font-size: 0.88rem; }
.resumo-valores dt { color: var(--cor-texto-secundario); }
.resumo-valores dd { font-weight: 800; text-align: right; }

/* Modal / dialog */
.modal-dependente {
  border: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0;
  max-width: var(--app-max);
  width: 100%;
  max-height: 92dvh;
  box-shadow: var(--shadow-float);
}

.modal-dependente::backdrop { background: rgba(18, 51, 60, 0.45); }

.modal-dependente__inner { padding: var(--sp-6) var(--sp-5); }
.modal-dependente__inner h2 { margin-bottom: var(--sp-4); }
.modal-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.modal-actions .btn-primary, .modal-actions .btn-ghost { flex: 1; }

@media (min-width: 640px) {
  .modal-dependente {
    border-radius: var(--radius-lg);
    max-width: 440px;
  }
}

/* ===== Resumo vidas ===== */
.bloco-titular { padding: var(--sp-5); margin-bottom: var(--sp-4); }
.lista-vidas-cobradas { list-style: none; margin-bottom: var(--sp-4); }

.vida-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: var(--sp-2);
}

.bloco-cobranca { padding: var(--sp-5); background: var(--orange-100); border-radius: var(--radius-lg); }
.bloco-cobranca p + p { margin-top: var(--sp-2); }

/* ===== Contrato ===== */
.contrato-layout { display: flex; flex-direction: column; gap: var(--sp-4); }

.contrato-resumo { padding: var(--sp-4); background: var(--orange-100); border-radius: var(--radius-lg); }
.contrato-resumo dl { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2); font-size: 0.85rem; }

.contrato-conteudo {
  max-height: 50vh;
  overflow-y: auto;
  padding: var(--sp-5);
  font-size: 0.85rem;
  line-height: 1.65;
}

.clausula { margin-bottom: var(--sp-4); }
.clausula__titulo { font-size: 0.95rem; font-weight: 700; margin-bottom: var(--sp-2); color: var(--cor-primaria); }

.contrato-progresso { margin: var(--sp-3) 0 var(--sp-2); }
.contrato-progresso progress { width: 100%; height: 8px; border-radius: var(--radius-pill); }

.contrato-hint {
  font-size: 0.85rem;
  color: var(--cor-texto-secundario);
  margin-bottom: var(--sp-4);
  line-height: 1.45;
}

.contrato-marca-fim {
  margin-top: var(--sp-6);
  padding: var(--sp-4);
  text-align: center;
  background: var(--teal-100);
  border-radius: var(--radius-md);
  color: var(--cor-primaria);
}

.contrato-marca-fim span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.contrato-marca-fim p {
  font-size: 0.82rem;
  color: var(--ink-700);
  line-height: 1.45;
}

.contrato-aceite label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.contrato-aceite label strong {
  font-size: 0.92rem;
  color: var(--cor-texto-primario);
}

.contrato-aceite label span {
  font-size: 0.82rem;
  color: var(--cor-texto-secundario);
  font-weight: 400;
}

.contrato-aceite input:disabled + label {
  opacity: 0.55;
  cursor: not-allowed;
}

.tabela-beneficiarios { width: 100%; font-size: 0.78rem; border-collapse: collapse; }
.tabela-beneficiarios th, .tabela-beneficiarios td { padding: var(--sp-2); text-align: left; border-bottom: 1px solid var(--teal-100); }

/* ===== Assinatura ===== */
.signature-pad {
  border: 2px dashed var(--ink-300);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: 280px;
  min-height: 240px;
  touch-action: none;
  cursor: crosshair;
}

@media (min-width: 1024px) {
  .signature-pad canvas {
    height: 340px;
    min-height: 300px;
  }
}

.signature-pad__actions { padding: var(--sp-2) var(--sp-3); }

.formas-pagamento { border: none; margin: var(--sp-4) 0; }
.formas-pagamento legend { font-size: 0.82rem; font-weight: 700; margin-bottom: var(--sp-3); }

.radio-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: var(--sp-2);
  cursor: pointer;
  font-weight: 600;
}

.radio-card:has(input:checked) {
  background: var(--orange-100);
  box-shadow: inset 0 0 0 2px var(--cor-destaque);
}

.radio-card input { width: 20px; height: 20px; accent-color: var(--cor-destaque); }

/* ===== Pagamento ===== */
.pagamento-cartao {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.cc-preview {
  position: relative;
  aspect-ratio: 1.586 / 1;
  max-width: 420px;
  margin: 0 auto var(--sp-2);
  padding: var(--sp-5);
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal-700) 0%, var(--teal-900) 100%);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cc-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.18) 0%, transparent 42%);
  pointer-events: none;
}

.cc-preview[data-brand="visa"] {
  background: linear-gradient(135deg, #1a1f71 0%, #2d4aa8 55%, #4b6fd6 100%);
}

.cc-preview[data-brand="mastercard"] {
  background: linear-gradient(135deg, #1a1a2e 0%, #3d3d3d 45%, #5a5a5a 100%);
}

.cc-preview[data-brand="amex"] {
  background: linear-gradient(135deg, #016fd0 0%, #2d8fd9 100%);
}

.cc-preview[data-brand="elo"] {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #ffcb05 120%);
}

.cc-preview[data-brand="hipercard"] {
  background: linear-gradient(135deg, #8b0000 0%, #cc0000 55%, #ff3333 100%);
}

.cc-preview__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  position: relative;
  z-index: 1;
}

.cc-preview__chip {
  width: 44px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #d4af37 0%, #f5e6a8 40%, #c9a227 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.cc-preview__brand {
  text-align: right;
  min-width: 72px;
}

.cc-preview[data-brand="generic"] .cc-preview__brand {
  display: none;
}

.cc-preview__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a2e;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-style: italic;
}

.cc-preview[data-brand="visa"] .cc-preview__brand-mark {
  color: #1a1f71;
  font-style: italic;
}

.cc-preview[data-brand="mastercard"] .cc-preview__brand-mark {
  background: transparent;
  color: transparent;
  font-size: 0;
  min-width: 48px;
  position: relative;
}

.cc-preview[data-brand="mastercard"] .cc-preview__brand-mark::before,
.cc-preview[data-brand="mastercard"] .cc-preview__brand-mark::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.cc-preview[data-brand="mastercard"] .cc-preview__brand-mark::before {
  left: 0;
  background: #eb001b;
  opacity: 0.95;
}

.cc-preview[data-brand="mastercard"] .cc-preview__brand-mark::after {
  right: 0;
  background: #f79e1b;
  opacity: 0.95;
}

.cc-preview[data-brand="elo"] .cc-preview__brand-mark {
  background: #ffcb05;
  color: #1a1a1a;
  font-style: normal;
}

.cc-preview[data-brand="amex"] .cc-preview__brand-mark {
  background: #fff;
  color: #016fd0;
  font-style: normal;
  letter-spacing: 0.08em;
}

.cc-preview__brand-label {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.cc-preview__number {
  position: relative;
  z-index: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(1rem, 4.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  word-spacing: 0.2em;
  margin: var(--sp-4) 0;
}

.cc-preview__footer {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  position: relative;
  z-index: 1;
}

.cc-preview__label {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 2px;
}

.cc-preview__name,
.cc-preview__expiry {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.cc-preview__expiry {
  max-width: 72px;
  text-align: right;
}

/* Mobile: apenas formulário (sem preview animado) */
.pagamento-cartao .cc-preview {
  display: none;
}

@media (min-width: 1024px) {
  html[data-layout="desktop"] .pagamento-cartao {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--sp-6);
    align-items: start;
  }

  .pagamento-cartao .cc-preview {
    display: flex;
    width: 100%;
    max-width: none;
    margin: 0;
    position: sticky;
    top: var(--sp-4);
    padding: var(--sp-6);
  }

  html[data-layout="desktop"] .pagamento-cartao .cc-preview__number {
    font-size: 1.45rem;
  }
}

.resumo-pagamento { padding: var(--sp-5); margin-bottom: var(--sp-4); background: var(--orange-100); border-radius: var(--radius-lg); }
.resumo-pagamento dl { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); font-size: 0.88rem; margin-bottom: var(--sp-3); }

.barcode-text {
  font-family: monospace;
  font-size: 0.72rem;
  letter-spacing: 1px;
  word-break: break-all;
  padding: var(--sp-4);
  background: var(--paper);
  border-radius: var(--radius-md);
  text-align: center;
}

.pix-qrcode, .barcode-img {
  width: 180px;
  height: 180px;
  margin: var(--sp-4) auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--cor-texto-secundario);
}

/* ===== Confirmação ===== */
.confirmacao { text-align: center; }
.confirmacao__icone {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-4);
}

.confirmacao__icone--pending { background: var(--warning-bg); color: var(--warning); }
.confirmacao__mensagem { color: var(--cor-texto-secundario); margin-bottom: var(--sp-5); }

.plano-ativo, .fatura-pendente { padding: var(--sp-5); text-align: left; margin-bottom: var(--sp-4); }
.plano-ativo dl, .fatura-pendente dl { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); font-size: 0.88rem; margin-top: var(--sp-3); }

.lista-beneficiarios--compact .beneficiario-item { padding: var(--sp-3); box-shadow: none; background: var(--paper); }

/* ===== Senha ===== */
.regras-senha { list-style: none; margin: var(--sp-4) 0; }
.regras-senha li { font-size: 0.85rem; padding: var(--sp-2) 0; color: var(--cor-texto-secundario); }
.regras-senha li::before { content: '○ '; }
.regras-senha li.regra--ok { color: var(--success); }
.regras-senha li.regra--ok::before { content: '✓ '; }

#senha-forca { width: 100%; height: 8px; margin-top: var(--sp-2); }

/* ===== Carteirinha (layout inspirado em app bancário) ===== */
.carteirinha-hero {
  background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-700) 55%, var(--teal-500) 100%);
  color: #fff;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: var(--sp-4) var(--sp-4) var(--sp-5);
  margin-bottom: calc(-1 * var(--sp-6));
  position: relative;
  z-index: 1;
}

.cliente-page .carteirinha-hero {
  margin-bottom: 0;
  padding-bottom: var(--sp-5);
}

.cliente-home {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.cliente-home__carteirinha {
  margin-top: calc(-1 * var(--sp-2));
}

.cliente-home__carteirinha .carteirinha-card {
  margin-bottom: 0;
}

.cliente-home__link {
  margin-top: var(--sp-1);
}

/* Central do cliente — cartões de pagamento */
.cliente-cartoes {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.cliente-cartoes__lista {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.cliente-cartoes__vazio {
  font-size: 0.9rem;
  color: var(--cor-texto-secundario);
  text-align: center;
  padding: var(--sp-5);
}

.cliente-cartao-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  overflow: hidden;
}

.cliente-cartao-item__main {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-3);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--paper, var(--cor-fundo));
  color: inherit;
  font-family: var(--fonte-principal);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.cliente-cartao-item__main:hover {
  border-color: var(--teal-100);
  transform: translateY(-1px);
}

.cliente-cartao-item__main.is-active {
  border-color: var(--cor-primaria);
  background: var(--teal-100);
}

.cliente-cartao-item__chip {
  width: 48px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal-700) 0%, var(--teal-900) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.cliente-cartao-item__chip[data-brand="visa"] {
  background: linear-gradient(135deg, #1a1f71 0%, #4b6fd6 100%);
}

.cliente-cartao-item__chip[data-brand="mastercard"] {
  background: linear-gradient(135deg, #1a1a2e 0%, #5a5a5a 100%);
}

.cliente-cartao-item__chip[data-brand="amex"] {
  background: linear-gradient(135deg, #016fd0 0%, #2d8fd9 100%);
}

.cliente-cartao-item__chip[data-brand="elo"] {
  background: linear-gradient(135deg, #1a1a1a 0%, #ffcb05 120%);
}

.cliente-cartao-item__chip[data-brand="hipercard"] {
  background: linear-gradient(135deg, #8b0000 0%, #ff3333 100%);
}

.cliente-cartao-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.cliente-cartao-item__bandeira {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
}

.cliente-cartao-item__numero {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.cliente-cartao-item__meta {
  font-size: 0.78rem;
  color: var(--cor-texto-secundario);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cliente-cartao-item__remove {
  align-self: flex-end;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.82rem;
}

.cliente-cartoes__form.is-hidden {
  display: none;
}

.cliente-cartoes__form-titulo {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: var(--sp-4);
}

.cliente-cartoes__add.is-hidden {
  display: none;
}

.carteirinha-hero__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.carteirinha-hero__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.carteirinha-hero__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
}

.cliente-page .carteirinha-hero__bar {
  width: 100%;
}

.cliente-page .carteirinha-hero__greeting {
  flex: 1;
  min-width: 0;
}

.carteirinha-hero__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.cliente-page .carteirinha-hero__menu {
  margin-left: auto;
}

.carteirinha-hero__menu-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.carteirinha-hero__menu-icon::before,
.carteirinha-hero__menu-icon::after,
.carteirinha-hero__menu-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.carteirinha-hero__menu-icon::before { content: ''; top: 0; }
.carteirinha-hero__menu-icon span { top: 5px; }
.carteirinha-hero__menu-icon::after { content: ''; bottom: 0; }

.carteirinha-hero__greeting {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Central do cliente — menu lateral */
.cliente-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  visibility: hidden;
}

.cliente-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.cliente-drawer__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(18, 51, 60, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.cliente-drawer.is-open .cliente-drawer__backdrop {
  opacity: 1;
}

.cliente-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  width: min(300px, 86vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--cor-texto);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(18, 51, 60, 0.2));
  transform: translateX(-100%);
  transition: transform 0.28s ease;
}

.cliente-drawer.is-open .cliente-drawer__panel {
  transform: translateX(0);
}

.cliente-drawer__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4);
  background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-700) 100%);
  color: #fff;
}

.cliente-drawer__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
}

.cliente-drawer__brand {
  flex: 1;
  min-width: 0;
}

.cliente-drawer__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: var(--sp-1);
}

.cliente-drawer__nome {
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cliente-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.cliente-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-4);
  flex: 1;
  overflow-y: auto;
}

.cliente-drawer__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--cor-texto);
  background: var(--paper, var(--cor-fundo));
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.cliente-drawer__link:hover {
  background: var(--teal-100);
  transform: translateX(2px);
}

.cliente-drawer__link.is-active {
  background: var(--orange-100);
  color: var(--cor-primaria);
}

.cliente-drawer__footer {
  padding: var(--sp-4);
  border-top: 1px solid var(--mist, #D8DDDC);
  font-size: 0.82rem;
  color: var(--cor-texto-secundario);
}

.cliente-drawer__footer a {
  color: var(--cor-primaria);
  font-weight: 700;
}

body.cliente-menu-open {
  overflow: hidden;
}

.cliente-contrato-resumo {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.cliente-contrato-resumo__card {
  padding: var(--sp-5);
}

.cliente-contrato-resumo__btn {
  margin-top: calc(-1 * var(--sp-2));
}

.cliente-contrato-resumo__card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-4);
  font-size: 0.88rem;
}

.cliente-contrato-clausulas {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.cliente-contrato-clausula h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: var(--sp-2);
}

.cliente-contrato-clausula p {
  font-size: 0.88rem;
  color: var(--cor-texto-secundario);
  line-height: 1.5;
}

.cliente-pdf-card {
  padding: var(--sp-6);
  text-align: center;
}

.cliente-pdf-card__icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
}

.cliente-pdf-card p {
  color: var(--cor-texto-secundario);
  font-size: 0.9rem;
  margin-bottom: var(--sp-5);
  line-height: 1.5;
}

.carteirinha-tabs {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-1);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carteirinha-tabs::-webkit-scrollbar { display: none; }

.carteirinha-tabs .tab {
  flex-shrink: 0;
  padding: var(--sp-2) 0;
  border: none;
  background: transparent;
  font-family: var(--fonte-principal);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.carteirinha-tabs .tab.active {
  color: #fff;
  border-bottom-color: var(--orange-500);
}

.carteirinha-card {
  position: relative;
  background: linear-gradient(145deg, var(--teal-500) 0%, var(--teal-700) 48%, var(--teal-900) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-float);
  margin: 0 var(--sp-4) var(--sp-5);
  z-index: 2;
}

.carteirinha-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70%;
  height: 80%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.carteirinha-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 55%;
  height: 70%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.carteirinha-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5) 0;
  position: relative;
  z-index: 1;
}

.carteirinha-card__numero {
  font-size: 0.72rem;
  opacity: 0.8;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.carteirinha-card__operadora {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.9;
}

.carteirinha-card__logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.carteirinha-card__body {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  position: relative;
  z-index: 1;
}

.carteirinha-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: var(--sp-1);
}

.carteirinha-card__nome {
  font-size: clamp(1.35rem, 5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--sp-1);
}

.carteirinha-card__cpf,
.carteirinha-card__plano {
  font-size: 0.88rem;
  opacity: 0.88;
}

.carteirinha-card__plano { margin-bottom: var(--sp-4); }

.carteirinha-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-3);
}

.carteirinha-card__datas {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-1) var(--sp-3);
  font-size: 0.75rem;
  padding: var(--sp-3);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  flex: 1;
}

.carteirinha-card__datas dt { opacity: 0.7; }
.carteirinha-card__datas dd { font-weight: 700; }

.carteirinha-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.carteirinha-card__actions .btn-ghost {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 0.82rem;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.carteirinha-card__actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: none;
}

.carteirinha-card .badge--ativo {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.carteirinha-dependentes-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding-bottom: var(--sp-5);
}

.carteirinha-dependentes-list .carteirinha-card {
  margin-bottom: 0;
}

.carteirinha-dependentes-empty {
  margin: var(--sp-4);
  padding: var(--sp-5);
  text-align: center;
  color: var(--cor-texto-secundario);
  font-size: 0.9rem;
}

.carteirinha-painel {
  padding: 0 var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.carteirinha-proxima-cobranca {
  padding: var(--sp-5);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: var(--sp-1) var(--sp-4);
  align-items: center;
}

.carteirinha-proxima-cobranca__titulo {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cor-texto-secundario);
  margin-bottom: var(--sp-1);
}

.carteirinha-proxima-cobranca__data {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cor-texto-primario);
}

.carteirinha-proxima-cobranca__valor {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cor-primaria);
  text-align: right;
}

.carteirinha-proxima-cobranca__label {
  font-size: 0.78rem;
  color: var(--cor-texto-secundario);
}

.carteirinha-faturas__titulo {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: var(--sp-3);
  color: var(--cor-texto-primario);
}

.carteirinha-faturas__lista {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.carteirinha-fatura {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.carteirinha-fatura:hover {
  box-shadow: var(--shadow-float);
  transform: translateY(-2px);
}

.carteirinha-fatura__info {
  flex: 1;
  min-width: 0;
}

.carteirinha-fatura__ref {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.carteirinha-fatura__meta {
  font-size: 0.78rem;
  color: var(--cor-texto-secundario);
}

.carteirinha-fatura__valor {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--cor-texto-primario);
  flex-shrink: 0;
}

.carteirinha-fatura__chevron {
  font-size: 1.1rem;
  color: var(--cor-texto-secundario);
  flex-shrink: 0;
}

/* Detalhe da fatura */
.fatura-detalhe__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.fatura-detalhe__ref {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-1);
}

.fatura-detalhe__numero {
  font-size: 0.82rem;
  color: var(--cor-texto-secundario);
}

.fatura-detalhe__valor-card {
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  background: var(--orange-100);
  border-radius: var(--radius-lg);
  text-align: center;
}

.fatura-detalhe__valor-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cor-texto-secundario);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
}

.fatura-detalhe__valor {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 800;
  color: var(--cor-primaria);
  letter-spacing: -0.02em;
}

.fatura-detalhe__info {
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.fatura-detalhe__info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-4);
  font-size: 0.88rem;
}

.fatura-detalhe__info dt {
  color: var(--cor-texto-secundario);
}

.fatura-detalhe__info dd {
  font-weight: 700;
  text-align: right;
}

.fatura-detalhe__itens {
  margin-bottom: var(--sp-4);
}

.fatura-detalhe__itens-titulo {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: var(--sp-3);
}

.fatura-detalhe__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  text-decoration: none;
  color: inherit;
}

.fatura-detalhe__item-desc {
  font-size: 0.88rem;
  font-weight: 600;
}

.fatura-detalhe__item-valor {
  font-size: 0.88rem;
  font-weight: 800;
  flex-shrink: 0;
}

.fatura-detalhe__cta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.badge--paga { background: var(--success-bg); color: var(--success); }
.badge--pendente { background: var(--warning-bg); color: #A8721F; }
.badge--vencida { background: var(--danger-bg); color: var(--danger); }

.carteirinha-actions { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Hidden utility */
[hidden] { display: none !important; }

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

.fade-in { animation: fadeUp 0.35s ease; }
/* ===== Layout responsivo — mobile vs desktop ===== */
:root {
  --bp-desktop: 1024px;
  --sidebar-w: 280px;
  --content-max: 880px;
  --content-narrow: 520px;
}

/* Mobile (padrão): sidebar oculta, app em coluna estreita */
.app-sidebar,
.hub-sidebar {
  display: none;
}

.app-layout,
.hub-layout {
  min-height: 100dvh;
}

/* Tablet grande ainda usa layout mobile */
@media (min-width: 640px) and (max-width: 1023px) {
  :root { --app-max: 520px; }
}

/* ===== Desktop ===== */
@media (min-width: 1024px) {
  html[data-layout="desktop"] body {
    background: var(--mist, #D8DDDC);
  }

  html[data-layout="desktop"] .app-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    min-height: 100dvh;
    background: linear-gradient(180deg, var(--teal-900) 0%, var(--cor-primaria) 100%);
    color: #fff;
    padding: var(--sp-6) var(--sp-4);
    position: sticky;
    top: 0;
    align-self: start;
    flex-shrink: 0;
  }

  html[data-layout="desktop"] .app-layout {
    display: flex;
    min-height: 100dvh;
  }

  html[data-layout="desktop"] .app-stage {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    padding: var(--sp-6);
    overflow-y: auto;
  }

  html[data-layout="desktop"] .app {
    width: 100%;
    max-width: var(--content-max);
    margin: 0;
    min-height: auto;
    background: var(--cor-fundo);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    overflow: hidden;
  }

  html[data-layout="desktop"] .app::before {
    border-radius: var(--radius-xl);
  }

  html[data-layout="desktop"] .app-header {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  html[data-layout="desktop"] .app-main {
    padding-left: var(--sp-8);
    padding-right: var(--sp-8);
    padding-bottom: var(--sp-6);
  }

  html[data-layout="desktop"] .app-main--narrow {
    max-width: var(--content-narrow);
    margin-left: auto;
    margin-right: auto;
  }

  html[data-layout="desktop"] .app-cta {
    position: sticky;
    bottom: 0;
    left: auto;
    transform: none;
    width: 100%;
    max-width: none;
    margin-top: auto;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    background: linear-gradient(to top, var(--cor-fundo) 85%, transparent);
  }

  html[data-layout="desktop"] .app-footer {
    padding-bottom: var(--sp-6);
  }

  /* Sidebar */
  .app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .app-sidebar__logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: contain;
  }

  .app-sidebar__name {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
  }

  .app-sidebar__tag {
    font-size: 0.68rem;
    opacity: 0.65;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .app-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    margin: 0 calc(-1 * var(--sp-2));
    padding: 0 var(--sp-2);
  }

  .app-sidebar__group { margin-bottom: var(--sp-4); }

  .app-sidebar__group-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: var(--sp-2);
    padding-left: var(--sp-3);
  }

  .app-sidebar__group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .app-sidebar__link {
    display: block;
    padding: 10px var(--sp-3);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
  }

  .app-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .app-sidebar__link.is-active {
    background: var(--orange-500);
    color: var(--teal-900);
    font-weight: 800;
  }

  .app-sidebar__footer {
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .app-sidebar__hub {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    margin-bottom: var(--sp-3);
  }

  .app-sidebar__help {
    font-size: 0.72rem;
    opacity: 0.7;
    line-height: 1.4;
  }

  .app-sidebar__help a { color: var(--orange-300); }

  /* Conteúdo — grids e splits */
  html[data-layout="desktop"] .planos-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  html[data-layout="desktop"] .page-split {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--sp-6);
  }

  html[data-layout="desktop"] .page-split__main { flex: 1; min-width: 0; }

  html[data-layout="desktop"] .page-split__aside {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: var(--sp-4);
  }

  html[data-layout="desktop"] .page-head__title {
    font-size: 1.75rem;
  }

  html[data-layout="desktop"] .contrato-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  html[data-layout="desktop"] .contrato-conteudo {
    flex: 1;
    max-height: 60vh;
  }

  /* Carteirinha desktop — sem sobreposição hero/card */
  html[data-layout="desktop"] .carteirinha-page .app {
    max-width: var(--content-max);
    background: var(--surface);
    display: flex;
    flex-direction: column;
  }

  html[data-layout="desktop"] .carteirinha-page .app-stage {
    padding: var(--sp-6) var(--sp-8);
  }

  html[data-layout="desktop"] .carteirinha-hero {
    flex-shrink: 0;
    margin-bottom: 0;
    padding: var(--sp-6) var(--sp-8) var(--sp-5);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: auto;
  }

  html[data-layout="desktop"] .carteirinha-hero__bar {
    margin-bottom: var(--sp-4);
  }

  html[data-layout="desktop"] .carteirinha-hero__greeting {
    font-size: 1.1rem;
    white-space: normal;
  }

  html[data-layout="desktop"] .carteirinha-tabs {
    padding-bottom: 0;
    flex-wrap: wrap;
    gap: var(--sp-3) var(--sp-5);
  }

  html[data-layout="desktop"] .carteirinha-page .app-main {
    padding: var(--sp-5) var(--sp-8) var(--sp-6);
    flex: 1;
  }

  html[data-layout="desktop"] .carteirinha-layout-desktop {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--sp-6);
    align-items: start;
    padding: 0;
  }

  html[data-layout="desktop"] .carteirinha-card {
    margin: 0;
    grid-column: 1;
    z-index: auto;
  }

  html[data-layout="desktop"] .carteirinha-painel {
    grid-column: 2;
    padding: 0;
    position: sticky;
    top: var(--sp-4);
  }

  html[data-layout="desktop"] .carteirinha-page .carteirinha-layout-desktop > .carteirinha-card:only-child,
  html[data-layout="desktop"] .carteirinha-page .app-main:not(:has(.carteirinha-painel)) > .carteirinha-card {
    grid-column: 1 / -1;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }

  html[data-layout="desktop"] .carteirinha-dependentes-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-6);
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--sp-8) var(--sp-6);
  }

  html[data-layout="desktop"] .carteirinha-dependentes-list .carteirinha-card {
    margin: 0;
    max-width: none;
    width: auto;
    grid-column: auto;
  }

  html[data-layout="desktop"] .carteirinha-page .app-footer {
    padding: var(--sp-4) var(--sp-8) var(--sp-6);
    border-top: 1px solid var(--teal-100);
    background: var(--surface);
  }

  /* Hub desktop */
  html[data-layout="desktop"] .hub-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    min-height: 100dvh;
    background: var(--surface);
    border-right: 1px solid var(--teal-100);
    padding: var(--sp-6) var(--sp-5);
    position: sticky;
    top: 0;
    align-self: start;
    flex-shrink: 0;
  }

  html[data-layout="desktop"] .hub-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
  }

  html[data-layout="desktop"] .hub {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: var(--sp-8) var(--sp-10);
  }

  html[data-layout="desktop"] .hub-hero {
    margin-left: 0;
    margin-right: 0;
  }

  html[data-layout="desktop"] .hub-cenarios {
    grid-template-columns: repeat(2, 1fr);
  }

  html[data-layout="desktop"] .hub-flow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
  }

  .hub-sidebar__brand h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--cor-primaria);
  }

  .hub-sidebar__brand h2 em {
    font-style: normal;
    color: var(--cor-destaque);
  }

  .hub-sidebar__brand p {
    font-size: 0.82rem;
    color: var(--cor-texto-secundario);
    margin-top: var(--sp-1);
  }

  .hub-sidebar__nav {
    flex: 1;
    margin: var(--sp-6) 0;
  }

  .hub-sidebar__nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
  }

  .hub-sidebar__link {
    display: block;
    padding: 10px var(--sp-3);
    border-radius: var(--radius-md);
    color: var(--ink-700);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .hub-sidebar__link:hover {
    background: var(--teal-100);
    color: var(--cor-primaria);
  }

  .hub-sidebar__actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
  }

  /* Entrada: formulários mais legíveis */
  html[data-layout="desktop"] .page-entrada .app-main {
    max-width: var(--content-narrow);
    margin: 0 auto;
    width: 100%;
  }

  html[data-layout="desktop"] .standalone-page {
    max-width: var(--content-narrow);
    margin: var(--sp-10) auto;
    padding: 0;
  }

  html[data-layout="desktop"] .modal-dependente {
    border-radius: var(--radius-lg);
    max-width: 480px;
    margin: auto;
  }
}

/* Indicador visual de modo (dev) — discreto */
html[data-layout="desktop"] .app-header::after,
html[data-layout="mobile"] .app-header::after {
  content: none;
}

@media (min-width: 1024px) {
  html[data-layout="desktop"] .app-header__back {
    /* Voltar continua útil no fluxo linear */
  }
}
/* ===== Tema escuro ===== */
html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

/* Toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--cor-texto-primario);
  font-family: var(--fonte-principal);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle--icon {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.theme-toggle--sidebar {
  width: 100%;
  justify-content: center;
  margin-bottom: var(--sp-4);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.theme-toggle--sidebar:hover {
  background: rgba(255, 255, 255, 0.14);
}

.theme-toggle__icon {
  line-height: 1;
}

/* Ajustes pontuais no dark mode */
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-input:focus {
  background: var(--surface-raised);
  border-color: var(--border-subtle);
  color: var(--cor-texto-primario);
}

html[data-theme="dark"] .form-input::placeholder {
  color: var(--ink-500);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .radio-card {
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .hub-shortcuts button,
html[data-theme="dark"] .hub-shortcuts a {
  color: var(--cor-texto-primario);
}

html[data-theme="dark"] .hub-tag--entrada {
  color: var(--cor-texto-primario);
}

html[data-theme="dark"] .alert--info { color: #7EB8F0; }
html[data-theme="dark"] .alert--warning { color: #E5B35C; }
html[data-theme="dark"] .badge--pendente { color: #E5B35C; }

html[data-theme="dark"] .carteirinha-page .app {
  background: var(--surface);
}

html[data-theme="dark"] .carteirinha-fatura {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .resumo-pagamento {
  background: var(--orange-100);
}

html[data-theme="dark"] .contrato-conteudo {
  background: var(--surface);
  border-color: var(--border-subtle);
}

/* Configurações — seletor de tema */
.cliente-config__titulo {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: var(--sp-2);
}

.cliente-config__desc {
  font-size: 0.88rem;
  color: var(--cor-texto-secundario);
  margin-bottom: var(--sp-4);
}

.cliente-config__theme {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.cliente-config__theme-opt {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4);
  border: 2px solid var(--mist, #D8DDDC);
  border-radius: var(--radius-lg);
  background: var(--paper, var(--cor-fundo));
  color: var(--cor-texto-primario);
  font-family: var(--fonte-principal);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.cliente-config__theme-opt:hover {
  border-color: var(--teal-100);
  transform: translateY(-1px);
}

.cliente-config__theme-opt.is-active {
  border-color: var(--cor-primaria);
  background: var(--teal-100);
}

.cliente-config__theme-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.cliente-config__theme-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cliente-config__theme-label {
  font-size: 0.95rem;
  font-weight: 800;
}

.cliente-config__theme-hint {
  font-size: 0.8rem;
  color: var(--cor-texto-secundario);
}
