/* style.css — versão moderna, clean e profissional
   + ajustes para finalizado e utilitários + painel admin
*/

:root {
  --brand: #D50425;
  --brand-light: #e43a4a;
  --brand-dark: #b4001c;
  --secondary: #1f2d3d;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #111;
  --text-light: #444;
  --disabled: #9ca3af;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  --shadow-inner: inset 0 0 12px rgba(0, 0, 0, 0.05);
  --transition: 0.25s ease;
}

/* ----------------------
   GLOBAL
----------------------- */
body {
  font-family: "Inter", "SF Pro Display", system-ui, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 1050px;
  box-shadow: var(--shadow);
  overflow: visible;
  animation: fadeIn 0.4s ease;
}

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

/* ----------------------
   HEADER
----------------------- */
.header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
}

.header img {
  height: 52px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.18));
}

.header h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}

.admin-toggle {
  position: absolute;
  right: 18px;
  top: 16px;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: .5rem .9rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition);
}

.admin-toggle:hover {
  background: rgba(255,255,255,0.4);
  transform: translateY(-2px);
}

/* ----------------------
   SAUDAÇÃO
----------------------- */
#welcomeTitle {
  text-align: center;
  font-size: 1.9rem;
  font-weight: 700;
  margin: 1.8rem 0 1rem;
  color: var(--secondary);
}

/* ----------------------
   GRID PRINCIPAL
----------------------- */
.body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
}

.cert-area {
  width: 100%;
}

#cv {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: var(--transition);
  background: url("../img/certificado_fundo.jpg") center/cover no-repeat;
}

#cv:hover {
  transform: scale(1.01);
}

/* ----------------------
   BUTTONS
----------------------- */
.controls {
  display: flex;
  justify-content: center;
  gap: .9rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: .9rem 1.4rem;
  font-weight: 700;
  cursor: pointer;
  font-size: .95rem;
  transition: var(--transition);
  letter-spacing: -.2px;
}

.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(213,4,37,0.25);
}
.primary:hover {
  background: var(--brand-light);
  transform: translateY(-2px);
}

.secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.secondary:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  background: var(--disabled);
  cursor: not-allowed;
  opacity: .6;
  transform: none !important;
  box-shadow: none;
}

/* ----------------------
   FINALIZADO
----------------------- */
.finalizado-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 0 1.5rem 2rem;
  padding: 2rem 2.4rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-inner);
  text-align: center;
}

.finalizado-logo {
  width: 72px;
  height: auto;
}

.finalizado-box .texto {
  max-width: 720px;
  line-height: 1.6;
  color: var(--text-light);
  margin: 0;
}

.email-suporte {
  margin: 0;
  color: var(--secondary);
}

/* ----------------------
   OVERLAY BLOQUEIO
----------------------- */
#overlayBlock {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  z-index: 2000;
  padding: 2rem;
}

#overlayBlock .msg {
  max-width: 70%;
  font-size: 1.25rem;
  color: var(--brand);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

/* ----------------------
   MODAL PARABÉNS
----------------------- */
#parabensModal {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.88);
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
  z-index: 3000;
  animation: fadeIn .4s ease;
}

#parabensBox {
  background: #fff;
  padding: 2rem 2.4rem;
  border-radius: 20px;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0,0,0,0.15);
  animation: pop .35s ease;
}

/* ----------------------
   MODAL ADMIN (PAINEL)
----------------------- */
#adminModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  z-index: 2500;

  /* NOVO → permite rolagem quando o histórico é grande */
  overflow-y: auto;
  padding: 40px 0;
}

#adminBox {
  background: #fff;
  padding: 2.3rem 2.6rem;
  border-radius: 18px;
  width: 720px;
  max-width: 92vw;

  /* NOVO → ativa scroll interno do conteúdo */
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  border: 1px solid #e8e8ee;
}

/* ============================================================
   PAINEL ADMIN – ESTILOS PREMIUM
   Compatível com o admin.js aprimorado
============================================================ */

/* ---- Cabeçalho do painel ---- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.admin-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
}

.admin-subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* ---- Abas modernas ---- */
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #f1f1f3;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  color: var(--secondary);
  transition: 0.25s ease;
}

.tab-btn:hover {
  background: #e8e8ee;
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(213, 4, 37, 0.28);
}

/* ---- Campo de busca ---- */
.admin-input {
  width: 100%;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ddd;
  font-size: 0.92rem;
}

.admin-input:focus {
  border-color: var(--brand);
  outline: 2px solid var(--brand-light);
}

.search-input {
  width: 100%;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 180px) 150px 150px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #eee;
  background: #fafafa;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
}

/* ---- Conteúdo ---- */
.admin-content {
  background: #fff;
  padding: 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-inner);
  border: 1px solid #eee;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.results-count {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #6b7280;
}

.placeholder {
  text-align: center;
  color: #777;
  padding: 16px 0;
  font-style: italic;
}

/* ============================================================
   CARDS PREMIUM
============================================================ */

.admin-card.enhanced {
  background: #ffffff;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 0;
  border: 1px solid #ececec;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  transition: 0.25s ease;
}

.admin-card.enhanced:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.10);
}

/* Bloco principal */
.card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.card-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: 0.2s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.icon-btn.danger {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.icon-btn.danger:hover {
  background: #fee2e2;
}

.card-sub {
  color: #6b7280;
  font-size: 0.88rem;
  margin-top: 2px;
}

.card-main strong {
  font-size: 1rem;
  color: var(--secondary);
}

.card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}

.card-meta span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
}

.card-meta strong {
  font-size: 0.92rem;
  color: var(--secondary);
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #eef2ff;
  color: #3730a3;
}

.chip.success {
  background: #dcfce7;
  color: #166534;
}

.chip.warn {
  background: #fef3c7;
  color: #92400e;
}
/* Código */
.card-main code {
  background: #f6f6f6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.78rem;
}

/* ---- Botão de detalhes ---- */
.toggle-details {
  margin-top: 8px;
  background: var(--secondary);
  color: #fff;
  padding: 5px 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: 0.25s ease;
}

.toggle-details:hover {
  background: #334155;
  transform: translateY(-1px);
}

/* ---- Área escondida ---- */
.card-details {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f9f9fb;
  display: none;
  border: 1px solid #eee;
  animation: fadeIn 0.3s ease;
}

/* ============================================================
   VERIFICAÇÃO DE AUTENTICIDADE
============================================================ */

.verif-box {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.verif-result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: var(--shadow-inner);
  line-height: 1.5;
}

.verif-result strong {
  font-size: 1.1rem;
  color: var(--brand-dark);
}

.warn {
  color: #b45309;
  font-weight: 700;
}

.error {
  color: #b91c1c;
  font-weight: 800;
}

/* ============================================================
   RESPONSIVIDADE
============================================================ */

@media (max-width: 600px) {
  .admin-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-filters {
    grid-template-columns: 1fr;
  }

  .verif-box {
    flex-direction: column;
  }

  .toggle-details {
    width: 100%;
  }
}


/* ----------------------
   FINALIZADO
----------------------- */
.cert-locked {
  filter: grayscale(1) opacity(0.45);
  pointer-events: none;
  transition: .3s ease;
}


