/* ═══════════════════════════════════════════════════
   ESTUDAÊ · Identidade Visual Oficial
   Verde #1db231 · Laranja #f97316 · Amarelo #f59e0b
   Prefeitura de Bayeux | Secretaria de Educação
═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Bebas+Neue&display=swap');

:root {
  /* ── Paleta Estudaê (extraída do material oficial) ── */
  --verde:        #1db231;
  --verde-esc:    #158a24;
  --verde-claro:  #d4f5d8;
  --verde-bg:     #e8faea;
  --laranja:      #f97316;
  --laranja-esc:  #ea6800;
  --amarelo:      #f5c518;
  --amarelo-esc:  #d4a500;
  --amarelo-claro:#fef9c3;
  --roxo:         #9b59b6;   /* topo do grid */
  --branco:       #ffffff;
  --cinza-bg:     #f5faf5;
  --texto:        #0f1f10;
  --muted:        #5a7a5c;
  --borda:        #c8e6c9;
  --sombra-sm:    0 1px 4px rgba(21,138,36,.12);
  --sombra:       0 4px 20px rgba(21,138,36,.12);
  --sombra-md:    0 12px 40px rgba(21,138,36,.18);
}

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

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--cinza-bg);
  color: var(--texto);
  margin: 0; padding: 0;
}

/* ══ LOGO ESTUDAÊ ════════════════════════════════════════════ */
.logo-estudae {
  height: 52px;
  width: auto;
  object-fit: contain;
}
.logo-estudae-lg {
  height: 90px;
  width: auto;
  object-fit: contain;
}

/* ══ NAVBAR PÚBLICA ══════════════════════════════════════════ */
.navbar-estudae {
  background: var(--verde-esc);
  padding: .65rem 1.5rem;
  box-shadow: 0 3px 16px rgba(0,0,0,.25);
  position: sticky; top: 0; z-index: 999;
  border-bottom: 3px solid var(--amarelo);
}

/* ══ HERO ════════════════════════════════════════════════════ */
.hero {
  background: var(--verde);
  color: #fff;
  padding: 4.5rem 1rem 7rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -60px; right: -80px;
  width: 320px; height: 320px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
/* Borda inferior rasgada (inspirada no layout) */
.hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 72px;
  background: var(--cinza-bg);
  clip-path: polygon(0 100%,100% 100%,100% 20%,90% 40%,80% 10%,70% 35%,60% 5%,50% 30%,40% 0%,30% 25%,20% 5%,10% 30%,0 10%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--amarelo);
  color: var(--texto);
  border-radius: 99px; padding: .35rem 1rem;
  font-size: .8rem; font-weight: 900; letter-spacing: .4px;
  margin-bottom: 1.2rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900; line-height: 1.15;
  margin-bottom: .75rem;
  text-shadow: 2px 3px 0 rgba(0,0,0,.15);
}
.hero h1 em { color: var(--amarelo); font-style: normal; }
.hero p { font-size: 1.02rem; opacity: .9; max-width: 520px; }
.info-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px; padding: .5rem 1rem;
  font-size: .85rem; font-weight: 700;
}

/* ══ CARDS ═══════════════════════════════════════════════════ */
.card-e {
  background: var(--branco);
  border: 1.5px solid var(--borda);
  border-radius: 1.1rem;
  box-shadow: var(--sombra);
  overflow: hidden;
}
.card-e-header {
  background: linear-gradient(90deg, var(--verde-esc) 0%, var(--verde) 100%);
  color: #fff; padding: .95rem 1.5rem;
  font-weight: 900; font-size: .97rem;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 3px solid var(--amarelo);
}

/* ══ FORM ════════════════════════════════════════════════════ */
.form-label { font-weight: 800; font-size: .84rem; margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: .65rem;
  border: 1.5px solid var(--borda);
  font-size: .92rem; padding: .55rem .9rem;
  font-family: 'Nunito', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(29,178,49,.18);
  outline: none;
}
.form-section-title {
  font-weight: 900; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--verde-esc);
  display: flex; align-items: center; gap: .5rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--verde-claro);
  margin-bottom: 1rem;
}

/* ══ BOTÕES ══════════════════════════════════════════════════ */
.btn-e-primary {
  background: linear-gradient(135deg, var(--laranja) 0%, var(--laranja-esc) 100%);
  border: none; border-radius: .7rem;
  color: #fff; font-weight: 900; font-family: 'Nunito', sans-serif;
  padding: .7rem 2rem; font-size: 1rem;
  cursor: pointer; transition: opacity .2s, transform .15s;
  display: inline-flex; align-items: center; gap: .5rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
  box-shadow: 0 4px 14px rgba(249,115,22,.35);
}
.btn-e-primary:hover { opacity: .9; transform: translateY(-1px); }

/* ══ LOGIN ════════════════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  background: var(--verde);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: rgba(255,255,255,.06); border-radius: 50%;
}
.login-wrap::after {
  content: '';
  position: absolute; bottom: -80px; left: -80px;
  width: 400px; height: 400px;
  background: rgba(245,197,24,.08); border-radius: 50%;
}
.login-box {
  background: var(--branco); border-radius: 1.4rem;
  padding: 2.5rem; width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  position: relative; z-index: 1;
  border-top: 5px solid var(--amarelo);
}
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo img { height: 80px; object-fit: contain; }
.login-logo small { color: var(--muted); font-size: .83rem; display: block; margin-top: .4rem; }

/* ══ SIDEBAR ADMIN ═══════════════════════════════════════════ */
.sidebar {
  width: 255px; min-height: 100vh;
  background: var(--verde-esc);
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 1000;
  transition: transform .3s ease;
  border-right: 3px solid var(--amarelo);
}
.sidebar-brand {
  padding: 1.2rem 1.3rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: .5rem;
}
.sidebar-brand img { height: 44px; object-fit: contain; }

.sidebar-section {
  font-size: .67rem; font-weight: 900; letter-spacing: 1.3px;
  text-transform: uppercase; color: rgba(255,255,255,.4);
  padding: 1rem 1.3rem .3rem;
}
.sidebar a {
  display: flex; align-items: center; gap: .7rem;
  color: rgba(255,255,255,.75); text-decoration: none;
  padding: .62rem 1.3rem; font-size: .88rem; font-weight: 700;
  transition: background .15s, color .15s; border-left: 3px solid transparent;
}
.sidebar a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar a.active {
  background: rgba(245,197,24,.15);
  color: var(--amarelo);
  border-left-color: var(--amarelo);
}

.admin-wrap { margin-left: 255px; min-height: 100vh; }
.admin-topbar {
  background: var(--branco); border-bottom: 2px solid var(--borda);
  padding: .85rem 1.75rem;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--sombra-sm);
  position: sticky; top: 0; z-index: 100;
}
.admin-topbar h1 { font-size: 1.1rem; font-weight: 900; margin: 0; color: var(--verde-esc); }

/* ══ STATS ════════════════════════════════════════════════════ */
.stat-card {
  background: var(--branco); border: 1.5px solid var(--borda);
  border-radius: 1rem; padding: 1.3rem 1.4rem;
  display: flex; align-items: center; gap: 1.1rem;
  box-shadow: var(--sombra-sm);
  transition: box-shadow .2s, transform .2s;
  border-top: 3px solid var(--verde);
}
.stat-card:hover { box-shadow: var(--sombra); transform: translateY(-2px); }
.stat-icon {
  width: 54px; height: 54px; border-radius: .85rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; flex-shrink: 0;
}
.stat-val { font-size: 1.9rem; font-weight: 900; line-height: 1; color: var(--verde-esc); }
.stat-lbl { font-size: .79rem; color: var(--muted); font-weight: 700; margin-top: .2rem; }

/* ══ TABELA ═══════════════════════════════════════════════════ */
.tbl thead th {
  background: var(--verde-bg); font-size: .75rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .7px; color: var(--verde-esc);
  border-bottom: 2px solid var(--borda); padding: .8rem 1rem;
}
.tbl tbody td { padding: .75rem 1rem; vertical-align: middle; font-size: .88rem; }
.tbl tbody tr:hover { background: var(--verde-bg); }

/* ══ STATUS BADGES ═══════════════════════════════════════════ */
.badge-ativo    { background: var(--verde-claro); color: var(--verde-esc); }
.badge-inativo  { background: #fee2e2; color: #b91c1c; }
.badge-pendente { background: var(--amarelo-claro); color: #92400e; }
.sbadge {
  padding: .28rem .75rem; border-radius: 99px;
  font-size: .73rem; font-weight: 900;
}

/* ══ FOTO ALUNO ══════════════════════════════════════════════ */
.aluno-foto {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--borda);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.aluno-foto:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,0,0,.22); }
.foto-ph {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--verde-claro); border: 2px solid var(--borda);
  display: flex; align-items: center; justify-content: center;
  color: var(--verde); font-size: 1.1rem; flex-shrink: 0;
}

/* ══ VIDEO PLAYER ════════════════════════════════════════════ */
.video-wrap {
  background: #000; border-radius: .9rem; overflow: hidden;
  position: relative; user-select: none;
}
.video-wrap video { width: 100%; display: block; }
.video-shield { position: absolute; inset: 0; z-index: 5; }

/* ══ CARD DE AULA ════════════════════════════════════════════ */
.aula-card {
  background: var(--branco); border: 1.5px solid var(--borda);
  border-radius: .9rem; overflow: hidden; display: block;
  text-decoration: none; color: inherit;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.aula-card:hover {
  border-color: var(--verde);
  box-shadow: 0 8px 28px rgba(29,178,49,.18);
  transform: translateY(-2px); color: inherit;
}
.aula-thumb {
  height: 126px; display: flex; align-items: center; justify-content: center;
  position: relative; font-size: 2.5rem; color: rgba(255,255,255,.85);
}
.aula-play {
  position: absolute; width: 50px; height: 50px;
  background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.45);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; transition: background .2s;
}
.aula-card:hover .aula-play { background: rgba(255,255,255,.38); }
.aula-assistido-tag {
  position: absolute; top: 8px; right: 8px;
  background: var(--amarelo); color: var(--texto);
  font-size: .68rem; font-weight: 900;
  padding: .2rem .55rem; border-radius: 99px;
}
.aula-info { padding: .85rem 1rem; }
.aula-titulo {
  font-weight: 800; font-size: .88rem;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .25rem;
}
.aula-meta { font-size: .75rem; color: var(--muted); }

/* ══ MODAL FOTO ══════════════════════════════════════════════ */
#mFoto .modal-header { background: #111; color: #fff; border: none; }
#mFoto .modal-header .btn-close { filter: invert(1); }
#mFoto .modal-body { background: #000; padding: 0; min-height: 260px; display: flex; align-items: center; justify-content: center; }
#mFoto .modal-body img { max-width: 100%; max-height: 72vh; object-fit: contain; }

/* ══ ALERT OVERRIDE ═══════════════════════════════════════════ */
.alert-info { background: var(--verde-bg); border-color: var(--borda); color: var(--verde-esc); }

/* ══ RESPONSIVO ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--sombra-md); }
  .admin-wrap { margin-left: 0; }
}
