/* ══════════════════════════════════════════
   Portal do Aluno — CSS
══════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f4f6f4; color: #1a3320; }

/* ── Login ── */
.portal-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3320 0%, #2D7A3A 100%);
  padding: 20px;
}

.portal-login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.portal-logo { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 16px; }
.portal-login-title { font-size: 22px; font-weight: 700; color: #1a3320; text-align: center; margin-bottom: 4px; }
.portal-login-sub { font-size: 13px; color: #888; text-align: center; margin-bottom: 28px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #ddd; border-radius: 8px;
  font-size: 15px; color: #1a3320;
  transition: border-color .15s;
}
.field input:focus { outline: none; border-color: #2D7A3A; }

.alert-error {
  background: #fdecea; color: #c62828;
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 14px;
  display: none;
}
.alert-error.show { display: block; }

.btn-portal-login {
  width: 100%; padding: 13px;
  background: #2D7A3A; color: #fff;
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-portal-login:hover { background: #1a3320; }
.btn-portal-login:disabled { opacity: .6; cursor: not-allowed; }

/* ── Topbar ── */
.portal-topbar {
  background: #1a3320;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 100;
}
.portal-topbar-left { display: flex; align-items: center; gap: 10px; }
.portal-topbar-left img { width: 32px; height: 32px; object-fit: contain; }
.portal-topbar-left span { color: #fff; font-size: 15px; font-weight: 600; }
.portal-badge { background: #2D7A3A; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 20px; }
.portal-topbar-right { display: flex; align-items: center; gap: 14px; }
.portal-topbar-right span { color: #c8e6c9; font-size: 14px; }
.btn-portal-logout {
  background: rgba(255,255,255,.12); color: #fff;
  border: none; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; cursor: pointer; transition: background .15s;
}
.btn-portal-logout:hover { background: rgba(255,255,255,.22); }

/* ── Conteúdo ── */
.portal-content { max-width: 860px; margin: 0 auto; padding: 28px 20px; }

/* ── Card do Estudo / Progresso ── */
.estudo-info-card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #E8F5E9;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.estudo-local { font-size: 18px; font-weight: 700; color: #1a3320; margin-bottom: 4px; }
.estudo-ministradores { font-size: 13px; color: #5a7a62; }

.estudo-info-right { min-width: 220px; }
.progresso-label { font-size: 13px; color: #555; margin-bottom: 8px; }
.progresso-bar-wrap {
  height: 10px; background: #E8F5E9; border-radius: 99px; overflow: hidden; margin-bottom: 6px;
}
.progresso-bar-fill {
  height: 100%; background: linear-gradient(90deg, #2D7A3A, #52b863);
  border-radius: 99px; transition: width .5s ease;
}
.progresso-pct { font-size: 22px; font-weight: 700; color: #2D7A3A; }

/* ── Sessões ── */
.portal-sessions { display: flex; flex-direction: column; gap: 20px; }

.session-card {
  background: #fff;
  border: 1.5px solid #E8F5E9;
  border-radius: 14px;
  overflow: hidden;
}

.session-header {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.session-header:hover { background: #f8fff8; }

.session-num {
  width: 32px; height: 32px;
  background: #E8F5E9; color: #2D7A3A;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.session-num.done { background: #2D7A3A; color: #fff; }

.session-meta { flex: 1; min-width: 0; }
.session-data { font-size: 13px; color: #888; }
.session-tema { font-size: 15px; font-weight: 600; color: #1a3320; margin-top: 2px; }

.session-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-prog {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  background: #f5f5f5; color: #999;
}
.badge-prog.done { background: #E8F5E9; color: #2D7A3A; }
.badge-prog.concluido { background: #2D7A3A; color: #fff; }

.session-toggle { font-size: 18px; color: #aaa; transition: transform .2s; }
.session-toggle.open { transform: rotate(180deg); }

.session-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1.5px solid #E8F5E9;
}
.session-body.open { display: block; }

/* ── Vídeo ── */
.session-video-wrap { margin-top: 16px; }
.session-video-label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
.video-iframe-wrap {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: 10px; background: #000;
}
.video-iframe-wrap iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: none; border-radius: 10px;
}

/* ── PDF ── */
.session-pdf-wrap { margin-top: 16px; }
.session-pdf-label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
.btn-ver-pdf {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f0f8f0; border: 1.5px solid #2D7A3A; color: #2D7A3A;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.btn-ver-pdf:hover { background: #2D7A3A; color: #fff; }

/* ── Ações ── */
.session-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}

.btn-mark {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1.5px solid; cursor: pointer; transition: all .15s;
}
.btn-mark.video    { border-color: #1976D2; color: #1976D2; background: #fff; }
.btn-mark.video.done    { background: #E3F2FD; }
.btn-mark.pdf      { border-color: #E65100; color: #E65100; background: #fff; }
.btn-mark.pdf.done      { background: #FFF3E0; }
.btn-mark.concluir { border-color: #2D7A3A; color: #2D7A3A; background: #fff; }
.btn-mark.concluir.done { background: #2D7A3A; color: #fff; border-color: #2D7A3A; cursor: default; }
.btn-mark:disabled { opacity: .5; cursor: not-allowed; }

/* ── Lightbox PDF ── */
.portal-lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 9999;
  align-items: center; justify-content: center; padding: 20px;
}
.portal-lightbox.show { display: flex; }
.portal-lightbox-inner {
  background: #fff; border-radius: 12px; padding: 16px;
  width: 100%; max-width: 860px; position: relative;
}
.lightbox-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 20px; cursor: pointer; color: #666;
}

/* ── Empty ── */
.portal-empty {
  text-align: center; padding: 60px 20px; color: #aaa; font-size: 15px;
  background: #fff; border-radius: 14px; border: 1.5px dashed #ddd;
}

@media (max-width: 600px) {
  .estudo-info-card { flex-direction: column; align-items: flex-start; }
  .estudo-info-right { width: 100%; }
}
