/* ==========================================================================
   Componente: demonstração do self check-in ([organideia_demo_checkin])
   Tudo dentro de .ckd__scene mede-se em em: o tamanho da letra da cena define a escala do desenho.
   Estado sem JavaScript = imagem final. Com JavaScript (.is-ready): espera → .is-welcome/.is-printing → .is-done
   ========================================================================== */
.ckd { margin-top: var(--sp-7); }
.entry-content .ckd__title { margin-top: var(--sp-2); }
.ckd__lead { color: var(--c-ink-500); max-width: 44rem; }
.ckd__card {
  margin-top: var(--sp-5);
  display: grid; gap: var(--sp-6); align-items: center;
  padding: clamp(1.25rem, 0.5rem + 3vw, 2.75rem);
  background: var(--c-paper); border: 1px solid var(--c-ink-100); border-radius: var(--radius-lg);
}
@media (min-width: 52rem) { .ckd__card { grid-template-columns: minmax(16rem, 5fr) 6fr; } }

.ckd__form { display: grid; gap: var(--sp-4); align-content: start; }
.ckd__field { display: grid; gap: var(--sp-1); font-size: var(--fs-300); font-weight: var(--fw-bold); color: var(--c-ink-700); }
.ckd__field input, .ckd__field select {
  width: 100%; min-height: 48px; padding: 0.6rem 0.85rem;
  font: inherit; font-size: var(--fs-400); font-weight: var(--fw-regular); color: var(--c-ink-900);
  background: var(--c-white); border: 1px solid var(--c-ink-300); border-radius: var(--radius-md);
}
.ckd__field input:focus-visible, .ckd__field select:focus-visible { border-color: var(--c-ink-900); outline-offset: 1px; }
.ckd__go { justify-self: start; }
.ckd__go[disabled] { opacity: 0.6; cursor: progress; }
.ckd__status { min-height: 1.5em; margin: 0; font-size: var(--fs-300); color: var(--c-ink-500); }

/* ---- Cena ---- */
.ckd__scene {
  position: relative; justify-self: center;
  width: 24em; height: 33.5em;
  font-size: clamp(10px, 3.4vw, 15px); line-height: 1.2;
}
.ckd__scene p { margin: 0; }

/* Tablet */
.ckd-tab {
  position: absolute; left: 50%; top: 0; width: 22em; height: 14em; margin-left: -11em;
  padding: 0.7em; background: #1c1e22; border-radius: 1.3em;
  box-shadow: 0 0.9em 1.8em rgb(29 26 23 / 0.22);
}
.ckd-tab__screen { position: relative; height: 100%; overflow: hidden; border-radius: 0.6em; background: #0e6e73; }
.ckd-tab__idle, .ckd-tab__ok { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; }
.ckd-tab__card { display: grid; justify-items: center; gap: 0.7em; width: 13.5em; padding: 1.1em 1em 1.2em; background: #fff; border-radius: 0.9em; box-shadow: 0 0.5em 1.2em rgb(0 0 0 / 0.18); }
.ckd-tab__qr { width: 4.2em; height: 4.2em; color: #0e6e73; }
.ckd-tab__ask { font-size: 1.05em; font-weight: var(--fw-heavy); color: #1b1f2a; }
.ckd-tab__ok { gap: 0.3em; padding: 0.8em; color: #fff; background: #1c7a41; transition: opacity 0.35s var(--ease); }
.ckd-tab__check { display: grid; place-items: center; width: 2.6em; height: 2.6em; margin-bottom: 0.2em; border-radius: 50%; background: rgb(255 255 255 / 0.18); }
.ckd-tab__check svg { width: 1.6em; height: 1.6em; }
.ckd-tab__hello { font-size: 1em; font-weight: var(--fw-medium); opacity: 0.95; }
.ckd-tab__name { max-width: 11.5em; font-size: 1.75em; font-weight: var(--fw-heavy); line-height: 1.05; overflow-wrap: anywhere; }
.ckd-tab__name[data-len="m"] { font-size: 1.4em; max-width: 14em; }
.ckd-tab__name[data-len="l"] { font-size: 1.15em; max-width: 17em; }
.ckd-tab__meta { max-width: 24em; font-size: 0.78em; opacity: 0.92; }
.ckd-tab__pill { margin-top: 0.5em !important; padding: 0.5em 0.9em; font-size: 0.8em; font-weight: var(--fw-bold); background: rgb(0 0 0 / 0.2); border-radius: 0.7em; }

/* Suporte entre o tablet e a impressora */
.ckd-neck { position: absolute; left: 50%; top: 13.6em; width: 7em; height: 2.6em; margin-left: -3.5em; background: linear-gradient(#2a2d33, #3a3e45); clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%); }

/* Impressora */
.ckd-prn {
  position: absolute; left: 50%; top: 15.6em; width: 18em; height: 9.6em; margin-left: -9em;
  border-radius: 1.3em 1.3em 0.9em 0.9em; border: 1px solid #c9c4bc;
  background: linear-gradient(#fbfaf8, #e4e0da 70%, #d5d0c9);
  box-shadow: 0 1.1em 1.6em rgb(29 26 23 / 0.16);
}
.ckd-prn__lid { position: absolute; left: 1em; top: 0.9em; width: 10.2em; height: 3.2em; border-radius: 0.8em; background: linear-gradient(160deg, #5b616b, #33373e 60%); box-shadow: inset 0 0.15em 0 rgb(255 255 255 / 0.18); }
.ckd-prn__lid::after { content: ""; position: absolute; left: 0.8em; right: 0.8em; top: 0.9em; height: 1.4em; border-radius: 0.35em; background: repeating-linear-gradient(#f4efe2 0 0.32em, #e3dccb 0.32em 0.4em); opacity: 0.85; }
.ckd-prn__panel { position: absolute; right: 1em; top: 0.9em; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35em; width: 4.8em; }
.ckd-prn__lcd { grid-column: 1 / -1; height: 1.7em; border-radius: 0.3em; background: #23323a; box-shadow: inset 0 0 0 0.12em #111; }
.ckd-prn__led { position: absolute; left: -0.9em; top: 0.6em; width: 0.45em; height: 0.45em; border-radius: 50%; background: #5ed18a; }
.ckd-prn__panel i { height: 0.9em; border-radius: 0.3em; background: #bdb8b0; }
.ckd-prn__slot { position: absolute; left: 1.5em; right: 1.5em; bottom: 2.2em; height: 0.75em; border-radius: 0.4em; background: #23262b; box-shadow: inset 0 0.2em 0.3em #000; }

/* Etiqueta: sai pela ranhura (o contentor corta o que ainda está «dentro») */
.ckd-out { position: absolute; left: 50%; top: 22.65em; width: 14em; height: 10.6em; overflow: hidden; padding: 0 0.6em 0.9em; box-sizing: content-box; margin-left: -7.6em; }
.ckd-lab {
  position: relative; height: 9.65em; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; align-items: center;
  text-align: center; color: #000; background: #fff; border-radius: 0 0 0.25em 0.25em;
  box-shadow: 0 0.35em 0.7em rgb(29 26 23 / 0.22);
  transform-origin: 50% 0;
}
.ckd-lab__num { position: absolute; right: 0.5em; top: 0.35em; font-size: 0.6em; color: #444; }
.ckd-lab__name { align-self: center; padding: 0.55em 0.4em 0; max-width: 100%; font-size: 2.25em; font-weight: var(--fw-heavy); line-height: 1; overflow-wrap: anywhere; text-wrap: balance; }
.ckd-lab__name[data-len="m"] { font-size: 1.7em; }
.ckd-lab__name[data-len="l"] { font-size: 1.3em; }
.ckd-lab__inst { padding: 0.25em 0.5em 0.5em; font-size: 0.82em; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ckd-lab__inst:empty { padding: 0 0 0.3em; }
.ckd-lab__cat { justify-self: stretch; padding: 0.42em 0.3em; font-size: 1em; font-weight: var(--fw-heavy); letter-spacing: 0.03em; text-transform: uppercase; color: #fff; background: #000; border-radius: 0 0 0.25em 0.25em; }

.ckd-floor { position: absolute; left: 50%; top: 24.9em; width: 21em; height: 1em; margin-left: -10.5em; border-radius: 50%; background: rgb(29 26 23 / 0.1); filter: blur(0.35em); z-index: -1; }

/* ---- Estados (só com JavaScript) ---- */
.ckd.is-ready .ckd-tab__ok { opacity: 0; }
.ckd.is-ready.is-welcome .ckd-tab__ok { opacity: 1; }
.ckd.is-ready .ckd-lab { transform: translateY(-106%); }
.ckd.is-ready.is-printing .ckd-lab { animation: ckd-print 1.9s cubic-bezier(0.35, 0.1, 0.35, 1) 0.35s both; }
.ckd.is-ready.is-done .ckd-lab { transform: translateY(0.5em) rotate(-1.2deg); transition: transform 0.28s var(--ease); }
.ckd.is-printing .ckd-prn__led { animation: ckd-led 0.35s steps(2) infinite; }
@keyframes ckd-print { from { transform: translateY(-106%); } to { transform: translateY(0); } }
@keyframes ckd-led { 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  .ckd.is-ready.is-printing .ckd-lab { animation: none; transform: none; }
  .ckd.is-ready.is-done .ckd-lab { transition: none; }
  .ckd.is-printing .ckd-prn__led { animation: none; }
}
