/**
 * ESTILOS DO CADASTRO ESCOLAR 2027 - EDUCAÇÃO INFANTIL
 * Município de Campos Gerais - MG
 * Identidade Visual Baseada no Padrão Municipal de Saúde (saude-versao-0.1)
 * Mobile-First, Responsivo, Acessível e Otimizado para Impressão
 */

:root {
  --primary: #1e3a8a;          /* Azul Naval Municipal */
  --primary-hover: #172554;
  --primary-light: #eff6ff;
  --secondary: #059669;        /* Verde Institucional */
  --secondary-hover: #047857;
  --accent: #0284c7;           /* Ciano / Azul Céu */
  --dark: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 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.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------
 * CABEÇALHO MUNICIPAL E AVISO DO PERÍODO
 * ------------------------------------------------------------- */
.header-municipal {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  padding: 1.25rem 1rem;
  border-bottom: 4px solid var(--secondary);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.header-brasao {
  width: 50px;
  height: 50px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.header-brasao svg {
  width: 38px;
  height: 38px;
}

.header-titulos h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-titulos p {
  font-size: 0.8125rem;
  opacity: 0.9;
  font-weight: 400;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-link-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.header-link-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Barra de Destaque do Período Oficial */
.banner-periodo {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-align: center;
}

.banner-periodo strong {
  color: #78350f;
  font-weight: 700;
}

.container {
  max-width: 1000px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

/* -------------------------------------------------------------
 * BARRA DE PROGRESSO EM ETAPAS (WIZARD)
 * ------------------------------------------------------------- */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2rem;
  background: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 80px;
  position: relative;
  z-index: 2;
  cursor: default;
}

.wizard-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  transition: all 0.2s ease;
}

.wizard-step.active .wizard-step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.15);
}

.wizard-step.completed .wizard-step-circle {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #ffffff;
}

.wizard-step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.wizard-step.active .wizard-step-title {
  color: var(--primary);
  font-weight: 700;
}

/* -------------------------------------------------------------
 * CARDS E PAINÉIS
 * ------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2, .card-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.5rem 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* -------------------------------------------------------------
 * FORMULÁRIOS E INPUTS
 * ------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 12; }
.col-6 { grid-column: span 12; }
.col-4 { grid-column: span 12; }
.col-2 { grid-column: span 12; }
.col-3 { grid-column: span 12; }

@media (min-width: 768px) {
  .col-8 { grid-column: span 8; }
  .col-6 { grid-column: span 6; }
  .col-4 { grid-column: span 4; }
  .col-2 { grid-column: span 2; }
  .col-3 { grid-column: span 3; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-label.required::after {
  content: "*";
  color: var(--danger);
  margin-left: 2px;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-main);
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.form-help {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.form-feedback {
  font-size: 0.8125rem;
  color: var(--danger);
}

/* Radio & Checkbox Cards */
.radio-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .radio-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.radio-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.radio-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.radio-card input[type="radio"]:checked + .radio-card-content,
.radio-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* -------------------------------------------------------------
 * BOTÕES
 * ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

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

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-success {
  background-color: var(--secondary);
  color: #ffffff;
}

.btn-success:hover {
  background-color: var(--secondary-hover);
}

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

.btn-outline:hover {
  background: #f1f5f9;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* -------------------------------------------------------------
 * ALERTAS E AVISOS
 * ------------------------------------------------------------- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert-info {
  background: var(--info-bg);
  border-color: #bae6fd;
  color: #0369a1;
}

.alert-warning {
  background: var(--warning-bg);
  border-color: #fde68a;
  color: #92400e;
}

.alert-zoneamento {
  display: block;
  overflow-wrap: anywhere;
}

.alert-zoneamento > strong {
  display: block;
  margin-bottom: 0.35rem;
}

.alert-zoneamento p {
  max-width: 72ch;
  margin: 0;
}

.alert-danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: #991b1b;
}

.alert-success {
  background: var(--success-bg);
  border-color: #bbf7d0;
  color: #166534;
}

/* -------------------------------------------------------------
 * TABELAS DO PAINEL ADMINISTRATIVO
 * ------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-admin {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.table-admin th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-admin td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

/* Badges de Status */
.badge-status {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-status.pendente {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge-status.documentos_validados {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.badge-status.vaga_homologada {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.badge-status.lista_espera {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.badge-status.indeferido {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* -------------------------------------------------------------
 * COMPROVANTE OFICIAL E IMPRESSÃO
 * ------------------------------------------------------------- */
.comprovante-wrapper {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius);
  padding: 2rem;
  margin: 1.5rem 0;
}

.comprovante-header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.protocolo-destaque {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  background: #f1f5f9;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  display: inline-block;
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }

  .header-municipal,
  .banner-periodo,
  .wizard-steps,
  .btn,
  .no-print {
    display: none !important;
  }

  .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .comprovante-wrapper {
    border: 1px solid #000000;
    padding: 1.5rem;
    box-shadow: none;
  }
}
