/* ========= Página: Inscrições (ATUALIZADO) ========= */
/* Depende de variaveis.css (usa --mis-laranja / --mis-azul / --cinza-xx / --radius-lg / --shadow-card)
   Este arquivo preserva o visual no modo claro e aplica regras sólidas em body.dark-mode */

/* ---------------------------
   Base (modo claro)
   --------------------------- */
:root{
  /* fallback caso variaveis do projeto não existam */
  --laranja: var(--mis-laranja, #F26729);
  --azul-escuro: var(--mis-azul, #1B4B5F);
  --cinza-10: #fbfbfc;
  --cinza-30: #eef2f4;
  --texto-escuro: #21343a;
  --texto-sec: #34424f;
  --texto-muted: #6b7a87;
  --texto-claro: #ffffff;
  --radius-lg: 12px;
  --shadow-card: 0 8px 24px rgba(11,22,28,0.06);
}

/* HERO */
.hero-mat {
  background: linear-gradient(180deg, #fff 0%, var(--cinza-10) 100%);
  border-bottom: 1px solid var(--cinza-30);
  padding: clamp(18px, 5vw, 36px) 0;
  color: var(--texto-escuro);
}
.hero-mat__grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(16px, 4vw, 28px);
  align-items: center;
}
.kicker {
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--azul-escuro);
  font-weight: 800;
  font-size: .8rem;
  margin: 0 0 6px;
}
.hero-mat h1 {
  font-size: clamp(1.6rem, 3.8vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--texto-escuro);
}
.hero-mat .sub {
  color: #3c4a55;
  max-width: 52ch;
}
.ancora {
  display: inline-block;
  margin-top: 12px;
  font-weight: 700;
  color: var(--laranja);
}
.curso-destaque { color: var(--laranja); }

/* Card lateral do hero */
.hero-mat__card {
  display: grid;
}
.hero-mat__card-inner {
  border: 1px solid var(--cinza-30);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: clamp(14px, 3vw, 18px);
  color: var(--texto-escuro);
}
.hero-mat__card h3 { margin: 0 0 10px; color: var(--azul-escuro); }
.hero-mat__card ul { margin: 0 0 10px; padding: 0; list-style: none; }
.hero-mat__card li { display: flex; gap: 6px; margin: 6px 0; color: var(--texto-sec); }
.hero-mat__card li span { color: var(--texto-muted); }
.hero-mat__card .nota { font-size: .9rem; color: var(--texto-muted); }

/* FORM principal */
.matricula { padding: 18px 0 28px; }
.card--elev {
  border: 1px solid var(--cinza-30);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: clamp(14px, 3vw, 20px);
  color: var(--texto-escuro);
}

/* Fieldset / Legend */
fieldset { border: 0; padding: 0; margin: 14px 0; }
.legend { font-weight: 800; color: var(--azul-escuro); margin-bottom: 10px; }

/* Grid responsivo do formulário */
.grid {
  display: grid;
  gap: clamp(10px, 2.6vw, 16px);
  grid-template-columns: repeat(12, 1fr);
}
.form-group { grid-column: span 6; }
.form-group.sm { grid-column: span 3; }

@media (max-width: 900px){
  .hero-mat__grid { grid-template-columns: 1fr; }
  .form-group { grid-column: span 12; }
  .form-group.sm { grid-column: span 6; }
}
@media (max-width: 560px){
  .form-group.sm { grid-column: span 12; }
}

/* Inputs */
.form-group label { display:block; font-weight: 700; margin: 0 0 6px; color: var(--texto-escuro); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: 44px;
  border: 1px solid var(--cinza-30);
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  color: var(--texto-escuro);
  box-sizing: border-box;
}
.form-group textarea { min-height: 110px; height: auto; padding: 12px; }
.form-group .help { color:#72808d; font-size: .85rem; }
.msg-erro { margin-top: 6px; color:#c62828; font-weight: 700; }
.invalido { border-color: #c62828 !important; }

/* Chips / grupos */
.checkbox-group,
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--cinza-30);
  background: #fff;
  padding: .35rem .70rem;        /* mais compactos */
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--texto-escuro);
}
.chip input {
  margin-right: 6px;
}

/* Tamanho do checkbox dentro do chip */
.chip input[type="checkbox"],
.chip input[type="radio"]{
  width: 18px;
  height: 18px;
  accent-color: var(--laranja);
}

/* Ainda mais compacto em telas pequenas */
@media (max-width: 560px){
  .chip{ padding: .3rem .6rem; font-size: .9rem; gap: 6px; }
  .chip input[type="checkbox"],
  .chip input[type="radio"]{ width: 16px; height: 16px; }
}

/* Upload PCD */
.hidden { display: none; }
.file-name { margin-top: 6px; color: var(--texto-sec); font-size:.9rem; }

/* Ações */
.actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}
.btn { border-radius: 12px; font-weight: 800; cursor:pointer; border: none; }
.btn--primario {
  background: var(--laranja);
  color: var(--texto-claro);
  border: 1px solid var(--laranja);
  padding: .8rem 1.2rem;
}
.btn--xl { padding: 1rem 1.4rem; font-size: 1rem; }

/* Espaçamentos finais */
.rodape { margin-top: 24px; }

/* Ajuste foco/acessibilidade */
input:focus, select:focus, textarea:focus, .btn:focus, .chip:focus-within {
  outline: 3px solid rgba(242, 103, 41, .18);
  outline-offset: 2px;
}

/* ===== Caixa de consentimento LGPD ===== */
.consent-box{
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(27,75,95,.18);
  background: #f5f8fb;
  font-size: .9rem;
}
.consent-box label{
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  cursor: pointer;
}
.consent-box input[type="checkbox"]{
  margin-top: .15rem;
}
.consent-box__texto{
  margin: 0 0 .35rem;
}
.consent-box__hint{
  display: block;
  font-size: .75rem;
  color: #6b7280;
}
.link-termo{
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--laranja);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== Modal do termo ===== */
.termo-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999;
}
.termo-modal.is-open{
  display: block;
}
.termo-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(15,24,32,.65);
}
.termo-modal__content{
  position: relative;
  max-width: 720px;
  max-height: 80vh;
  margin: 5vh auto;
  padding: 1.75rem 1.75rem 1.5rem;
  border-radius: 18px;
  background: #ffffff;
  overflow-y: auto;
  box-shadow: 0 18px 45px rgba(15,23,42,.38);
  font-size: .9rem;
  line-height: 1.5;
}
.termo-modal__content h2{
  font-size: 1.4rem;
  margin-bottom: .75rem;
  color: var(--azul-escuro);
}
.termo-modal__content h3{
  font-size: 1rem;
  margin: 1rem 0 .35rem;
  color: var(--azul-escuro);
}
.termo-modal__content p{
  margin: .3rem 0;
}
.termo-modal__content ul{
  margin: .25rem 0 .5rem 1.25rem;
  padding-left: 0;
}
.termo-modal__content li{
  margin-bottom: .2rem;
}
.termo-modal__final{
  margin-top: 1rem;
  font-weight: 600;
}
.termo-modal__close{
  position: absolute;
  top: .7rem;
  right: .7rem;
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  background: #eef2f7;
  font-size: 1rem;
  line-height: 1;
}

/* ---------------------------
   DARK MODE OVERRIDES
   --------------------------- */
body.dark-mode {
  background: #0f1820;
  color: #eaf1f6;
}

/* HERO em dark */
body.dark-mode .hero-mat {
  background: linear-gradient(0deg,rgba(0,0,0,.18),rgba(0,0,0,.18)),var(--mis-bg, #0f2f3d);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #eaf1f6;
}
body.dark-mode .kicker { color: #cfe4ee; }
body.dark-mode .hero-mat h1 { color: #eaf1f6; }
body.dark-mode .hero-mat .sub { color: #c7d6df; }
body.dark-mode .ancora { color: var(--laranja); }

/* Card lateral do hero no dark */
body.dark-mode .hero-mat__card-inner {
  border: 1px solid rgba(255,255,255,0.04);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  color: #eaf1f6;
  box-shadow: none;
}
body.dark-mode .hero-mat__card h3 { color: #eaf1f6; }
body.dark-mode .hero-mat__card li { color: #cfe4ee; }
body.dark-mode .hero-mat__card li span { color: #9fc9e0; }

/* Form card no dark */
body.dark-mode .card--elev {
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
  color: #cfe4ee;
  box-shadow: none;
}

/* Inputs dark */
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  color: #eaf1f6;
}
body.dark-mode .form-group label { color: #cfe4ee; }
body.dark-mode .form-group .help { color: #9fbfce; }
body.dark-mode .msg-erro { color: #ff9b9b; }

/* Chips dark */
body.dark-mode .chip {
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.03);
  color: #cfe4ee;
}
body.dark-mode .chip input[type="checkbox"],
body.dark-mode .chip input[type="radio"] {
  accent-color: var(--laranja);
}

/* Badges / file name */
body.dark-mode .file-name { color: #cfe4ee; }

/* Buttons */
body.dark-mode .btn--primario {
  background: var(--laranja);
  color: #fff;
  border-color: var(--laranja);
  box-shadow: 0 8px 20px rgba(242,103,41,0.12);
}

/* Acessibilidade: foco no dark */
body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  outline: 3px solid rgba(79, 142, 162, .18);
  outline-offset: 2px;
}

/* Modal em dark */
body.dark-mode .termo-modal__content{
  background: #0f1820;
  color: #eaf1f6;
  box-shadow: 0 18px 45px rgba(0,0,0,.8);
}
body.dark-mode .termo-modal__content h2,
body.dark-mode .termo-modal__content h3{
  color: #f9fafb;
}
body.dark-mode .termo-modal__close{
  background: #1f2933;
  color: #e5e7eb;
}

/* Consent box em dark */
body.dark-mode .consent-box{
  background: #0f1820;
  border-color: #273847;
}
body.dark-mode .consent-box__hint{
  color: #9ca3af;
}

/* Header / Footer safety (se componentes não tiverem overrides) */
body.dark-mode .cabecalho {
  background: #0f1820;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #cfe4ee;
}
body.dark-mode .mis-footer {
  background: #08131a;
  color: #cfe4ee;
}
body.dark-mode .mis-footer__bar {
  background: transparent;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Utilidades */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* Últimos ajustes responsivos */
@media (max-width: 720px) {
  .hero-mat { padding: 18px 0; }
  .hero-mat__grid { gap: 18px; }
  .hero-mat__card-inner { padding: 12px; }
  .actions { justify-content: center; flex-direction: column-reverse; gap: 10px; }
}
