/* Portal do aluno no mesmo visual do CRM (frontend/src/design.css): mesma
   fonte, mesmas cores, mesmos cartões e botões. Quem mexer no visual do CRM
   deve trazer a mudança pra cá também. */
:root {
  --navy: #202a3a;
  --navy-escuro: #11141a;
  --marca: #e51d42;
  --marca-escura: #b81334;
  --destaque: #f4972f;
  --cinza-texto: #69707a;
  --texto: #16191f;
  --fundo: #f1f2f4;
  --borda: #dfe2e6;
  --verde: #18794e;
  --vermelho: #d21445;
  --raio: 16px;
  --sombra: 0 10px 30px rgba(17, 20, 26, 0.07);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: "Montserrat Alternates", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--texto);
  font-size: 14px;
  line-height: 1.45;
  background:
    radial-gradient(circle at 82% -10%, rgba(244, 151, 47, 0.08), transparent 28rem),
    radial-gradient(circle at 16% 15%, rgba(229, 29, 66, 0.045), transparent 24rem),
    linear-gradient(145deg, #f6f7f8 0%, #eceef1 100%);
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn:focus-visible, .link-botao:focus-visible, .foto-trocar:focus-visible {
  outline: 3px solid rgba(244, 151, 47, 0.55);
  outline-offset: 2px;
}
.btn-primario {
  color: #fff;
  background: linear-gradient(105deg, var(--destaque), var(--marca));
  box-shadow: 0 7px 16px rgba(229, 29, 66, 0.18);
}
.btn-primario:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(229, 29, 66, 0.25); }
.btn-claro { color: var(--navy); background: #fff; border-color: var(--borda); }
.btn-claro:hover { background: #f7f8f9; }
.btn-escuro { color: #fff; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); min-height: 34px; padding: 6px 14px; }
.btn-escuro:hover { background: rgba(255, 255, 255, 0.16); }
.btn-pequeno { min-height: 34px; padding: 6px 13px; font-size: 12px; }
.btn-cheio { width: 100%; margin-top: 6px; min-height: 44px; }

.link-botao {
  background: none;
  border: 0;
  padding: 0;
  margin-top: 10px;
  color: var(--marca);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- Campos e avisos ---------- */

.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; text-align: left; }
.campo label { font-size: 12px; font-weight: 700; color: var(--navy); }
.campo input:not([type="range"]) {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--borda);
  border-radius: 10px;
  background: #fff;
  color: var(--texto);
}
.campo input:focus { outline: 2px solid rgba(244, 151, 47, 0.22); border-color: var(--destaque); }

.erro, .sucesso { border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; text-align: left; }
.erro { color: var(--vermelho); background: #fdecea; }
.sucesso { color: var(--verde); background: #e6f4ea; }
.sub { color: var(--cinza-texto); font-size: 13px; margin: 0 0 18px; }

/* ---------- Login ---------- */

.login-pagina {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 18% 5%, rgba(244, 151, 47, 0.28), transparent 28rem),
    radial-gradient(circle at 90% 80%, rgba(229, 29, 66, 0.2), transparent 26rem),
    linear-gradient(145deg, #2b3038, #0d0f12);
}
.login-caixa {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  padding: 34px 30px 28px;
  box-shadow: 0 30px 80px rgba(8, 10, 13, 0.46);
  text-align: center;
}
.login-logo { width: 190px; height: auto; margin-bottom: 6px; }
.login-etiqueta {
  margin: 0 0 6px;
  color: #cf6812;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 10px;
  font-weight: 800;
}
.ajuda { color: var(--cinza-texto); font-size: 12px; margin: 16px 0 0; }

/* ---------- Barra do topo ---------- */

.barra-topo {
  background: linear-gradient(120deg, #2c313a, #11141a 78%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.barra-topo-interna {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.barra-logo { height: 30px; width: auto; }
.barra-usuario { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px; font-weight: 600; min-width: 0; }
.barra-usuario span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto-mini { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.4); }

/* ---------- Conteúdo ---------- */

.conteudo { max-width: 1080px; margin: 0 auto; padding: 22px 16px 60px; }

.cabecalho-modulo {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  margin-bottom: 18px;
  color: #fff;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 82% -40%, rgba(244, 151, 47, 0.36), transparent 21rem),
    radial-gradient(circle at 5% 130%, rgba(229, 29, 66, 0.14), transparent 18rem),
    linear-gradient(120deg, #2c313a, #11141a 78%);
}
.cabecalho-identidade { display: flex; align-items: center; gap: 18px; min-width: 0; }
.cabecalho-etiqueta { color: #f8aa54; letter-spacing: 0.15em; text-transform: uppercase; font-size: 10px; font-weight: 800; }
.cabecalho-modulo h1 { margin: 5px 0 6px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.03em; line-height: 1.1; }
.cabecalho-modulo p { margin: 0; color: rgba(255, 255, 255, 0.62); font-size: 12px; max-width: 560px; }
.cabecalho-modulo p strong { color: #fff; }
.matricula-selo {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cabecalho-foto { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.foto-grande, .foto-vazia {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
}
.foto-grande { object-fit: cover; }
.foto-vazia {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}
.foto-trocar { font-size: 11px; font-weight: 700; color: #f8aa54; cursor: pointer; }
.foto-trocar:hover { text-decoration: underline; }

/* ---------- Pastas ---------- */

.lista-pastas { display: grid; gap: 14px; }
.lista-pastas + .lista-pastas { margin-top: 14px; }

.pasta-bloco {
  background: #fff;
  border: 1px solid rgba(32, 42, 58, 0.08);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
}
.pasta-bloco.pasta-geral { border-style: dashed; }
.pasta-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--borda);
}
.pasta-titulo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pasta-icone { font-size: 20px; line-height: 1; }
.pasta-titulo strong { display: block; color: var(--navy); font-size: 15px; }
.pasta-titulo small { color: var(--cinza-texto); font-size: 11px; }
.pasta-dica { margin: 0; padding: 10px 16px 0; color: var(--cinza-texto); font-size: 12px; }
.pasta-msg { margin: 10px 16px 0; }

.pasta-envio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid rgba(244, 151, 47, 0.45);
  background: #fff8ef;
  border-radius: 10px;
  font-size: 13px;
}
.pasta-envio-nome { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.pasta-envio-acoes { display: flex; gap: 8px; }

.pasta-docs { padding: 6px 0; }
.documento-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--borda);
}
.documento-item:last-child { border-bottom: 0; }
.documento-icone { font-size: 22px; }
.documento-info { flex: 1; min-width: 0; }
.documento-info a { color: var(--navy); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.documento-info a:hover { text-decoration: underline; }
.documento-meta { color: var(--cinza-texto); font-size: 12px; }
.vazio { margin: 0; padding: 16px; text-align: center; color: var(--cinza-texto); font-size: 13px; }

/* ---------- Janelas ---------- */

.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  background: rgba(17, 20, 29, 0.45);
}
.modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: var(--raio);
  border: 1px solid rgba(32, 42, 58, 0.08);
  box-shadow: var(--sombra);
  padding: 24px;
}
.modal h2 { margin: 0 0 6px; color: var(--navy); font-size: 18px; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.modal-crop { max-width: 380px; text-align: center; }
.crop-area {
  position: relative;
  width: 320px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 4px auto 16px;
  border-radius: 12px;
  overflow: hidden;
  background: #11141d;
  touch-action: none;
  cursor: grab;
}
.crop-area:active { cursor: grabbing; }
.crop-area canvas { display: block; width: 100%; height: 100%; }
.crop-circulo-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(17, 20, 29, 0.6);
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -1px;
}

/* ---------- Celular ---------- */

@media (max-width: 640px) {
  .cabecalho-modulo { flex-direction: column; align-items: flex-start; padding: 20px; }
  .cabecalho-identidade { align-items: flex-start; }
  .barra-usuario span { max-width: 120px; }
  .pasta-cabecalho { flex-wrap: wrap; }
  .login-caixa { padding: 28px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
