﻿/* styles.css â€” canÃ´nico (revisado p/ produÃ§Ã£o) */
:root {
  --bg: #0d1418;          /* tom WhatsApp dark */
  --card: #111b21;
  --text: #e9edef;
  --accent: #25d366;
  --muted: #8696a0;
  --border: #223038;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* Header/RodapÃ© canÃ´nicos */
header.site, footer.site,
.site-footer {
  background: #0b1a12;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

header.site .inner, footer.site .inner,
.site-footer .container {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

header.site .brand { font-weight: 700; letter-spacing: .3px; }

main h2 { margin-top: 0; }

/* BotÃµes base */
button {
  background: var(--accent);
  color: #001;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}
button:disabled { opacity: .5; cursor: not-allowed; }

/* SaÃ­da de debug */
pre#out {
  white-space: pre-wrap;
  background: #0c171d;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
  margin-top: 16px;
}

/* ===== Complementos usados na Agenda e no rodapÃ© ===== */
.note { color: var(--muted); margin: 0; }

.badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  background:#0c2a1d;
  border:1px solid var(--border);
  color:var(--accent);
  font-size:12px;
  vertical-align:middle;
}

.grid{ display:grid; gap:12px; }
.grid-2{ grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (max-width: 720px){ .grid-2{ grid-template-columns:1fr; } }

/* Inputs */
.input, select.input, textarea.input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#0c171d;
  color:var(--text);
  outline:none;
}
.input:focus, select.input:focus, textarea.input:focus{ border-color:var(--accent); }

/* Placeholder padrÃ£o do projeto (acinzentado) */
.input::placeholder { color: rgba(233, 237, 239, 0.55); opacity: 1; }
.input::-webkit-input-placeholder { color: rgba(233, 237, 239, 0.55); opacity: 1; }
.input::-moz-placeholder { color: rgba(233, 237, 239, 0.55); opacity: 1; }
.input:-ms-input-placeholder { color: rgba(233, 237, 239, 0.55); opacity: 1; }
.input::-ms-input-placeholder { color: rgba(233, 237, 239, 0.55); opacity: 1; }

/* BotÃµes utilitÃ¡rios (para compatibilidade com telas existentes) */
.btn{
  background:var(--accent);
  color:#001;
  border:0;
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:600;
}
.btn.secondary{
  background:transparent;
  color:var(--text);
  border:1px solid var(--border);
}
/* TambÃ©m oferecemos a variante com hÃ­fen, usada em algumas pÃ¡ginas */
.btn-secondary{
  background:transparent;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:600;
  display:inline-block;
}
/* CTA usada em formulÃ¡rios simples */
.cta{
  background: var(--accent);
  color: #001;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  display: inline-block;
}
.cta:disabled{ opacity:.5; cursor:not-allowed; }

/* Tabelas */
.table{ width:100%; border-collapse:collapse; }
.table th, .table td{ border-bottom:1px solid var(--border); padding:8px; text-align:left; }
.table thead th{ color:var(--muted); font-weight:600; }

/* Ajustes quando o footer usa .site-footer */
.site-footer .note + .note { margin-top: 2px; }
.site-footer .container { flex-direction: column; align-items: flex-start; gap: 8px; }

/* ===== Header com marca forte ===== */
.header-inner { justify-content: space-between; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  background: #0a151a;
  border: 1px solid var(--border);
}
.brand-name {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .2px;
}

/* NavegaÃ§Ã£o */
.main-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.main-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.main-nav a:hover {
  border-color: var(--border);
  text-decoration: none;
}

/* ===== RodapÃ© centralizado ===== */
.footer-inner {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

/* Responsivo: em telas muito estreitas reduz um pouco a marca */
@media (max-width: 420px) {
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 18px; }
}

/* ========= Promo: logo no header (consolidado, sem duplicatas) ========= */
#app-header img[src$="mei-robo-icon.png"]{ width:180px; height:auto; vertical-align:middle; }
@media (min-width:768px){ #app-header img[src$="mei-robo-icon.png"]{ width:220px; } }

/* (removidas regras duplicadas e seletor :has com sintaxe invÃ¡lida) */

/* ===================== App Shell Global (anti "pÃ¡gina anÃ£") ===================== */
/* Use body.app-shell + main.app-main nas pÃ¡ginas curtas (verify-email, reset, etc.) */
.app-shell{
  min-height: 100svh;  /* mobile moderno */
  min-height: 100vh;   /* fallback desktop */
  display: flex;
  flex-direction: column;
}
.app-main{
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
}

/* ==================== Feedbacks de texto comuns ==================== */
.hint { color: var(--muted); }
.ok   { color: #86f7c2; }
.error{ color: #ff9c9c; }

/* ================================================================== */
/* ====================== PATCH HEADER â€” MOBILE ====================== */
/* Alvo: corrigir corte de texto / â€œlayout atropeladoâ€ no cabeÃ§alho   */
/* EstratÃ©gia: permitir wrap no container, dar min-width:0 ao texto,  */
/* garantir que aÃ§Ãµes/badges nÃ£o comprimam o tÃ­tulo, e respeitar      */
/* safe-area em iOS. SÃ³ â‰¤480px.                                       */
/* ================================================================== */
@media (max-width: 480px) {
  /* 1) Containers do header podem quebrar linha e manter respiro */
  header.site .inner,
  .header-inner {
    display: flex;              /* reforÃ§a o layout flex */
    flex-wrap: wrap;            /* permite quebra controlada */
    align-items: center;
    gap: 0.4rem 0.6rem;         /* respiro vertical/horizontal */
    overflow: visible;          /* evita clip oculto do texto */
    padding-top: calc(12px + env(safe-area-inset-top, 0px)); /* iOS notch seguro */
  }

  /* 2) Bloco de marca/tÃ­tulo: ocupa espaÃ§o, pode quebrar e nÃ£o estoura */
  .brand,
  .brand-name,
  .logo-title,
  .wordmark {
    flex: 1 1 auto;
    min-width: 0;               /* permite encolher sem estourar largura */
    white-space: normal;        /* remove nowrap agressivo */
    line-height: 1.15;          /* compacta levemente */
  }

  /* 3) NavegaÃ§Ã£o e aÃ§Ãµes: nÃ£o encolhem o texto principal */
  .main-nav,
  .header-actions,
  .header-cta,
  header.site nav {
    flex: 0 0 auto;             /* nÃ£o â€œroubamâ€ largura do tÃ­tulo */
  }

  /* 4) Badges/chips: nÃ£o esmagam o fluxo; mantÃªm-se Ã­ntegros */
  .header-badge,
  .env-badge,
  .mode-chip {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: nowrap;
    overflow: visible;
  }

  /* 5) Ajuste fino opcional (SE necessÃ¡rio no iPhone SE/360â€“375px)
     â€” Descomentar se notar â€œapertoâ€ de tipografia:
     .brand-name, .logo-title, .wordmark { font-size: 0.95rem; }
  */
}
