/*
 * Plataforma Docente — Priscylla Knopp
 * Paleta extraída da apresentação oficial
 * Azul-marinho profundo + lavanda + branco
 */

:root {
  /* ── Paleta principal ── */
  --azul:          #2F4FB6;   /* azul principal — botões, links, destaques */
  --azul-escuro:   #1B2A63;   /* menu lateral, headers escuros */
  --azul-profundo: #20264A;   /* textos principais sobre fundo claro */
  --azul-medio:    #5B6484;   /* textos secundários */
  --azul-lavanda:  #6B7BAD;   /* bordas, muted, ícones sutis — WCAG AA 4.15:1 */
  --azul-claro:    #CAD9F5;   /* backgrounds de cards, chips */
  --azul-palido:   #D8E0F2;   /* superfície alternativa */
  --azul-minimo:   #E8EEFB;   /* background geral da página */
  --branco:        #FFFFFF;   /* superfície principal */

  /* ── Mapeamento de variáveis do sistema ── */
  --bg:            var(--azul-minimo);
  --surface:       var(--branco);
  --surface-alt:   var(--azul-palido);
  --border:        #5C6DA4;            /* borda padrão — WCAG AA 5.03:1 sobre branco */
  --border-st:     #404B65;            /* borda forte — WCAG AA 6.58:1 sobre branco */
  --texto:         var(--azul-profundo);
  --cinza:         var(--azul-medio);
  --muted:         #6B7BAD;            /* texto muted — WCAG AA 4.15:1 sobre branco */
  --sombra:        rgba(47,79,182,.10);

  /* ── Cor de destaque (accent = azul principal) ── */
  --accent:        var(--azul);
  --accent-bg:     var(--azul-claro);
  --accent-txt:    var(--azul-escuro);

  /* ── Cores semânticas ── */
  --verde:         #2E7D5E;
  --verde-bg:      #E4F4ED;
  --verde-txt:     #1A5C43;
  --vermelho:      #B83232;
  --vermelho-bg:   #FBEAEA;
  --amarelo:       #7A5510;   /* WCAG AA 6.11:1 sobre #FDF4DC */
  --amarelo-bg:    #FDF4DC;
  --turquesa:      var(--azul);       /* alias para compatibilidade */
  --turquesa-cl:   var(--azul-claro);
  --turquesa-txt:  var(--azul-escuro);
  --marinho:       var(--azul-escuro);
  --marinho-cl:    var(--azul);
  --marinho-md:    var(--azul-profundo);

  /* ── Disciplinas — tons do mesmo azul ── */
  --disc1-cor:     #2F4FB6;
  --disc1-bg:      #E8EEFB;
  --disc2-cor:     #1B2A63;
  --disc2-bg:      #D8E0F2;
  --disc3-cor:     #5B6484;
  --disc3-bg:      #CAD9F5;
  --disc4-cor:     #AAB4D8;
  --disc4-bg:      #E8EEFB;

  --radius:        8px;
  --radius-card:   14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--texto);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ══ Layout ══ */
.layout { display: flex; min-height: 100vh; }

.menu-lateral {
  width: 230px; flex-shrink: 0;
  /* Degradê: topo claro (logo legível) → base escura (nav legível) */
  background: linear-gradient(
    180deg,
    #E8EEFB 0px,        /* topo claro — logo com cores originais */
    #D8E0F2 80px,       /* transição suave */
    #1B2A63 180px,      /* escuro começa antes do nav */
    #1B2A63 100%
  );
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

/* Logo — sem filtro, cores originais sobre fundo claro */
.menu-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(47,79,182,.2);
  margin-bottom: .75rem;
}
.menu-logo img {
  width: 100%; max-width: 180px;
  /* Sem filtro — logo usa cores originais sobre fundo claro */
}
.menu-logo-text {
  display: none;
}
.menu-logo-text .logo-mark {
  font-size: .72rem; font-weight: 700; color: var(--azul);
  letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 2px;
}
.menu-logo-text .logo-nome {
  font-size: .95rem; font-weight: 700; color: var(--azul-escuro);
  font-style: italic; line-height: 1.2;
}
.menu-logo-text .logo-sub {
  font-size: .62rem; color: var(--azul-medio);
  text-transform: uppercase; letter-spacing: .08em; margin-top: 2px;
}

.nav-sec { padding: 0 .75rem; margin-bottom: 1.25rem; }
.nav-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.6); /* 6.51:1 ✅ */
  text-transform: uppercase; letter-spacing: .1em;
  padding: 0 .5rem; margin-bottom: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: 13px; color: rgba(255,255,255,.8); /* ~9:1 ✅ */
  cursor: pointer; transition: all .12s; text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.ativo {
  background: rgba(255,255,255,.18); /* fundo sutil em vez de azul sobre azul */
  color: #fff; font-weight: 700;
  border-left: 3px solid #fff;
  padding-left: 7px;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .8; }
.nav-item.ativo svg { opacity: 1; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Rodapé do menu — botão sair */
.menu-footer {
  margin-top: auto;
  padding: 1rem .75rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.btn-sair {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border-radius: var(--radius);
  font-size: 13px; color: rgba(255,255,255,.75); /* 7.5:1 ✅ */
  background: none; border: none; cursor: pointer;
  transition: all .12s; font-family: inherit;
}
.btn-sair:hover { background: rgba(184,50,50,.25); color: #F1948A; }
.btn-sair svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ══ Conteúdo ══ */
.conteudo { flex: 1; padding: 2rem 2.5rem; }
.pagina-titulo {
  font-size: 1.35rem; font-weight: 700;
  color: var(--azul-escuro); margin-bottom: .25rem;
}
.pagina-sub { font-size: .85rem; color: var(--cinza); margin-bottom: 1.75rem; }

/* ══ Botões ══ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all .12s; font-family: inherit;
  text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: var(--azul-escuro); color: #fff; }
.btn-primary:hover { background: var(--azul); }
.btn-turquesa  { background: var(--azul); color: #fff; }
.btn-turquesa:hover { background: var(--azul-escuro); }
.btn-ghost {
  background: transparent; color: var(--cinza);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-st); color: var(--texto); }
.btn-danger    { background: var(--vermelho); color: #fff; }
.btn-danger:hover { background: #9a2828; }
.btn-verde     { background: var(--verde); color: #fff; }
.btn-verde:hover { background: #245f4a; }
.btn-sm  { padding: 5px 11px; font-size: 12px; }
.btn-xs  { padding: 3px 8px;  font-size: 11px; }
.btn-full { width: 100%; justify-content: center; }

/* ══ Cards ══ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 2px 12px var(--sombra);
}

/* ══ Inputs ══ */
input, select, textarea {
  width: 100%; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: .5rem .75rem;
  font-size: .88rem; font-family: inherit;
  background: var(--surface); color: var(--texto);
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--azul); }
input::placeholder, textarea::placeholder { color: #6B7BAD; } /* WCAG AA 4.15:1 */
textarea { resize: vertical; min-height: 80px; }
label {
  display: block; font-size: .72rem; font-weight: 700;
  color: var(--cinza); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: .3rem;
}
.campo { margin-bottom: 1rem; }

/* ══ Alertas ══ */
.alerta {
  padding: .8rem 1rem; border-radius: var(--radius);
  font-size: .83rem; line-height: 1.5; margin-bottom: 1rem;
}
.alerta-erro  { background: var(--vermelho-bg); border-left: 3px solid var(--vermelho); color: #7F1D1D; }
.alerta-ok    { background: var(--verde-bg);    border-left: 3px solid var(--verde);    color: var(--verde-txt); }
.alerta-info  { background: var(--azul-claro);  border-left: 3px solid var(--azul);     color: var(--azul-escuro); }
.alerta-aviso { background: var(--amarelo-bg);  border-left: 3px solid var(--amarelo);  color: #7A4B0A; }

/* ══ Loading ══ */
.loading { display: flex; align-items: center; gap: .75rem; color: var(--muted); padding: 2rem 0; }
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--azul); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ Badges ══ */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 4px;
}
.badge-azul   { background: var(--azul-claro);  color: var(--azul-escuro); }
.badge-cinza  { background: var(--surface-alt);  color: var(--cinza); }
.badge-ok     { background: var(--verde-bg);     color: var(--verde-txt); }
.badge-aviso  { background: var(--amarelo-bg);   color: #7A4B0A; }
.badge-erro   { background: var(--vermelho-bg);  color: #7F1D1D; }
/* Compatibilidade com versões anteriores */
.badge-pec2   { background: var(--azul-claro);   color: var(--azul-escuro); }
.badge-pec3   { background: var(--azul-palido);  color: var(--azul-escuro); }
.badge-piap1  { background: var(--azul-minimo);  color: var(--azul); }
.badge-piap2  { background: var(--azul-claro);   color: var(--azul-profundo); }
.badge-verde  { background: var(--verde-bg);     color: var(--verde-txt); }
.badge-roxo   { background: var(--azul-claro);   color: var(--azul-escuro); }
.badge-coral  { background: var(--vermelho-bg);  color: var(--vermelho); }

/* ══ Modal ══ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(27,42,99,.45); z-index: 100;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.aberto { display: flex; }
.modal {
  background: var(--surface); border-radius: 16px;
  width: 100%; max-width: 600px; max-height: 92vh;
  overflow-y: auto; box-shadow: 0 16px 48px rgba(27,42,99,.25);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; color: var(--azul-escuro); }
.modal-body { padding: 1.5rem; }
.fechar-modal {
  background: var(--surface-alt); border: none; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; color: var(--cinza);
}
.fechar-modal:hover { background: var(--border); }

/* ══ Tabs ══ */
.tabs {
  display: flex; gap: .25rem; margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.tab {
  padding: .6rem 1rem; font-size: .85rem; font-weight: 600;
  color: var(--cinza); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s;
}
.tab:hover { color: var(--azul-escuro); }
.tab.ativa { color: var(--azul); border-bottom-color: var(--azul); }
.tab-content { display: none; }
.tab-content.ativa { display: block; }

/* ══ Seletor múltiplo de disciplinas ══ */
.disc-selector { display:flex; flex-direction:column; gap:.5rem; margin-top:.5rem; }
.disc-check-item {
  display:flex; align-items:center; gap:.75rem;
  padding:.65rem .85rem; border-radius:var(--radius);
  border:1.5px solid var(--border); cursor:pointer;
  transition:all .15s; background:var(--surface);
}
.disc-check-item:hover { border-color:var(--azul-lavanda); }
.disc-check-item.selecionada { border-color:var(--azul); background:var(--azul-minimo); }
.disc-cor-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.disc-check-nome { flex:1; font-size:.85rem; font-weight:600; color:var(--texto); }
.disc-check-box {
  width:18px; height:18px; border-radius:4px; flex-shrink:0;
  border:2px solid var(--border); background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  font-size:.65rem; color:#fff; transition:all .15s;
}
.disc-check-item.selecionada .disc-check-box { background:var(--azul); border-color:var(--azul); }

/* ══ Responsivo — Menu Hamburguer ══ */

/* Botão hamburguer — só aparece no mobile */
.hamburguer {
  display: none;
  position: fixed; top: 1rem; left: 1rem; z-index: 200;
  width: 42px; height: 42px; border-radius: var(--radius);
  background: var(--azul-escuro); color: #fff;
  border: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; box-shadow: 0 2px 10px rgba(27,42,99,.25);
}
.hamburguer span {
  display: block; width: 20px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: all .25s;
}
.hamburguer.aberto span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburguer.aberto span:nth-child(2) { opacity: 0; }
.hamburguer.aberto span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Overlay escuro atrás do menu */
.menu-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(27,42,99,.5); z-index: 149;
}
.menu-overlay.visivel { display: block; }

@media (max-width: 768px) {
  .hamburguer { display: flex; }

  .menu-lateral {
    position: fixed; left: -240px; top: 0; z-index: 150;
    width: 230px; height: 100vh;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .menu-lateral.aberto {
    left: 0;
    box-shadow: 4px 0 24px rgba(27,42,99,.3);
  }

  .conteudo {
    padding: 1rem 1rem 1.5rem;
    padding-top: 4rem; /* espaço para o hamburguer */
  }

  /* Ajustes gerais de layout */
  .pagina-titulo { font-size: 1.15rem; }

  /* Grids viram coluna única */
  .disc-grid,
  .stats-row,
  .form-row-2,
  .form-row-3,
  .form-row,
  .input-nome-row,
  .opcoes-grid,
  .alternativas-form,
  .anexos-grid,
  .secoes-grid,
  .mural-grid,
  .tipo-select {
    grid-template-columns: 1fr !important;
  }

  /* Cards de ação viram coluna */
  .pratica-item,
  .caso-item,
  .desafio-item,
  .col-item,
  .aula-item,
  .quiz-item,
  .turma-card,
  .disc-card {
    flex-wrap: wrap;
  }
  .pratica-acoes,
  .caso-acoes,
  .desafio-acoes,
  .col-acoes,
  .aula-acoes,
  .quiz-acoes,
  .turma-acoes,
  .disc-acoes {
    width: 100%;
    margin-top: .5rem;
  }

  /* Modal ocupa mais tela */
  .modal {
    max-width: 100% !important;
    margin: .5rem;
    max-height: 95vh;
  }
  .modal-overlay { padding: .5rem; align-items: flex-end; }

  /* Tabs com scroll horizontal */
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; }

  /* Botões de ação empilham */
  .header-actions,
  .footer-actions {
    flex-wrap: wrap;
  }

  /* Login — esconder lado direito */
  .login-direita { display: none; }
  .login-esquerda { width: 100%; padding: 2rem 1.5rem; }

  /* Quiz — alternativas em coluna */
  .alternativas { grid-template-columns: 1fr !important; }

  /* Nuvem de palavras — scroll */
  .nuvem-container { min-height: 60px; }

  /* Ranking ao vivo — ocultar barra */
  .rv-bar { display: none; }

  /* Aula — ajuste do header */
  .aula-header h1 { font-size: 1.2rem; }
  .aula-header-meta { gap: .5rem; }

  /* Caso clínico — opcoes em coluna */
  .opcoes-lista { gap: .4rem; }

  /* Storytelling — botões de opção */
  .no-opcoes { padding: .75rem 1rem; }
  .opcao-story { font-size: .85rem; }

  /* Desafio nav */
  .desafio-nav,
  .pratica-nav,
  .caso-nav,
  .aula-nav { padding: .75rem 1rem; padding-left: 4rem; }

  /* Acesso do aluno */
  .acesso-wrap { max-width: 100%; }

  /* PDF — esconder no mobile (só imprime no desktop) */
  .btn-pdf-mobile { display: none; }
}

@media (max-width: 400px) {
  .conteudo { padding: .75rem .75rem 1.5rem; padding-top: 4rem; }
  .modo-tab .tab-icon { font-size: 1rem; }
  .card-entrada { border-radius: 12px; }
}

