/* ==============================================================================
 * FUNDAT Certificados - Estilo Oficial de Referência (v4.1)
 * Identidade Visual Oficial: Prefeitura de Aracaju & FUNDAT
 * ============================================================================== */

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

:root {
  /* Paleta Iluminada e Vibrante da Marca */
  --c-hero-dark: #00465c;
  --c-hero-mid: #006585;
  --c-hero-light: #0082a6;
  --c-hero-cyan: #12afc8;

  --c-primary: #006283;
  --c-primary-dark: #004b64;
  --c-primary-light: #e6f4f8;

  --c-laranja: #f58634;
  --c-laranja-hover: #e0721f;

  --c-amarelo: #ffc82a;

  /* Superfícies e Textos */
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --text-title: #102a38;
  --text-body: #3c5666;
  --text-muted: #5e7989;
  --text-light: #94abb8;
  --border-card: #e1edf2;

  /* Sombras e Efeitos */
  --shadow-card: 0 16px 36px rgba(0, 60, 85, 0.07), 0 4px 10px rgba(0, 60, 85, 0.03);
  --shadow-card-hover: 0 24px 48px rgba(0, 60, 85, 0.12), 0 0 25px rgba(18, 175, 200, 0.22);
  --shadow-btn: 0 6px 18px rgba(245, 134, 52, 0.35);

  --radius-card: 22px;
  --radius-pill: 9999px;
  --transition: 0.25s ease;
}

*, *::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-page);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
 * Header & Top Navbar (Hero Section Iluminado)
 * ============================================================================== */

.app-header {
  background: radial-gradient(circle at 50% 45%, #0084a8 0%, #006585 50%, #004157 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  padding-bottom: 8rem;
}

.top-navbar {
  background: rgba(0, 40, 55, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.top-navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar-brand-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  text-decoration: none;
}

.nav-logo-fundat {
  height: 72px;
  max-height: 82px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: transform var(--transition);
  margin-right: -2px;
}

.nav-logo-divider {
  width: 1.5px;
  height: 54px;
  background-color: rgba(255, 255, 255, 0.6);
  display: inline-block;
  border-radius: 0;
  flex-shrink: 0;
}

.nav-logo-aracaju {
  height: 76px;
  max-height: 86px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: transform var(--transition);
}

.navbar-brand-group:hover .nav-logo-fundat,
.navbar-brand-group:hover .nav-logo-aracaju {
  transform: scale(1.03);
}

.nav-spacer {
  width: 120px;
}

.nav-back-wrapper {
  width: 120px;
  display: flex;
  justify-content: flex-start;
}

.btn-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-nav-back:hover {
  background: var(--c-hero-cyan);
  border-color: var(--c-hero-cyan);
  color: #ffffff;
  text-decoration: none;
  transform: translateX(-3px);
  box-shadow: 0 4px 14px rgba(18, 175, 200, 0.4);
}

.header-hero {
  text-align: center;
  padding: 2.75rem 1.5rem 1.25rem;
  max-width: 800px;
  margin: 0 auto;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(0, 35, 48, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.42rem 1.35rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.header-badge i {
  font-size: 0.85rem;
  color: var(--c-hero-cyan);
}

.header-title {
  font-size: 2.55rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 45, 60, 0.2);
}

.header-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* ==============================================================================
 * Main Layout & Sobreposição de Cards com Gradiente
 * ============================================================================== */

.app-main {
  flex: 1;
  background: var(--bg-page);
  padding: 0 1.5rem 5rem;
  position: relative;
  z-index: 5;
}

.container-custom {
  max-width: 980px;
  margin: 0 auto;
}

/* ==============================================================================
 * Portal Selection Grid (index.php)
 * ============================================================================== */

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: -5rem; /* Efeito de sobreposição elegante */
}

.portal-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 3.25rem 2.25rem 2.75rem;
  border: 1.5px solid var(--border-card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

/* Linha Superior com Gradiente no Hover */
.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-hero-cyan), var(--c-laranja));
  opacity: 0;
  transition: opacity var(--transition);
}

.portal-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--c-hero-cyan);
  text-decoration: none;
  color: var(--text-body);
}

.portal-card:hover::before {
  opacity: 1;
}

.portal-icon-wrapper {
  width: 82px;
  height: 82px;
  border-radius: var(--radius-pill);
  background: var(--c-primary-light);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  margin-bottom: 1.75rem;
  transition: all var(--transition);
  border: 1px solid rgba(18, 175, 200, 0.15);
}

.portal-card:hover .portal-icon-wrapper {
  transform: scale(1.08);
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-hero-cyan) 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(0, 98, 131, 0.28);
}

.portal-title {
  font-size: 1.48rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-title);
}

.portal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.portal-action {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--c-primary);
  transition: all var(--transition);
}

.portal-card:hover .portal-action {
  color: var(--c-laranja);
  transform: translateX(4px);
}

/* ==============================================================================
 * Tabs & Interactive Form Panels (aluno.php / instrutor.php)
 * ============================================================================== */

.tabs-container {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-top: -5rem;
  position: relative;
}

.tabs-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-hero-cyan), var(--c-laranja));
}

.tabs-nav {
  display: flex;
  background: #f4f8fa;
  padding: 0.65rem;
  border-bottom: 1.5px solid var(--border-card);
  gap: 0.65rem;
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.25rem;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--c-primary);
  background: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--c-primary);
  box-shadow: 0 4px 12px rgba(0, 40, 55, 0.08);
}

.tab-btn.active i {
  color: var(--c-laranja);
}

.tab-pane {
  display: none;
  padding: 2.75rem 2.5rem;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}

.form-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 0.35rem;
}

.form-section-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ==============================================================================
 * Inputs & Form Controls
 * ============================================================================== */

.form-group-custom {
  margin-bottom: 1.5rem;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--text-light);
  font-size: 1.15rem;
  pointer-events: none;
  transition: color var(--transition);
}

.form-control-custom {
  width: 100%;
  padding: 1.05rem 1rem 1.05rem 3.25rem;
  font-size: 1.025rem;
  font-family: inherit;
  border: 1.5px solid var(--border-card);
  border-radius: 12px;
  background-color: #fafcfe;
  color: var(--text-title);
  font-weight: 500;
  transition: all var(--transition);
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--c-hero-cyan);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(18, 175, 200, 0.16);
}

.form-control-custom:focus + .input-icon,
.input-icon-wrapper:focus-within .input-icon {
  color: var(--c-primary);
}

.btn-toggle-eye {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-light);
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.15rem;
  transition: color var(--transition);
}

.btn-toggle-eye:hover {
  color: var(--c-laranja);
}

/* ==============================================================================
 * Buttons
 * ============================================================================== */

.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 1.05rem 1.75rem;
  font-size: 1.025rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--c-laranja) 0%, var(--c-laranja-hover) 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all var(--transition);
}

.btn-primary-custom:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 134, 52, 0.45);
  background: linear-gradient(135deg, #ff9345 0%, var(--c-laranja) 100%);
}

.btn-primary-custom:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-primary-custom:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-secondary-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--c-primary);
  background: #ffffff;
  color: var(--c-primary);
  text-decoration: none;
  transition: all var(--transition);
}

.btn-secondary-custom:hover {
  background: var(--c-primary);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 98, 131, 0.2);
}

/* ==============================================================================
 * Results & Verification Cards
 * ============================================================================== */

.result-area {
  margin-top: 2.25rem;
}

.result-card {
  background: #ffffff;
  border-radius: var(--radius-card);
  border: 1.5px solid var(--border-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 2rem;
}

.result-header {
  padding: 1.75rem 2rem;
  background: #fafcfe;
  border-bottom: 1.5px solid var(--border-card);
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.result-header.valid {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-bottom-color: #a7f3d0;
}

.result-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.result-icon-badge.success {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(5, 150, 105, 0.3);
}

.result-icon-badge.info {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-hero-cyan) 100%);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 98, 131, 0.25);
}

.result-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 0.2rem;
}

.result-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.result-body {
  padding: 2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.info-item.full-width {
  grid-column: 1 / -1;
}

.info-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
}

.info-value {
  font-size: 1.025rem;
  font-weight: 600;
  color: var(--text-title);
}

.info-value.highlight {
  font-size: 1.25rem;
  color: var(--c-primary);
  font-weight: 800;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.font-bold {
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
}

.badge-success {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-danger {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.result-footer {
  padding: 1.5rem 2rem;
  background: #f8fafc;
  border-top: 1.5px solid var(--border-card);
  display: flex;
  justify-content: center;
}

/* Certificate List */
.list-instruction {
  font-size: 0.96rem;
  color: var(--text-muted);
  margin-bottom: 1.35rem;
  font-weight: 600;
}

.certificate-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.certificate-item-card {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border: 1.5px solid var(--border-card);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-body);
  transition: all var(--transition);
  gap: 1.25rem;
}

.certificate-item-card:hover {
  border-color: var(--c-hero-cyan);
  background-color: var(--c-primary-light);
  transform: translateX(4px);
  text-decoration: none;
  color: var(--text-body);
  box-shadow: 0 8px 18px rgba(0, 98, 131, 0.08);
}

.cert-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fee2e2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.cert-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cert-item-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-title);
}

.cert-item-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-download-badge {
  display: inline-flex;
  align-items: center;
  background: var(--c-primary);
  color: #ffffff;
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.certificate-item-card:hover .btn-download-badge {
  background: var(--c-laranja);
  box-shadow: 0 4px 10px rgba(245, 134, 52, 0.35);
}

/* ==============================================================================
 * Alerts & Feedbacks
 * ============================================================================== */

.alert {
  padding: 1rem 1.35rem;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-info {
  background-color: var(--c-primary-light);
  border: 1px solid var(--c-hero-cyan);
  color: var(--c-primary);
}

/* ==============================================================================
 * Footer (Iluminado e Alinhado à Marca)
 * ============================================================================== */

.app-footer {
  margin-top: auto;
  background: linear-gradient(135deg, #004358 0%, #006079 50%, #003c4e 100%);
  color: rgba(255, 255, 255, 0.85);
  padding: 2.25rem 2rem;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer-info {
  text-align: center;
}

.footer-title {
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}

.footer-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.footer-logo {
  max-height: 52px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: transform var(--transition);
}

.footer-logo:hover {
  transform: scale(1.03);
}

/* ==============================================================================
 * Animations & Helpers
 * ============================================================================== */

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

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.d-none {
  display: none !important;
}

.spinner {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==============================================================================
 * Responsividade (Mobile / Tablet)
 * ============================================================================== */

@media (max-width: 768px) {
  .top-navbar-container {
    padding: 0.85rem 1rem;
  }
  .navbar-brand-group {
    gap: 0.85rem;
  }
  .nav-logo-fundat {
    height: 38px;
  }
  .nav-logo-divider {
    height: 28px;
  }
  .nav-logo-aracaju {
    height: 40px;
  }
  .nav-spacer, .nav-back-wrapper {
    width: auto;
  }
  .header-hero {
    padding: 2rem 1rem 0.5rem;
  }
  .header-title {
    font-size: 1.75rem;
  }
  .header-subtitle {
    font-size: 0.95rem;
  }
  .portal-grid {
    grid-template-columns: 1fr;
    margin-top: -3.5rem;
  }
  .tabs-container {
    margin-top: -3.5rem;
  }
  .tab-pane {
    padding: 1.75rem 1.25rem;
  }
  .footer-container {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.25rem;
  }
  .footer-info {
    text-align: center;
  }
  .certificate-item-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-download-badge {
    width: 100%;
    justify-content: center;
  }
}

/* ==============================================================================
 * Botão Flutuante do WhatsApp (Fundatinho)
 * ============================================================================== */

.btn-floating-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-floating-whatsapp:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.6);
  color: #ffffff;
}

.whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: #111b21;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.whatsapp-tooltip small {
  font-size: 11px;
  font-weight: 400;
  color: #25D366;
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent transparent #111b21;
}

.btn-floating-whatsapp:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* ==============================================================================
 * Widget Flutuante de Acessibilidade
 * ============================================================================== */

.accessibility-widget-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9995;
}

.btn-floating-accessibility {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #006283;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 98, 131, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.btn-floating-accessibility:hover,
.btn-floating-accessibility:focus-visible {
  transform: translateY(-3px) scale(1.06);
  background: #004b64;
  box-shadow: 0 8px 24px rgba(0, 98, 131, 0.55);
}

/* Painel de Acessibilidade */
.accessibility-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 45, 65, 0.22), 0 0 0 1px rgba(0, 98, 131, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.accessibility-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.accessibility-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #006283, #004b64);
  color: #ffffff;
}

.accessibility-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.btn-access-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-access-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.accessibility-panel-body {
  padding: 16px;
  max-height: 480px;
  overflow-y: auto;
}

.access-group {
  margin-bottom: 14px;
}

.access-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #5e7989;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.access-font-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f7fa;
  padding: 6px 10px;
  border-radius: 12px;
}

.btn-access-action {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d4e4eb;
  background: #ffffff;
  color: #006283;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-access-action:hover {
  background: #006283;
  color: #ffffff;
  border-color: #006283;
}

.access-font-indicator {
  font-size: 13px;
  font-weight: 800;
  color: #006283;
  min-width: 45px;
  text-align: center;
}

.access-grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-access-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-access-toggle i {
  font-size: 16px;
  color: #006283;
  transition: transform 0.2s;
}

.btn-access-toggle:hover {
  background: #eef6f9;
  border-color: #006283;
  color: #006283;
}

.btn-access-toggle.active {
  background: #006283;
  border-color: #006283;
  color: #ffffff;
}

.btn-access-toggle.active i {
  color: #ffc82a;
}

.access-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2f5;
}

.btn-access-reset {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px dashed #cbd5e1;
  background: transparent;
  color: #64748b;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-access-reset:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* ==============================================================================
 * Classes Dinâmicas de Acessibilidade (Aplicadas no Body / HTML)
 * ============================================================================== */

/* 1. Alto Contraste */
body.access-contrast {
  background-color: #000000 !important;
  color: #ffffff !important;
}

body.access-contrast .app-header {
  background: #000000 !important;
  border-bottom: 3px solid #ffff00 !important;
}

body.access-contrast .portal-card,
body.access-contrast .tab-pane,
body.access-contrast .app-footer,
body.access-contrast .certificate-item-card,
body.access-contrast .accessibility-panel {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.access-contrast h1,
body.access-contrast h2,
body.access-contrast h3,
body.access-contrast .portal-title,
body.access-contrast .header-title,
body.access-contrast .access-group-label {
  color: #ffff00 !important;
}

body.access-contrast p,
body.access-contrast span,
body.access-contrast label,
body.access-contrast .portal-desc,
body.access-contrast .footer-title,
body.access-contrast .footer-sub {
  color: #ffffff !important;
}

body.access-contrast .form-input {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffffff !important;
}

body.access-contrast .btn-primary,
body.access-contrast .btn-portal-action,
body.access-contrast .btn-download-badge {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 800 !important;
  border: 2px solid #ffffff !important;
}

/* 2. Modo Escuro */
body.access-dark {
  background-color: #0b1320 !important;
  color: #e2e8f0 !important;
}

body.access-dark .app-header {
  background: linear-gradient(180deg, #070d17 0%, #0b1320 100%) !important;
}

body.access-dark .portal-card,
body.access-dark .tab-pane,
body.access-dark .app-footer,
body.access-dark .certificate-item-card,
body.access-dark .accessibility-panel {
  background: #131f33 !important;
  border-color: #233550 !important;
  color: #e2e8f0 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

body.access-dark .portal-title,
body.access-dark .form-label,
body.access-dark .portal-header-box h2 {
  color: #f8fafc !important;
}

body.access-dark .portal-desc,
body.access-dark .portal-header-box p {
  color: #94a3b8 !important;
}

body.access-dark .form-input {
  background: #0d1624 !important;
  border-color: #233550 !important;
  color: #f8fafc !important;
}

body.access-dark .access-font-controls {
  background: #0d1624 !important;
}

body.access-dark .btn-access-action {
  background: #1a2a44 !important;
  border-color: #2e456d !important;
  color: #93c5fd !important;
}

body.access-dark .btn-access-toggle {
  background: #0d1624 !important;
  border-color: #233550 !important;
  color: #cbd5e1 !important;
}

body.access-dark .btn-access-toggle i {
  color: #38bdf8 !important;
}

/* 3. Escala de Cinza */
body.access-grayscale {
  filter: grayscale(100%) !important;
}

/* 4. Inversão de Cores */
body.access-invert {
  filter: invert(100%) hue-rotate(180deg) !important;
}

body.access-invert img,
body.access-invert video,
body.access-invert .btn-floating-whatsapp,
body.access-invert [vw] {
  filter: invert(100%) hue-rotate(180deg) !important;
}

/* 5. Fonte Amigável para Dislexia */
body.access-dyslexic,
body.access-dyslexic * {
  font-family: 'Comic Sans MS', 'Trebuchet MS', 'Arial', sans-serif !important;
  letter-spacing: 0.05em !important;
  word-spacing: 0.1em !important;
}

/* 6. Destacar Links */
body.access-links a {
  text-decoration: underline 3px #f58634 !important;
  text-underline-offset: 4px !important;
  font-weight: 700 !important;
}

/* 7. Espaçamento Ampliado */
body.access-line-spacing p,
body.access-line-spacing span,
body.access-line-spacing a,
body.access-line-spacing label {
  line-height: 2 !important;
  letter-spacing: 0.08em !important;
}

/* 8. Cursor Grande */
body.access-cursor,
body.access-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 32 32'%3E%3Cpath fill='%23FFCC00' stroke='%23000000' stroke-width='2' stroke-linejoin='round' d='M4 2 L4 28 L11 21 L16 30 L20 28 L15 19 L24 19 Z'/%3E%3C/svg%3E") 4 2, default !important;
}

body.access-cursor a,
body.access-cursor button,
body.access-cursor input,
body.access-cursor select,
body.access-cursor textarea,
body.access-cursor label,
body.access-cursor [role="button"],
body.access-cursor [role="tab"],
body.access-cursor .portal-card,
body.access-cursor .btn-floating-whatsapp,
body.access-cursor .btn-floating-accessibility {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 32 32'%3E%3Cpath fill='%23FFD700' stroke='%23000000' stroke-width='2' stroke-linejoin='round' d='M4 2 L4 28 L11 21 L16 30 L20 28 L15 19 L24 19 Z'/%3E%3Ccircle cx='4' cy='2' r='2' fill='%23006283'/%3E%3C/svg%3E") 4 2, pointer !important;
}

/* Ajuste Mobile para os botões flutuantes */
@media (max-width: 768px) {
  .btn-floating-whatsapp {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
    font-size: 28px;
  }
  .accessibility-widget-wrapper {
    bottom: 16px;
    left: 16px;
  }
  .btn-floating-accessibility {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }
  .accessibility-panel {
    width: calc(100vw - 32px);
    left: 0;
    max-height: 70vh;
  }
  .whatsapp-tooltip {
    display: none;
  }
}

