/* ============================================================
   main.css — Variáveis globais, reset, tipografia, header, tabs, badges
   Estilo: TCU — azul-marinha + dourado + Merriweather / Source Sans 3
   ============================================================ */

/* --- Variáveis CSS --- */
:root {
  /* Brand — preto (portal do aluno) */
  --primary:        #000000;
  --primary-mid:    #1a1a1a;
  --primary-light:  #374151;
  --primary-xlight: #f3f4f6;
  --primary-50:     #f9fafb;

  /* Dourado → Verde (portal do aluno) */
  --gold:           #10b981;
  --gold-light:     #d1fae5;
  --gold-dark:      #059669;

  /* Accent — verde */
  --accent:         #10b981;
  --accent-light:   #d1fae5;
  --accent-dark:    #059669;

  /* Status / Prioridade */
  --mais-cobrado:        #dc2626;
  --mais-cobrado-bg:     #fee2e2;
  --mais-cobrado-border: #fca5a5;
  --cobrado:             #d97706;
  --cobrado-bg:          #fef3c7;
  --cobrado-border:      #fcd34d;
  --menos-cobrado:       #6b7280;
  --menos-cobrado-bg:    #f3f4f6;
  --menos-cobrado-border:#d1d5db;

  /* Layout */
  --sidebar-width:   268px;
  --header-height:   68px;
  --tab-nav-height:  50px;

  /* Cores de fundo e texto */
  --bg:           #f7f9fc;
  --bg-alt:       #f0f4f8;
  --white:        #ffffff;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --text:         #1a202c;
  --text-secondary:#4a5568;
  --text-muted:   #718096;
  --text-light:   #a0aec0;

  /* Seções dos cards */
  --section-orientacao-bg:     #eff6ff;
  --section-orientacao-border: #3b82f6;
  --section-lei-bg:            #faf5ff;
  --section-lei-border:        #7c3aed;
  --section-pontos-bg:         #f0fdf4;
  --section-pontos-border:     #10b981;
  --section-pegadinhas-bg:     #fff1f2;
  --section-pegadinhas-border: #dc2626;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(10, 31, 59, 0.05);
  --shadow-sm: 0 1px 3px rgba(10, 31, 59, 0.08), 0 1px 2px rgba(10, 31, 59, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 31, 59, 0.10);
  --shadow-lg: 0 8px 30px rgba(10, 31, 59, 0.13);

  /* Transições */
  --transition:      0.2s ease;
  --transition-slow: 0.35s ease;

  /* Border radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 100px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.3;
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input {
  font-family: inherit;
}

/* --- App Header --- */
.app-header {
  height: var(--header-height);
  background: #000000;
  border-bottom: 3px solid var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

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

.brand-badge {
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  font-family: 'Source Sans 3', sans-serif;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--white);
  font-family: 'Merriweather', serif;
}

.banca-tag {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.header-progress-bar-track {
  width: 90px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  overflow: hidden;
}

.header-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.header-progress-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* --- Tab Navigation --- */
.tab-nav {
  height: var(--tab-nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  padding: 0 28px;
  gap: 4px;
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  font-family: 'Source Sans 3', sans-serif;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-50);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.tab-btn .tab-icon {
  font-size: 1rem;
}

.tab-badge {
  background: var(--accent);
  color: var(--white);
  font-size: 0.63rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.03em;
  min-width: 36px;
  text-align: center;
}

/* --- Tab Panels --- */
.tab-panel {
  display: none;
  animation: fadeInUp 0.22s ease;
}

.tab-panel.active {
  display: flex;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Priority Badges --- */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border: 1px solid;
  font-family: 'Source Sans 3', sans-serif;
}

.badge-mais-cobrado {
  background: var(--mais-cobrado-bg);
  color: var(--mais-cobrado);
  border-color: var(--mais-cobrado-border);
}

.badge-cobrado {
  background: var(--cobrado-bg);
  color: var(--cobrado);
  border-color: var(--cobrado-border);
}

.badge-menos-cobrado {
  background: var(--menos-cobrado-bg);
  color: var(--menos-cobrado);
  border-color: var(--menos-cobrado-border);
}

/* --- Tipo de Meta Badges --- */
.meta-tipo-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Source Sans 3', sans-serif;
}

.tipo-leitura_lei_seca {
  background: #ede9fe;
  color: #6d28d9;
}

.tipo-revisao_teoria {
  background: var(--primary-xlight);
  color: var(--primary);
}

.tipo-resolucao_questoes {
  background: #fef3c7;
  color: #92400e;
}

.tipo-revisao_pontos_principais {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.tipo-simulado_parcial {
  background: #fce7f3;
  color: #9d174d;
}

/* --- Scrollbar personalizada --- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Utilitários --- */
.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-muted);
}

/* ============================================================
   LOGIN OVERLAY
   ============================================================ */

.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayIn 0.3s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.login-overlay--saindo {
  animation: overlayOut 0.4s ease forwards;
}

@keyframes overlayOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  animation: cardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  background: var(--white);
  padding: 40px 32px 24px;
  text-align: center;
}

.login-logo-img {
  width: 240px;
  height: auto;
  margin-bottom: 20px;
}

.login-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--primary);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: 'Source Sans 3', sans-serif;
  margin-bottom: 12px;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Source Sans 3', sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Source Sans 3', sans-serif;
}

.login-form {
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: 'Source Sans 3', sans-serif;
}

.login-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: 'Source Sans 3', sans-serif;
}

.login-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
  background: var(--white);
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap .login-input {
  padding-right: 44px;
}

.login-toggle-senha {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  opacity: 0.55;
  transition: opacity var(--transition);
}

.login-toggle-senha:hover {
  opacity: 1;
}

.login-erro {
  display: none;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-left: 3px solid var(--mais-cobrado);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #7f1d1d;
  font-family: 'Source Sans 3', sans-serif;
}

.login-btn {
  background: #000000;
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Source Sans 3', sans-serif;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn:hover:not(:disabled) {
  background: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-footer {
  padding: 16px 32px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'Source Sans 3', sans-serif;
}

/* --- Botão de logout no header --- */
.header-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Source Sans 3', sans-serif;
  white-space: nowrap;
}

.header-logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.header-aluno-nome {
  font-weight: 700;
}

.logout-icon {
  opacity: 0.7;
  font-style: normal;
}

/* --- Botões gerais utilitários --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Source Sans 3', sans-serif;
  border: none;
}

.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger-outline {
  background: var(--white);
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
}

.btn-danger-outline:hover {
  background: #fee2e2;
  border-color: var(--mais-cobrado);
}
