﻿* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #06070a;
  --bg-2: #0f121d;
  --card: rgba(7, 8, 12, 0.94);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --text-muted: rgba(202, 208, 219, 0.72);
  --primary: #f24343;
  --primary-soft: rgba(255, 77, 77, 0.18);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --max-width: 1120px;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(40% 40% at 50% 18%, rgba(242, 67, 67, 0.13), transparent 75%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 10px),
    linear-gradient(180deg, #020204 0%, #05070b 100%);
  color: var(--text);
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.view {
  height: 100%;
}

/* LOGIN */

.card-center {
  max-width: 430px;
  margin: auto;
  padding: 36px 36px 34px;
  background: var(--card);
  border: 1px solid rgba(242, 67, 67, 0.16);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  justify-content: center;
  text-align: center;
}

.login-header h2 {
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: 0.02em;
}

.login-header p {
  margin: 4px 0 0;
  font-size: 1.03rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.login-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid rgba(242, 67, 67, 0.28);
  background: rgba(242, 67, 67, 0.06);
  padding: 12px;
  filter: drop-shadow(0 0 18px rgba(242, 67, 67, 0.55));
}

.login-card {
  animation: login-card-enter 0.45s ease-out both;
}

.login-description {
  max-width: 300px;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.form-group {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.02rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus {
  outline: none;
  border-color: rgba(242, 67, 67, 0.72);
  box-shadow: 0 0 0 4px rgba(242, 67, 67, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #f24343, #f65050);
  color: #fff;
  letter-spacing: 0.08em;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-link {
  background: none;
  border: none;
  color: #f24343;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
  font-size: 1rem;
  transition: color 0.15s ease;
}

.btn-link:hover {
  color: #ff6f6f;
  text-decoration: underline;
}

#login-screen {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

#login-screen #login-form h3,
#login-screen #login-form label {
  display: none;
}

#login-screen .form-group {
  margin-top: 0;
  margin-bottom: 14px;
}

#login-screen #login-password {
  margin-bottom: 8px;
}

.login-main-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 60px;
  border-radius: 16px;
  font-size: 1.8rem;
  font-weight: 800;
}

.login-links {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.login-links-separator {
  color: rgba(255, 255, 255, 0.4);
}

@keyframes login-card-enter {
  from {
    transform: translateY(14px) scale(0.985);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.small {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: center;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* MAIN APP LAYOUT */

#main-app {
  display: flex;
  height: 100%;
  width: 100%;
}

.sidebar {
  width: 260px;
  background: rgba(15, 18, 29, 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 22px;
  gap: 18px;
  overflow: hidden;
}

.mobile-menu-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 77, 77, 0.2);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.sidebar-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s ease, border 0.15s ease;
  color: rgba(255, 255, 255, 0.88);
}

.sidebar-item .sidebar-label {
  color: rgba(255, 255, 255, 0.88);
}

.sidebar-item.active .sidebar-label {
  color: #fff;
}

.sidebar-item.active {
  background: rgba(255, 77, 77, 0.18);
  border-color: rgba(255, 77, 77, 0.35);
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-item.active {
  background: rgba(255, 77, 77, 0.15);
  border-color: rgba(255, 77, 77, 0.25);
}

.sidebar-icon {
  font-size: 1.1rem;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.main {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.modules-progress-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
  min-height: 260px;
}

.module-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.module-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #81C784);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.08);
}

.module-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
}

.module-topline {
  font-size: 0.86rem;
  color: #ffb3b3;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.module-weight {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ff9d9d;
  border: 1px solid rgba(242, 67, 67, 0.35);
  background: rgba(242, 67, 67, 0.14);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

.module-subject {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e8eefc;
  line-height: 1.35;
}

.module-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.module-description-simple {
  font-size: 0.88rem;
  color: #d2d9ea;
  line-height: 1.5;
  min-height: 84px;
}

.module-description strong {
  color: #dbe8ff;
  font-weight: 700;
}

.module-points {
  margin: 2px 0 0 16px;
  padding: 0;
  color: #cfd8ea;
  font-size: 0.78rem;
  line-height: 1.45;
}

.module-progress-wrap {
  margin-top: auto;
}

.module-progress-text {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 4px;
}

.module-percent {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 800;
  color: #f2f4fa;
}

.module-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-card {
  width: min(920px, 100%);
  max-height: 92vh;
  background: rgba(19, 24, 34, 0.96);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 38px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-content {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.question-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.option {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s ease;
}

.option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.table th {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.tag {
  display: inline-flex;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.tag-success {
  background: rgba(34, 197, 94, 0.2);
  color: #a7f3d0;
}

.tag-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.tag-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.stats-wrong {
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 900px) {
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(10, 14, 24, 0.95);
    color: #fff;
    font-size: 1.35rem;
    z-index: 1201;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1198;
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modules-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    transition: left 0.25s ease;
    z-index: 1200;
  }

  .sidebar.open {
    left: 0;
  }

  .main {
    padding: 18px;
    padding-top: 64px;
  }
}

@media (max-width: 640px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }

  .modules-progress-grid {
    grid-template-columns: 1fr;
  }
}

/* SIDEBAR DE DETALHES DO MÓDULO */

.module-sidebar {
  position: fixed;
  inset: 0;
  z-index: 8888;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.sidebar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.sidebar-content {
  position: relative;
  width: min(480px, 100%);
  background: rgba(15, 20, 30, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 42px rgba(0, 0, 0, 0.85);
  animation: slideInRight 0.3s ease-out;
  overflow: hidden;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.btn-close:hover {
  color: var(--primary);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-question-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  transition: all 0.15s ease;
}

.error-question-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.error-question-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.error-badge {
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 77, 77, 0.25);
  color: #ff9696;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.error-question-content {
  flex: 1;
}

.error-question-title {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 6px;
}

.error-question-id {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.error-action-buttons {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn-refazer {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 193, 7, 0.2);
  color: #ffd54f;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-refazer:hover {
  background: rgba(255, 193, 7, 0.3);
}

.module-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 12px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 8px;
  margin-bottom: 16px;
  border-left: 4px solid #4CAF50;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #4CAF50;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-actions button {
  flex: 1;
}

@media (max-width: 640px) {
  .sidebar-content {
    width: 100%;
  }

  .module-progress-main {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-circle {
    margin: 0 auto;
  }
}

/* DASHBOARD STYLING */

.dashboard-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.dashboard-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.metric-card {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(100, 150, 255, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  border-left: 4px solid #4CAF50;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #4CAF50;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ranking-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.ranking-card.clickable {
  cursor: pointer;
}

.ranking-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.ranking-medal {
  font-size: 1.8rem;
  min-width: 40px;
  text-align: center;
}

.ranking-info {
  flex: 1;
}

.ranking-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.ranking-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.module-progress-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.module-progress-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.module-name {
  font-weight: 600;
  color: var(--text);
}

.module-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(76, 175, 80, 0.16);
  color: #b7e3be;
  padding: 4px 8px;
  border-radius: 999px;
}

.module-progress-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-kpis {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.module-kpi {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 0.7rem;
  color: #a8b0c2;
}

.module-analysis-hint {
  font-size: 0.72rem;
  color: #96a0b5;
  margin-top: 8px;
}

.progress-circle {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0;
}

.progress-circle--small {
  width: 40px;
  height: 40px;
  margin: 0;
}

.progress-circle--small .progress-text {
  font-size: 0.8rem;
}

.progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.progress-circle-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  transition: stroke-dashoffset 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
}

.progress-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

.progress-bar-small {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #81C784);
  border-radius: 2px;
  transition: width 0.3s ease;
}
