/* Validador de PDF assinado — page-specific styles */

/* Garante que o atributo [hidden] sempre oculte o elemento, mesmo quando
   a regra do componente define display: flex (que venceria o display:none
   padrão do navegador). */
[hidden] { display: none !important; }

/* ─── Body layout ───────────────────────────────────────── */
.validador-body { padding: 56px 0 96px; }

.validador-wrap {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── Upload card ───────────────────────────────────────── */
.validador-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}

/* ─── Dropzone ──────────────────────────────────────────── */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 220px;
  padding: 32px 24px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.dropzone:hover { border-color: var(--blue); background: var(--blue-light); }
.dropzone.dragover {
  border-color: var(--blue);
  background: var(--blue-light);
  transform: scale(1.01);
}
.dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  margin-bottom: 4px;
  transition: background 0.2s, color 0.2s;
}
.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon { background: var(--blue); color: white; }
.dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}
.dropzone-title span { color: var(--blue); }
.dropzone-hint { font-size: 12px; font-weight: 500; color: var(--gray); }

/* ─── Selected file card ────────────────────────────────── */
.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}
.file-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fee2e2;
  color: #dc2626;
  flex-shrink: 0;
}
.file-card-info { flex: 1; min-width: 0; }
.file-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-card-size { font-size: 12px; color: var(--gray); font-weight: 500; margin-top: 2px; }
.file-card-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gray);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.file-card-remove:hover { background: #fee2e2; color: #dc2626; }

/* ─── Inline form error ─────────────────────────────────── */
.validador-error {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

/* ─── Submit button ─────────────────────────────────────── */
.btn-validar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--green);
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(34,197,94,0.32);
}
.btn-validar:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(34,197,94,0.42);
}
.btn-validar:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-validar.is-loading { cursor: progress; }

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.45);
  border-top-color: white;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ─── reCAPTCHA note ────────────────────────────────────── */
.validador-recaptcha-note {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
  color: var(--gray);
}
.validador-recaptcha-note a { color: var(--blue); font-weight: 600; }
.validador-recaptcha-note a:hover { text-decoration: underline; }

/* ─── Result card ───────────────────────────────────────── */
.result-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  border-top: 4px solid var(--border);
  animation: fadeUp 0.45s ease both;
}
.result-card.is-success { border-top-color: var(--green); }
.result-card.is-error { border-top-color: #dc2626; }
.result-card.is-warn { border-top-color: #f59e0b; }

.result-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.result-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 24px;
}
.result-card.is-success .result-badge { background: #dcfce7; color: var(--green-dark); }
.result-card.is-error .result-badge { background: #fee2e2; color: #dc2626; }
.result-card.is-warn .result-badge { background: #fef3c7; color: #d97706; }
.result-title { font-size: 18px; font-weight: 800; color: var(--dark); letter-spacing: -0.3px; }
.result-subtitle { font-size: 13px; color: var(--gray); font-weight: 500; margin-top: 2px; }

/* ─── Features ──────────────────────────────────────────── */
.validador-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.validador-feature {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
}
.validador-feature-icon { font-size: 26px; margin-bottom: 10px; }
.validador-feature-title { font-size: 13px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.validador-feature-text { font-size: 12px; color: var(--gray); line-height: 1.55; }

/* ─── Tela de sucesso (comprovante de validação) ────────── */
.validacao-card {
  border: 1.5px solid #86efac;
  border-top: 1.5px solid #86efac;
  padding: 24px 36px 36px;
}

.validacao-actions {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-bottom: 12px;
}
.validacao-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: color 0.2s;
}
.validacao-link svg { width: 15px; height: 15px; }
.validacao-link:hover { color: var(--blue-dark); text-decoration: underline; }

.validacao-head { text-align: center; padding: 12px 0 4px; }
.validacao-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--green-dark);
  margin-bottom: 16px;
}
.validacao-seal svg { width: 28px; height: 28px; }
.validacao-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.validacao-date { font-size: 13px; font-weight: 600; color: var(--gray); line-height: 1.5; }

.validacao-divider { height: 1px; background: var(--border); margin: 26px 0; }

.validacao-file-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}
.validacao-file-hash {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.7;
  word-break: break-all;
}
.validacao-file-hash span { font-family: monospace; color: #475569; }

.validacao-checks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 26px;
}
.validacao-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}
.validacao-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--green-dark);
  flex-shrink: 0;
  margin-top: 1px;
}
.validacao-check-icon svg { width: 12px; height: 12px; }

/* ─── Impressão — gera um comprovante limpo ─────────────── */
@media print {
  #navbar, .mobile-menu, .mobile-menu-overlay, footer,
  .legal-hero, .validador-card, .validador-features,
  .validacao-actions { display: none !important; }
  body { background: #fff; }
  .validador-body { padding: 0; }
  .validacao-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    animation: none;
  }
  .grecaptcha-badge {
    box-shadow: none !important;
  }
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .validador-body { padding: 40px 0 72px; }
  .validador-card { padding: 22px; }
  .result-card { padding: 24px 22px; }
  .validador-features { grid-template-columns: 1fr; }
  .validacao-card { padding: 22px 22px 28px; }
  .validacao-actions { gap: 16px; }
  .validacao-title { font-size: 21px; }
}
