/* ========================================================
   Sistema de Votação do Grêmio Estudantil - CSS Principal
   Paleta: Azul Escolar, Branco e Verde de Ação / Sucesso
   ======================================================== */

:root {
  --primary-900: #0f172a;
  --primary-800: #1e3a8a;
  --primary-700: #1d4ed8;
  --primary-600: #2563eb;
  --primary-500: #3b82f6;
  --primary-100: #dbeafe;
  --primary-50:  #eff6ff;

  --success-700: #047857;
  --success-600: #059669;
  --success-500: #10b981;
  --success-100: #d1fae5;
  --success-50:  #ecfdf5;

  --warning-600: #d97706;
  --warning-500: #f59e0b;
  --warning-50:  #fffbeb;

  --danger-600:  #dc2626;
  --danger-500:  #ef4444;
  --danger-100:  #fee2e2;
  --danger-50:   #fef2f2;

  --gray-900:    #0f172a;
  --gray-800:    #1e293b;
  --gray-700:    #334155;
  --gray-600:    #475569;
  --gray-500:    #64748b;
  --gray-400:    #94a3b8;
  --gray-300:    #cbd5e1;
  --gray-200:    #e2e8f0;
  --gray-100:    #f1f5f9;
  --gray-50:     #f8fafc;
  --white:       #ffffff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: #f1f5f9;
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header & Top Bar */
.site-header {
  background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-800) 100%);
  color: var(--white);
  padding: 24px 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  border-bottom: 3px solid var(--success-500);
}

.header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.school-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.school-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.school-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  font-weight: 600;
  margin-bottom: 2px;
}

.election-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Badges de Status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.badge-success::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-500);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: var(--warning-50);
  color: var(--warning-600);
  border: 1px solid #fde68a;
}

.badge-danger {
  background: var(--danger-50);
  color: var(--danger-600);
  border: 1px solid #fecaca;
}

/* Layout Principal */
.main-wrapper {
  max-width: 1180px;
  width: 100%;
  margin: 30px auto;
  padding: 0 20px;
  flex: 1;
}

/* Capa Oficial de Entrada (Hero Cover) */
.hero-cover-section {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.3), 0 0 30px rgba(37, 99, 235, 0.25);
  border: 2px solid #2563eb;
  background: #060e22;
  text-align: center;
}

.hero-cover-banner {
  width: 100%;
  display: block;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  margin: 0 auto;
}

.hero-cover-btn-bar {
  background: linear-gradient(180deg, rgba(6, 14, 34, 0.8) 0%, #060e22 100%);
  padding: 16px 20px 22px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-votar-hero {
  background: linear-gradient(135deg, #0095ff 0%, #0052cc 100%);
  color: #ffffff;
  padding: 14px 38px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 0 25px rgba(0, 149, 255, 0.75), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #60a5fa;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  cursor: pointer;
}

.btn-votar-hero:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 35px rgba(0, 195, 255, 0.95), inset 0 1px 3px rgba(255, 255, 255, 0.7);
  filter: brightness(1.1);
}

.btn-votar-hero svg {
  width: 26px;
  height: 26px;
}

/* Banner de Aviso de Identidade e Voto Secreto */
.identity-disclaimer {
  background: #ffffff;
  border-left: 4px solid var(--primary-600);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.disclaimer-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--primary-600);
  margin-top: 2px;
}

.disclaimer-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-900);
  margin-bottom: 4px;
}

.disclaimer-content p {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Seção: Formulário de Identificação do Aluno */
.voter-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 14px;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--primary-600);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
}

.step-desc {
  font-size: 13px;
  color: var(--gray-500);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-900);
  background-color: var(--white);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control.is-invalid {
  border-color: var(--danger-500);
  background-color: #fffaf0;
}

.field-error {
  font-size: 12px;
  color: var(--danger-500);
  display: none;
  font-weight: 500;
}

.field-error.show {
  display: block;
}

.input-hint {
  font-size: 11px;
  color: var(--gray-500);
}

/* Seção: Escolha das Chapas (Cards Compactos) */
.chapas-section {
  margin-bottom: 30px;
}

.chapas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 15px;
}

/* Card Compacto da Chapa */
.chapa-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px 14px;
  gap: 14px;
  position: relative;
}

.chapa-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-500);
}

.chapa-card.selected {
  border-color: var(--success-500);
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.chapa-card-thumb {
  width: 75px;
  height: 75px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  border: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chapa-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapa-card-content {
  flex: 1;
  min-width: 0;
}

.chapa-number-tag {
  display: inline-block;
  background: var(--primary-800);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.chapa-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.25;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapa-card-slogan {
  font-size: 12px;
  color: var(--primary-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.chapa-select-btn {
  background: var(--success-600);
  color: white;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.chapa-select-btn:hover {
  background: var(--success-500);
}

.chapa-radio-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.chapa-card:hover .chapa-radio-circle {
  border-color: var(--primary-500);
}

.chapa-card.selected .chapa-radio-circle {
  border-color: var(--success-500);
  background: var(--success-500);
  color: white;
}

.chapa-radio-circle::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  display: none;
}

.chapa-card.selected .chapa-radio-circle::after {
  display: block;
}

.chapa-summary {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.chapa-card-footer {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.btn-details {
  background: var(--gray-100);
  color: var(--primary-700);
  border: 1px solid var(--gray-300);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  flex: 1;
  justify-content: center;
}

.btn-details:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
}

.btn-vote-select {
  background: var(--primary-600);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  flex: 1.2;
  text-align: center;
}

.chapa-card.selected .btn-vote-select {
  background: var(--success-600);
}

.btn-vote-select:hover {
  filter: brightness(1.1);
}

/* Opção de Voto em Branco */
.blank-vote-card {
  background: var(--white);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.blank-vote-card:hover {
  border-color: var(--gray-500);
  background: var(--gray-50);
}

.blank-vote-card.selected {
  border-color: var(--gray-700);
  background: #f1f5f9;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}

.blank-vote-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blank-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  font-weight: bold;
}

/* Barra de Ação Flutuante / Botão de Revisão */
.vote-action-bar {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-top: 25px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border: 1px solid var(--gray-200);
}

.selected-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-preview-text {
  font-size: 14px;
  color: var(--gray-600);
}

.selected-preview-name {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 16px;
}

.btn-proceed-review {
  background: var(--success-600);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-proceed-review:hover:not(:disabled) {
  background: var(--success-500);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-proceed-review:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  color: var(--gray-500);
}

/* Modais (Revisão e Detalhes da Chapa) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-900);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-400);
  transition: color 0.2s;
  padding: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--gray-800);
}

.modal-body {
  padding: 24px;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}

.modal-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Modal de Revisão do Voto */
.review-highlight {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.review-chapa-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-800);
}

.review-chapa-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 4px;
}

.review-summary-list {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.review-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-200);
}

.review-item:last-child {
  border-bottom: none;
}

.review-label {
  color: var(--gray-500);
}

.review-val {
  font-weight: 600;
  color: var(--gray-800);
}

.btn-confirm-vote {
  background: var(--success-600);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-confirm-vote:hover:not(:disabled) {
  background: var(--success-500);
}

.btn-back {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Sucesso do Voto / Comprovante */
.receipt-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 620px;
  margin: 30px auto;
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  border-top: 6px solid var(--success-500);
}

.receipt-icon {
  width: 72px;
  height: 72px;
  background: #d1fae5;
  color: var(--success-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin: 0 auto 20px auto;
}

.receipt-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.receipt-code-box {
  background: var(--gray-50);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
}

.receipt-code {
  font-family: monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-800);
  letter-spacing: 0.1em;
}

/* Alertas & Toasts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: currentColor;
  opacity: 0.6;
}

.alert-close:hover {
  opacity: 1;
}

/* Footer Público */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 24px 0;
  margin-top: auto;
  font-size: 13px;
  color: var(--gray-500);
  text-align: center;
}

.footer-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-link {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Animações */
.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

/* Responsividade Mobile */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .chapas-grid {
    grid-template-columns: 1fr;
  }
  .vote-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-proceed-review {
    width: 100%;
    justify-content: center;
  }
}
