/* =====================================================================
   ESTILOS INSTITUCIONAIS: ENCONTRO DAS BOMBEIRAS MILITARES — CBMDF
   Paleta: Vinho (#7a1532), Dourado (#c59b27), Branco e Tons Suaves
   ===================================================================== */

:root {
  --vinho: #7a1532;
  --vinho-dark: #580d21;
  --vinho-deep: #3b0917;
  --vinho-light: #fdf5f7;
  --vinho-badge: #fcecef;
  --dourado: #c59b27;
  --dourado-dark: #997514;
  --dourado-light: #fbf4e2;
  --bg-main: #faf7f8;
  --text-main: #261c1e;
  --text-muted: #5e5254;
  --border-card: #ecdfe1;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Cabeçalho */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0.75rem 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.brand-sub {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dourado-dark);
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--vinho);
  line-height: 1.2;
}

/* Hero Section */
.hero {
  background: linear-gradient(180deg, var(--vinho-dark) 0%, var(--vinho) 50%, #8b1836 100%);
  color: #ffffff;
  padding: 3rem 1rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #f5d98b;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  font-weight: 300;
  color: #fbebee;
  max-width: 650px;
  margin: 0 auto 2rem;
}

.hero-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.hero-badge-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--dourado);
  color: var(--vinho-deep);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.95rem 2rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #d8ab2e;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Card Apresentação Objetivo */
.card-objective {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid var(--border-card);
  padding: 1.75rem;
  margin-top: -2.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.card-objective img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 0.75rem;
  background: var(--vinho-light);
  padding: 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  flex-shrink: 0;
}

/* Banner de Aviso Simultâneo */
.banner-alert {
  background: linear-gradient(90deg, #fbf4e2 0%, #faedd0 100%);
  border-left: 4px solid var(--dourado);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem auto 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.banner-alert-icon {
  width: 24px;
  height: 24px;
  color: var(--dourado-dark);
  flex-shrink: 0;
}

.banner-alert h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: #7a5c0b;
}

.banner-alert p {
  font-size: 1rem;
  font-weight: 700;
  color: #523d04;
  margin-top: 0.15rem;
}

/* Grade de Oficinas */
.section-workshops {
  padding: 3.5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header .tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dourado-dark);
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--vinho);
  margin-top: 0.25rem;
}

.workshops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.workshop-card {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid var(--border-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.workshop-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

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

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.badge-responsible {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  background: var(--vinho-light);
  color: var(--vinho);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge-vacancies {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: #d1fae5;
  color: #065f46;
}

.badge-full {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: #fee2e2;
  color: #991b1b;
}

.workshop-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.workshop-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.workshop-meta {
  border-top: 1px solid #f3ecee;
  padding-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.workshop-card-footer {
  padding: 1rem 1.5rem;
  background: #fdfbfb;
  border-top: 1px solid #f3ecee;
}

.btn-card {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center;
}

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

.btn-enroll:hover {
  background: var(--vinho-dark);
}

.btn-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Modais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 1.25rem;
  max-width: 550px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.2s ease-out;
  margin: auto;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  background: var(--vinho);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header.success {
  background: #047857;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
}

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

.modal-body {
  padding: 1.5rem;
}

/* Formulário de Inscrição */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-label .req {
  color: #dc2626;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  outline: none;
  transition: border-color 0.2s;
  background-color: #ffffff;
}

.form-control:focus {
  border-color: var(--vinho);
  box-shadow: 0 0 0 3px rgba(122, 21, 50, 0.15);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

/* Comprovante */
.receipt-protocol-box {
  background: #fdfbf5;
  border: 2px dashed var(--dourado);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.receipt-protocol {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--vinho);
  letter-spacing: 0.05em;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f3ecee;
  font-size: 0.875rem;
}

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

.receipt-row .val {
  font-weight: 700;
  text-align: right;
}

/* Rodapé */
.footer {
  background: #ffffff;
  border-top: 1px solid var(--border-card);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-links a, .footer-links button {
  color: inherit;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.footer-links a:hover, .footer-links button:hover {
  color: var(--vinho);
}

/* Regras Especiais de Impressão */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .modal-dialog {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
  }
  @page {
    margin: 1.5cm;
    size: A4 portrait;
  }
}

/* Responsividade Mobile */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.75rem;
  }
  .card-objective {
    flex-direction: column;
    text-align: center;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
