/* =====================================================================
   LG Ensino · sistema de design
   Usado pelo site e pelo painel. Mude as cores e fontes só aqui.

   Roxo da marca (#7352BA) como cor principal, amarelo de apoio no site,
   títulos em Urbanist e textos em Figtree.
   ===================================================================== */

:root {
  /* cor */
  --roxo: #7352BA;          /* fundo da marca */
  --roxo-escuro: #4B2E8C;   /* hover, textos sobre lilás */
  --roxo-claro: #B9A6E6;    /* traços sobre o roxo */
  --tinta: #241B35;         /* texto principal */
  --tinta-2: #5E5574;       /* texto de apoio */
  --papel: #FAF8FD;         /* fundo da página */
  --branco: #FFFFFF;        /* superfícies */
  --nevoa: #EFEAF8;         /* blocos de apoio */
  --linha: #DDD4EC;         /* bordas e divisórias */
  --ok: #1E7A52;            /* publicado, sucesso */
  --ok-fundo: #E3F3EB;
  --alerta: #9A5B00;        /* rascunho, pendente */
  --alerta-fundo: #FBF0DC;
  --erro: #B42318;
  --erro-fundo: #FDECEA;

  /* tipo */
  --f-titulo: "Urbanist", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-texto: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* escala tipográfica (razão 1.25) */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-md: 1.3125rem;
  --t-lg: 1.625rem;
  --t-xl: 2.125rem;
  --t-2xl: clamp(2.25rem, 4.2vw, 3.25rem);
  --t-3xl: clamp(2.6rem, 6vw, 4.75rem);

  /* espaço e forma */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 104px;
  --raio-s: 6px;     /* campos, chips */
  --raio-m: 12px;    /* blocos */
  --raio-g: 22px;    /* imagens grandes */
  --traco: 1.5px;    /* espessura do traço da marca */
  --largura: 1180px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-d: max(16px, env(safe-area-inset-right, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 var(--t-base)/1.6 var(--f-texto);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-titulo); font-weight: 700; line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--roxo); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--roxo-claro); color: var(--tinta); }

.wrap { max-width: var(--largura); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-d); }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font: 600 var(--t-sm)/1 var(--f-texto);
  padding: 14px 22px; border-radius: 999px; border: var(--traco) solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-roxo { background: var(--roxo); color: var(--branco); }
.btn-roxo:hover { background: var(--roxo-escuro); }
.btn-branco { background: var(--branco); color: var(--roxo-escuro); }
.btn-branco:hover { background: var(--nevoa); }
.btn-contorno { border-color: currentColor; color: var(--roxo-escuro); background: transparent; }
.btn-contorno:hover { background: var(--nevoa); }
.btn-contorno-claro { border-color: rgba(255,255,255,.7); color: var(--branco); background: transparent; }
.btn-contorno-claro:hover { background: rgba(255,255,255,.12); }
.btn-texto { background: none; border: 0; padding: 8px 4px; color: var(--roxo-escuro); text-decoration: underline; text-underline-offset: 3px; }
.btn-perigo { background: var(--branco); color: var(--erro); border-color: #F1C4BF; }
.btn-perigo:hover { background: var(--erro-fundo); }
.btn-grande { padding: 18px 28px; font-size: var(--t-base); }
.btn-pequeno { padding: 9px 14px; font-size: var(--t-xs); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---------- campos ---------- */
.campo { display: grid; gap: 6px; min-width: 0; }
.campo > label, .campo > .rotulo { font-size: var(--t-sm); font-weight: 600; }
.campo .ajuda { font-size: var(--t-xs); color: var(--tinta-2); }
.entrada, .campo input:not([type="checkbox"]):not([type="file"]), .campo select, .campo textarea {
  width: 100%; font: inherit; font-size: var(--t-sm); color: var(--tinta);
  background: var(--branco); border: 1px solid var(--linha); border-radius: var(--raio-s);
  padding: 11px 13px;
}
.campo textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.entrada:focus, .campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none; border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(115,82,186,.18);
}
.campo.invalido input, .campo.invalido select, .campo.invalido textarea { border-color: var(--erro); }
.campo .erro-msg { font-size: var(--t-xs); color: var(--erro); }

/* ---------- chips e etiquetas ---------- */
.chip {
  font: 500 var(--t-sm)/1 var(--f-texto); color: var(--tinta);
  background: transparent; border: 1px solid var(--linha); border-radius: 999px;
  padding: 9px 15px; cursor: pointer;
}
.chip:hover { border-color: var(--roxo); }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--branco); }
.etiqueta { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--nevoa); color: var(--roxo-escuro); }
.etiqueta.ok { background: var(--ok-fundo); color: var(--ok); }
.etiqueta.alerta { background: var(--alerta-fundo); color: var(--alerta); }
.etiqueta.erro { background: var(--erro-fundo); color: var(--erro); }
.etiqueta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etiqueta.sem-ponto::before { display: none; }

/* ---------- marca ---------- */
.marca { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--tinta); }
.marca .selo { width: 44px; height: 44px; border-radius: 11px; background: var(--roxo); display: grid; place-items: center; flex: none; }
.marca .selo img { height: 28px; width: auto; }
.marca b { font: 700 1.375rem/1 var(--f-titulo); letter-spacing: -0.02em; }

/* ---------- aviso flutuante ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 100;
  background: var(--tinta); color: var(--branco); font-size: var(--t-sm); font-weight: 500;
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 12px 30px -12px rgba(36,27,53,.6);
  max-width: calc(100vw - 32px);
}
.toast.erro { background: var(--erro); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
