/* =============================================================
   Certificado 3D sobre base cilíndrica (protótipos P1 e P3, 01/10/2026)
   Gira ao clicar (frente/verso); a lupa abre frente e verso em tela cheia.
   Classes com prefixo c3d-; medidas em px (a raiz do site tem 15px).
   ============================================================= */

.c3d, .c3d-zoom, .c3d-lb {
  --c3d-ink: #0F2044; --c3d-muted: #5B6B82; --c3d-line: #E2E8F0;
  --c3d-font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── Certificado girando sobre a base ── */
.c3d { position: relative; width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; }
.c3d .c3d-flip {
  -webkit-appearance: none !important; appearance: none !important;
  border: 0; background: none !important; box-shadow: none; border-radius: 0;
  padding: 0; margin: 0 0 -9%; width: 86%; height: auto; min-width: 0; line-height: normal;
  cursor: pointer; perspective: 1300px; position: relative; z-index: 2;
}
.c3d-cert { position: relative; width: 100%; aspect-ratio: var(--c3d-ratio, 1384 / 1024); transform-style: preserve-3d; transition: transform .95s cubic-bezier(.3,.75,.2,1); }
.c3d.is-back .c3d-cert { transform: rotateY(180deg); }
.c3d-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 22px 24px -16px rgba(15,32,68,.55), 0 2px 4px rgba(15,32,68,.2); }
.c3d-face img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.c3d-face--back { transform: rotateY(180deg); }
@media (hover: hover) {
  .c3d-flip:hover .c3d-cert { transform: rotateY(-10deg); }
  .c3d.is-back .c3d-flip:hover .c3d-cert { transform: rotateY(170deg); }
}

.c3d-ped { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.c3d-ped-top { width: 100%; height: 58px; border-radius: 50%; position: relative; z-index: 1; }
.c3d-ped-body { width: 100%; height: 66px; margin-top: -29px; border-radius: 0 0 50% 50% / 0 0 29px 29px; }
.c3d-ped-shadow { width: 90%; height: 24px; margin-top: -10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(15,32,68,.22), transparent); }
.c3d--excl .c3d-ped-top { background: radial-gradient(ellipse at 50% 30%, #FFFFFF 0%, #EEF2F8 48%, #D8DFEA 100%); box-shadow: inset 0 0 0 1.5px #C7D1DF, inset 0 -5px 10px rgba(15,32,68,.07); }
.c3d--excl .c3d-ped-body { background: linear-gradient(90deg, #AFBACB 0%, #D5DDE9 28%, #EEF2F8 48%, #D2DAE6 70%, #AAB5C7 100%); }
.c3d--prem .c3d-ped-top { background: radial-gradient(ellipse at 50% 30%, #FFFFFF 0%, #F7F1E7 48%, #E6DBCA 100%); box-shadow: inset 0 0 0 1.5px #DACBB3, inset 0 -5px 10px rgba(80,55,20,.07); }
.c3d--prem .c3d-ped-body { background: linear-gradient(90deg, #C2B299 0%, #E4DACA 28%, #F5EFE5 48%, #E0D4C2 70%, #BCAB91 100%); }
.c3d-side {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 3;
  font: 700 11.2px/1 var(--c3d-font); letter-spacing: .12em; text-transform: uppercase; color: var(--c3d-ink);
  background: rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(15,32,68,.12); padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.c3d-hint { display: flex; align-items: center; gap: 6px; font-size: 13.12px; color: var(--c3d-muted); }

/* Versão menor (conclusão do curso, P3) */
.c3d--sm { width: min(330px, 100%); }
.c3d--sm .c3d-face { box-shadow: 0 18px 22px -14px rgba(15,32,68,.55), 0 2px 4px rgba(15,32,68,.2); }
.c3d--sm .c3d-ped-top { height: 46px; }
.c3d--sm .c3d-ped-body { height: 52px; margin-top: -23px; border-radius: 0 0 50% 50% / 0 0 23px 23px; }
.c3d--sm .c3d-ped-shadow { height: 20px; margin-top: -8px; }
.c3d--sm .c3d-side { bottom: 19px; font-size: 10.24px; background: rgba(255,255,255,.88); padding: 4px 9px; }
.c3d-hint--sm { font-size: 12.48px; }

/* ── Lupa (botão no canto do bloco do modelo) ── */
.c3d-zoom {
  -webkit-appearance: none !important; appearance: none !important;
  position: absolute; top: 14px; right: 14px; z-index: 5; width: 46px; height: 46px; min-width: 0; padding: 0; margin: 0;
  border-radius: 50%; border: 1px solid var(--c3d-line); background: #fff !important; color: var(--c3d-ink);
  display: grid; place-items: center; cursor: pointer; line-height: normal;
  box-shadow: 0 4px 12px -4px rgba(15,32,68,.25); transition: background-color .2s, color .2s;
}
.c3d-zoom:hover { background: var(--c3d-ink) !important; color: #fff; }

/* ── Tela cheia: frente em cima, verso na rolagem ── */
.c3d-lb { position: fixed; inset: 0; z-index: 100000; background: #0B1222; display: flex; flex-direction: column; font-family: var(--c3d-font); }
.c3d-lb[hidden] { display: none; }
.c3d-lb [hidden] { display: none !important; }
.c3d-lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; color: #fff; font-weight: 700; font-size: 15.2px; }
.c3d-lb .c3d-lb-close {
  -webkit-appearance: none !important; appearance: none !important;
  width: 44px; height: 44px; min-width: 0; padding: 0; margin: 0; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.12) !important; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; line-height: normal;
}
.c3d-lb .c3d-lb-close:hover { background: rgba(255,255,255,.24) !important; color: #fff; }
.c3d-lb-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.c3d-lb-inner { width: min(100%, 1400px); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 0 0 40px; }
.c3d-lb-inner img { display: block; width: 100%; max-width: none; height: auto; }
.c3d-lb-tag { align-self: flex-start; margin: 8px 12px 0; font: 700 11.52px/1 var(--c3d-font); letter-spacing: .12em; text-transform: uppercase; color: #fff; background: rgba(255,255,255,.14); padding: 6px 10px; border-radius: 999px; }
.c3d-lb-hint { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: #fff; color: var(--c3d-ink); font-weight: 700; font-size: 13.6px; padding: 9px 14px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: none; transition: opacity .25s; white-space: nowrap; }

@media (max-width: 680px) {
  .c3d:not(.c3d--sm) .c3d-ped-top { height: 44px; }
  .c3d:not(.c3d--sm) .c3d-ped-body { height: 50px; margin-top: -22px; border-radius: 0 0 50% 50% / 0 0 22px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .c3d-cert { transition: none !important; }
}
