@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Base escura - identidade "Neo-Tactile" */
  --bg: #070b12;
  --bg-2: #0c1220;

  /* Superfícies de vidro escuras (header, nav, tabs inativas) */
  --glass: rgba(255,255,255,0.06);
  --glass-hover: rgba(255,255,255,0.1);
  --glass-border: rgba(255,255,255,0.12);

  /* Superfícies de vidro claras (cards de conteúdo denso) */
  --glass-light: rgba(238,242,248,0.97);
  --glass-light-border: rgba(15,23,42,0.08);
  --glass-light-hover: rgba(255,255,255,1);

  --text: #eef2f9;
  --text-on-light: #101828;
  --muted: #8b96ac;
  --muted-on-light: #5b6577;

  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(135deg, #3b82f6 0%, #22d3ee 100%);
  --accent-glow: 0 0 0 1px rgba(59,130,246,0.5), 0 0 20px rgba(59,130,246,0.45), 0 0 44px rgba(34,211,238,0.22);

  --success: #22c55e;
  --success-soft: rgba(34,197,94,0.16);
  --danger: #f87171;
  --danger-soft: rgba(248,113,113,0.16);

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 10px 34px rgba(2,6,16,0.5), inset 0 1px 0 rgba(255,255,255,0.5);
  --shadow-dark: 0 10px 30px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Manchas de luz ambiente, fixas atrás de todo o conteúdo */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  z-index: -1;
  pointer-events: none;
}
body::before {
  width: 560px; height: 560px;
  top: -180px; left: -160px;
  background: radial-gradient(circle, rgba(59,130,246,0.38), transparent 70%);
}
body::after {
  width: 620px; height: 620px;
  bottom: -220px; right: -180px;
  background: radial-gradient(circle, rgba(34,211,238,0.26), transparent 70%);
}

h1, h2, h3 {
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: -0.01em;
}

/* ---------------- Login ---------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  background: var(--glass-light);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
  color: var(--text-on-light);
}

.login-card h1 { font-size: 1.35rem; margin-bottom: 8px; font-weight: 700; }
.login-card p { margin: 4px 0; color: var(--text-on-light); }
.login-card .muted { color: var(--muted-on-light); }

.login-error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin-top: 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(248,113,113,0.35);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ---------------- Header ---------------- */
header.app-header {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
  color: var(--text);
  padding: 26px 20px 22px;
  text-align: center;
}

.logout-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s, box-shadow 0.15s;
}
.logout-btn:hover { background: var(--glass-hover); box-shadow: 0 0 16px rgba(255,255,255,0.08); }

header.app-header h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
}

header.app-header p {
  margin: 0;
  color: var(--muted);
}

#countdown {
  display: inline-block;
  margin-top: 14px;
  background: var(--accent-grad);
  color: #04101f;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: var(--accent-glow);
}

nav.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  background: rgba(7,11,18,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--glass-border);
}

.nav-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
  font-family: "Manrope", sans-serif;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.nav-btn:hover { background: var(--glass-hover); color: var(--text); }

.nav-btn.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #04101f;
  box-shadow: var(--accent-glow);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px;
}

.view { display: none; }
.view.active { display: block; }

h2 {
  font-size: 1.32rem;
  margin-top: 0;
  font-weight: 700;
}

h3 { font-size: 1.02rem; font-weight: 700; }

.muted { color: var(--muted); font-size: 0.9rem; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.info-card {
  background: var(--glass-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-on-light);
  box-shadow: var(--shadow-card);
}

.info-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-on-light);
  font-weight: 700;
}

.info-value {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-on-light);
}

.estrutura-prova, .eliminatorias, .subject-card, .quiz-question, .quiz-result {
  background: var(--glass-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  color: var(--text-on-light);
  box-shadow: var(--shadow-card);
}

.estrutura-prova .muted, .eliminatorias .muted { color: var(--muted-on-light); }
.estrutura-prova h3, .eliminatorias h3 { color: var(--text-on-light); }

.estrutura-item {
  padding: 8px 0;
  border-bottom: 1px dashed var(--glass-light-border);
  color: var(--text-on-light);
}
.estrutura-item:last-child { border-bottom: none; }

.eliminatorias { border-left: 4px solid var(--danger); }
.eliminatorias ul { margin: 8px 0; padding-left: 20px; }
.eliminatorias li { margin-bottom: 4px; }

.cron-item {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  background: var(--glass-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  align-items: baseline;
  color: var(--text-on-light);
  box-shadow: var(--shadow-card);
}

.cron-item.destaque {
  background: linear-gradient(135deg, rgba(59,130,246,0.16), rgba(34,211,238,0.16));
  border: 1px solid rgba(59,130,246,0.4);
  font-weight: 700;
  box-shadow: var(--accent-glow);
}

.cron-data {
  min-width: 140px;
  font-weight: 800;
  color: #1d4ed8;
}
.cron-item.destaque .cron-data { color: #0c4a8f; }

.subject-card { border-left: 4px solid var(--accent); }

.subject-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subject-header h3 { color: var(--text-on-light); }

.tag {
  background: rgba(59,130,246,0.12);
  color: #1d4ed8;
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.progress-bar-outer {
  height: 10px;
  background: rgba(15,23,42,0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 8px 0 4px;
}

.progress-bar-outer.big { height: 16px; }

.progress-bar-inner {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: var(--accent-grad) !important;
  box-shadow: 0 0 10px rgba(59,130,246,0.6);
  transition: width 0.3s ease;
}

.progress-pct {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.subject-card .progress-pct { color: var(--muted-on-light); }

/* Blocos de "progresso geral" ficam soltos direto no fundo escuro da
   página (fora de qualquer card), então ganham seu próprio invólucro de
   vidro escuro para manter o contraste do texto e da trilha da barra. */
#dashboard-progress, #dashboard-progress-2 {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}
#dashboard-progress h3, #dashboard-progress-2 h3 { color: var(--text); margin-top: 0; }
#dashboard-progress .progress-bar-outer, #dashboard-progress-2 .progress-bar-outer { background: rgba(255,255,255,0.14); }

.topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-on-light);
}

.topic-item span { order: 1; flex: 1; }

/* Checkbox restilizado como toggle switch, sem alterar o HTML */
.topic-item input {
  order: 2;
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: rgba(15,23,42,0.14);
  border: 1px solid rgba(15,23,42,0.12);
  position: relative;
  cursor: pointer;
  margin: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.topic-item input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
  transition: transform 0.2s ease;
}

.topic-item input:checked {
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: var(--accent-glow);
}

.topic-item input:checked::before {
  transform: translateX(18px);
}

.quiz-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

select {
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-light-border);
  background: var(--glass-light);
  color: var(--text-on-light);
  font-size: 0.9rem;
  font-family: "Manrope", sans-serif;
}

.btn-primary {
  background: var(--accent-grad);
  color: #04101f;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: "Manrope", sans-serif;
  box-shadow: var(--accent-glow);
  transition: filter 0.15s, transform 0.1s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: "Manrope", sans-serif;
}
.btn-secondary:hover { background: var(--danger-soft); }

.quiz-progress {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 700;
}

.quiz-q-text {
  font-size: 1.04rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-on-light);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.quiz-option {
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-on-light);
  font-family: "Manrope", sans-serif;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: #ffffff; box-shadow: 0 0 0 1px rgba(59,130,246,0.25); }
.quiz-option:disabled { cursor: default; opacity: 0.9; }

.quiz-letter {
  font-weight: 800;
  color: var(--accent);
  min-width: 18px;
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-soft);
  box-shadow: 0 0 16px rgba(34,197,94,0.25);
}
.quiz-option.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: 0 0 16px rgba(248,113,113,0.25);
}

.quiz-feedback { margin-top: 14px; }
.feedback-correct { color: #16a34a; font-weight: 700; }
.feedback-wrong { color: #dc2626; font-weight: 700; }
.quiz-explanation {
  background: rgba(15,23,42,0.05);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.88rem;
  color: var(--text-on-light);
}

.quiz-result { text-align: center; }
.quiz-score { font-size: 1.8rem; font-weight: 800; color: var(--accent); }

.table-scroll {
  overflow-x: auto;
  margin-bottom: 14px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--glass-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-light-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.table-scroll .history-table { margin-bottom: 0; }

.admin-table { white-space: nowrap; }

.history-table th, .history-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--glass-light-border);
  font-size: 0.85rem;
  color: var(--text-on-light);
}

.history-table th {
  background: rgba(15,23,42,0.05);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-on-light);
  font-weight: 700;
}

footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .cron-item { flex-direction: column; gap: 2px; }
  .cron-data { min-width: auto; }
}

/* ---------------- Dashboard (topo do Início) ---------------- */
.dash-panel {
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-dark);
}

.dash-days {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.dash-days-number {
  font-family: "Sora", sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-days-label {
  font-size: 0.95rem;
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dash-tile {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dash-tile-value {
  font-family: "Sora", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-2);
}

.dash-tile-label {
  font-size: 0.74rem;
  color: var(--muted);
}

.dash-assessment {
  margin: 0;
  font-size: 0.9rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
}

/* ---------------- Videoaulas ---------------- */
.video-topic {
  border: 1px solid var(--glass-light-border);
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  padding: 12px 16px;
}

.video-topic summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 4px 0;
  color: var(--text-on-light);
}

.watched-count {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted-on-light);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.video-card {
  background: var(--glass-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-light-border);
  box-shadow: var(--shadow-card);
}

.video-card.watched {
  border-color: var(--success);
  box-shadow: 0 0 16px rgba(34,197,94,0.25);
}

.video-watched-badge {
  display: none;
  margin: 0 10px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #15803d;
}

.video-card.watched .video-watched-badge {
  display: block;
}

.video-embed {
  position: relative;
  padding-top: 56.25%;
  background: #000;
}

.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.video-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 8px 10px 2px;
  color: var(--text-on-light);
}

.video-channel {
  font-size: 0.75rem;
  margin: 0 10px 10px;
}
.video-card .muted { color: var(--muted-on-light); }

.video-practice-btn {
  margin-top: 4px;
}
