/* ==========================================================================
   SISTEMA DA JORNADA CIENTÍFICA - UNI SÃO LOURENÇO
   Design System Moderno, Responsivo e Mobile-First (Baseado no Figma Frame 4)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Paleta Oficial Uni São Lourenço */
  --primary: #0077b6;
  --primary-dark: #03045e;
  --primary-light: #00b4d8;
  --accent: #48cae4;
  --accent-soft: #e0f2fe;
  
  --success: #10b981;
  --success-dark: #059669;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0284c7;

  /* Neutros e Superfícies */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #0077b6;

  /* Tipografia e Cores de Texto */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);

  /* Bordas e Raio */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--primary-dark);
}

/* Container Responsivo */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container-sm {
  max-width: 580px;
}

/* ==========================================================================
   HEADER E NAVBAR (Estilo Figma)
   ========================================================================== */
.header-main {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-brand img {
  height: 48px;
  width: auto;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--accent-soft);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-dark);
  cursor: pointer;
}

/* ==========================================================================
   CARDS DE ESTATÍSTICAS (Figma Frame 4)
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  background: linear-gradient(180deg, rgba(0, 180, 216, 0.08) 0%, rgba(248, 250, 252, 0) 100%);
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 1.75rem;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   BOTÕES E COMPONENTES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

.btn-pill {
  border-radius: var(--radius-pill);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(0, 119, 182, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(3, 4, 94, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-white);
}

.btn-danger:hover {
  background: #dc2626;
  color: var(--text-white);
}

.btn-success {
  background: var(--success);
  color: var(--text-white);
}

.btn-success:hover {
  background: var(--success-dark);
  color: var(--text-white);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   FORMULÁRIOS E INPUTS
   ========================================================================== */
.card-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.form-label .required {
  color: var(--danger);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

/* Switcher UNISL (Estuda na UNISL?) */
.toggle-switch-card {
  background: var(--bg-muted);
  border: 1.5px dashed var(--primary-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.switch-label-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.switch-text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

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

/* Radio buttons estilizados */
.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

/* Contadores de Palavras */
.word-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-muted);
  float: right;
}

.word-counter-badge.valid {
  background: #dcfce7;
  color: #15803d;
}

.word-counter-badge.invalid {
  background: #fee2e2;
  color: #b91c1c;
}

/* ==========================================================================
   ALERTS E MENSAGENS FLASH
   ========================================================================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
}

.alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #e0f2fe; color: #075985; border-color: #bae6fd; }

.alert-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* ==========================================================================
   TABELAS E LISTAGENS RESPONSIVAS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-custom th {
  background: var(--bg-muted);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.table-custom td {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  vertical-align: middle;
}

.table-custom tr:last-child td {
  border-bottom: none;
}

.table-custom tr:hover td {
  background-color: #f8fafc;
}

/* Badges e Status */
.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #e0f2fe; color: #075985; }

/* ==========================================================================
   RODAPÉ INSTITUCIONAL
   ========================================================================== */
.footer-main {
  background: #03045e;
  color: #ffffff;
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.footer-col p, .footer-col li {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.7;
}

.footer-col ul {
  list-style: none;
}

.footer-col a {
  color: #cbd5e1;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.footer-logos img {
  height: 44px;
  width: auto;
  opacity: 0.9;
  filter: brightness(0) invert(1);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ==========================================================================
   MEDIA QUERIES (MOBILE FIRST ADAPTATION)
   ========================================================================== */
@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 0.75rem;
  }

  .navbar-menu.active {
    display: flex;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .card-form {
    padding: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
