/* ============================================================
   MINHA MALETA · sistema visual Carina Melo®
   Briefing da Carina de 15/09/2026 (ver BRIEFING-DESIGN.md).
   "Sistema organizado por dentro. Marca de moda por fora."
   Tudo que é cor, medida e componente mora aqui. As telas só usam.
   ============================================================ */

:root {
  --cm-white: #FFFFFF;
  --cm-black: #000000;
  --cm-gold: #C9A94F;
  --cm-success: #2F6B4F;
  --cm-alert: #A33A2B;          /* inadimplência: o único vermelho, sempre com texto */
  --cm-attention: #8A5A00;      /* prazo chegando: texto, nunca fundo grande */

  --cm-border: rgba(0, 0, 0, .14);
  --cm-muted: rgba(0, 0, 0, .60);
  --cm-soft: rgba(0, 0, 0, .04);
  --cm-focus: rgba(201, 169, 79, .25);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --border-default: 1px solid var(--cm-border);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, .06);

  --font-title: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-ui: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  --touch: 44px;
  --control: 48px;
  --speed: 180ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --speed: 0ms; }
  * { scroll-behavior: auto !important; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
  color: var(--cm-black); background: var(--cm-white);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

:focus-visible { outline: 2px solid var(--cm-gold); outline-offset: 2px; }

/* ---------- tipografia ---------- */
.etiqueta {
  font-family: var(--font-ui); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cm-black);
}
.etiqueta::before { content: ""; display: inline-block; width: 18px; height: 1px; background: var(--cm-gold); vertical-align: middle; margin-right: 10px; }
.titulo-grande { font-family: var(--font-title); font-size: clamp(30px, 4vw, 42px); line-height: 1.15; font-weight: 500; }
.titulo { font-family: var(--font-title); font-size: 24px; line-height: 1.25; font-weight: 500; }
.apoio { color: var(--cm-muted); font-size: 15px; }
.numero { font-family: var(--font-title); font-size: 30px; line-height: 1.1; font-weight: 500; }

/* ---------- botões ---------- */
.bt {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control); padding: 0 var(--space-5);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border-radius: var(--radius-sm); border: 1px solid var(--cm-black);
  background: var(--cm-black); color: var(--cm-white); cursor: pointer; text-decoration: none;
  transition: background var(--speed), color var(--speed), border-color var(--speed);
}
.bt:hover { background: #1A1A1A; }
.bt:disabled, .bt[aria-busy="true"] { opacity: .5; cursor: default; }
.bt.alt, .bt.secundario { background: var(--cm-white); color: var(--cm-black); }
.bt.alt:hover, .bt.secundario:hover { background: var(--cm-black); color: var(--cm-white); }
.bt.mini { min-height: var(--touch); padding: 0 var(--space-4); font-size: 12px; }
.bt.largo { width: 100%; }
.bt.positivo { background: var(--cm-success); border-color: var(--cm-success); }
.link-discreto { font-size: 14px; color: var(--cm-muted); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; padding: var(--space-2) 0; min-height: var(--touch); font-family: var(--font-ui); }

/* ---------- campos ---------- */
.campo { margin-bottom: var(--space-4); }
.campo label, .rot {
  display: block; font-size: 13px; font-weight: 600; color: var(--cm-black); margin-bottom: var(--space-2);
}
input, select, textarea {
  width: 100%; min-height: var(--control); padding: 0 var(--space-4);
  font-family: var(--font-ui); font-size: 15px; color: var(--cm-black); background: var(--cm-white);
  border: var(--border-default); border-radius: var(--radius-sm);
  transition: border-color var(--speed), box-shadow var(--speed);
}
textarea { padding: var(--space-3) var(--space-4); min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cm-black); box-shadow: 0 0 0 4px var(--cm-focus); }
input[aria-invalid="true"] { border-color: var(--cm-alert); }
.campo-senha { position: relative; }
.campo-senha input { padding-right: 96px; }
.campo-senha .ver {
  position: absolute; right: 4px; top: 4px; bottom: 4px; min-width: 84px;
  border: 0; background: var(--cm-white); font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; cursor: pointer; border-radius: var(--radius-sm); color: var(--cm-black);
}
.erro { color: var(--cm-alert); font-size: 14px; min-height: 22px; margin: var(--space-2) 0; }

/* ---------- cards ---------- */
.card {
  background: var(--cm-white); border: var(--border-default); border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5); margin-bottom: var(--space-3);
}
.card.vermelho { border-left: 3px solid var(--cm-alert); }
.card.amarelo { border-left: 3px solid var(--cm-gold); }

/* ---------- etiquetas de estado (retângulo, não cápsula) ---------- */
.chip {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.3;
  padding: 4px 8px; border-radius: var(--radius-sm); border: var(--border-default); color: var(--cm-black); background: var(--cm-white);
}
.chip.inadimplencia { border-color: var(--cm-alert); color: var(--cm-alert); }
.chip.atencao { border-color: var(--cm-gold); color: var(--cm-attention); }
.chip.pedido, .chip.comprovante { border-color: var(--cm-gold); }
.chip.silencio, .chip.sem_grupo { background: var(--cm-soft); }

/* ---------- aviso ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--cm-black); color: var(--cm-white); padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity var(--speed); z-index: 90;
}
.toast.on { opacity: 1; }

/* ---------- janela ---------- */
.fundo { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: none; align-items: center; justify-content: center; padding: var(--space-4); z-index: 80; }
.fundo.on { display: flex; }
.caixa { background: var(--cm-white); border-radius: var(--radius-lg); padding: var(--space-5); max-width: 480px; width: 100%; max-height: 88vh; overflow: auto; }
.caixa h3 { font-family: var(--font-title); font-size: 22px; margin-bottom: var(--space-3); }

/* ============================================================
   TELA DE ACESSO
   ============================================================ */
.acesso { display: grid; grid-template-columns: 55fr 45fr; min-height: 100vh; min-height: 100dvh; }
.acesso-form { display: flex; align-items: center; justify-content: center; padding: var(--space-7) var(--space-6); }
.acesso-form .miolo-form { width: 100%; max-width: 420px; }
.acesso-logo { width: 190px; height: auto; margin-bottom: var(--space-7); }
.acesso-form .etiqueta { margin-bottom: var(--space-3); }
.acesso-form .titulo-grande { margin-bottom: var(--space-2); }
.acesso-form .apoio { margin-bottom: var(--space-6); }
.acesso-foto { position: relative; background: var(--cm-black); color: var(--cm-white); overflow: hidden; }
.acesso-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; opacity: .92; }
.acesso-foto .legenda {
  position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-5) var(--space-6) var(--space-6);
  background: var(--cm-black); /* faixa preta sólida: o briefing proíbe degradê */
}
.acesso-foto .filete { width: 48px; height: 1px; background: var(--cm-gold); margin-bottom: var(--space-3); }
.acesso-foto .frase { font-family: var(--font-title); font-size: 28px; line-height: 1.2; }
.acesso-foto .posicionamento { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-top: var(--space-2); color: rgba(255,255,255,.8); }
.ajuda { font-size: 14px; color: var(--cm-muted); margin-top: var(--space-3); }

@media (max-width: 860px) {
  .acesso { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .acesso-foto { order: -1; height: auto; }
  .acesso-foto img { height: 170px; object-position: 50% 62%; }
  /* no celular a frase fica embaixo da foto, sem cobrir o rosto */
  .acesso-foto .legenda { position: static; padding: var(--space-4) var(--space-5); }
  .acesso-foto .frase { font-size: 20px; }
  .acesso-foto .posicionamento { display: none; }
  .acesso-form { align-items: flex-start; padding: var(--space-6) var(--space-5) var(--space-7); }
  .acesso-logo { width: 150px; margin-bottom: var(--space-5); }
}

/* ============================================================
   ÁREA INTERNA: menu lateral preto no computador, barra embaixo no celular
   ============================================================ */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; background: var(--cm-black); color: var(--cm-white);
  display: flex; flex-direction: column; padding: var(--space-6) 0 var(--space-5);
}
.lateral .logo { width: 150px; height: auto; margin: 0 var(--space-5) var(--space-2); }
.lateral .sistema { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); margin: 0 var(--space-5) var(--space-6); }
.lateral nav { display: flex; flex-direction: column; flex: 1; }
.lateral nav button {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--control);
  padding: 0 var(--space-5); border: 0; border-left: 2px solid transparent; background: transparent;
  color: rgba(255,255,255,.72); font-family: var(--font-ui); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  transition: color var(--speed), border-color var(--speed), background var(--speed);
}
.lateral nav button svg { width: 20px; height: 20px; flex: none; }
.lateral nav button:hover { color: var(--cm-white); background: rgba(255,255,255,.05); }
.lateral nav button.on { color: var(--cm-white); border-left-color: var(--cm-gold); font-weight: 600; }
.lateral nav button.on svg { color: var(--cm-gold); }
.lateral nav .sair { margin-top: auto; }
.lateral .frase { font-family: var(--font-title); font-size: 15px; color: rgba(255,255,255,.75); margin: var(--space-5) var(--space-5) 0; }

.principal { min-width: 0; padding: var(--space-6) var(--space-7) var(--space-8); }
.topo { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); padding-bottom: var(--space-5); border-bottom: var(--border-default); }
.topo .etiqueta { margin-bottom: var(--space-2); }
.topo .sub { color: var(--cm-muted); font-size: 14px; margin-top: var(--space-1); }
.perfil { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; font-weight: 600; }
.perfil .inicial { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--cm-gold); display: grid; place-items: center; font-family: var(--font-title); font-size: 16px; }

.aba-frame { width: 100%; height: calc(100vh - 170px); min-height: 640px; border: 0; display: block; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 70;
    padding: 0 0 env(safe-area-inset-bottom); flex-direction: row;
  }
  .lateral .logo, .lateral .sistema, .lateral .frase { display: none; }
  .lateral nav { flex-direction: row; }
  .lateral nav button {
    flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px; padding: var(--space-2) var(--space-1);
    border-left: 0; border-top: 2px solid transparent; font-size: 12px; text-align: center;
  }
  .lateral nav button.on { border-left-color: transparent; border-top-color: var(--cm-gold); }
  .lateral nav .sair { margin-top: 0; }
  .principal { padding: var(--space-5) var(--space-5) 110px; }
  .aba-frame { height: calc(100vh - 230px); }
}

/* telas que se alternam (acesso / área interna) */
.tela:not(.on) { display: none !important; }
