/* =====================================================================
   App do participante
   ===================================================================== */

body { overflow: hidden; background: #fff; }

/* ---------------- Intro ---------------- */
.intro {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 40%, var(--rc-500) 0%, var(--rc-600) 70%, var(--rc-700) 100%);
}
.intro-glow {
  position: absolute; width: 70vmin; height: 70vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); filter: blur(30px);
}
.intro-logo { position: relative; width: min(56vw, 420px); overflow: visible; }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; height: 100dvh; }

/* ---------------- Hero ---------------- */
.hero { position: relative; overflow: hidden; background: var(--rc-700); color: #fff; isolation: isolate; }
.hero-layer { position: absolute; inset: -40px; will-change: transform; }
.hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.12); filter: saturate(1.05);
}
.hero-photo img.is-on { opacity: 1; }
.hero-photo img[data-scene="search"] { object-position: 55% 25%; }
.hero-photo img[data-scene="confirm"] { object-position: 32% 35%; }
.hero-photo img[data-scene="badge"] { object-position: 24% 60%; }
.hero-shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(226,0,26,.0) 0%, rgba(226,0,26,0) 38%, rgba(181,0,21,.82) 72%, rgba(90,0,10,.97) 100%),
    linear-gradient(180deg, rgba(45,0,5,.28) 0%, rgba(45,0,5,0) 22%);
}
.hero-crown { z-index: 2; display: grid; place-items: end; padding: 0 4% 18% 0; pointer-events: none; }
.hero-crown img { width: 62%; opacity: .14; filter: blur(.3px); }
.hero-content {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(28px, 5vh, 56px) clamp(28px, 4vw, 60px);
}
.hero-logo { width: clamp(140px, 13vw, 200px); filter: drop-shadow(0 6px 20px rgba(0,0,0,.25)); }
.hero-event { display: grid; gap: 10px; max-width: 30ch; }
.hero-eyebrow { font-family: var(--font-cond); font-weight: 500; letter-spacing: .22em; text-transform: uppercase; font-size: .8125rem; opacity: .85; }
.hero-title { font-size: clamp(2rem, 3.4vw, 3.25rem); line-height: 1.02; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.hero-meta { display: inline-flex; gap: 8px; align-items: center; font-size: 1rem; opacity: .9; }

/* ---------------- Painel ---------------- */
.panel { position: relative; overflow-x: clip; display: flex; flex-direction: column; min-width: 0; height: 100dvh; background: #fff; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px clamp(20px, 4vw, 60px);
}
.topbar-logo { height: 40px; display: none; }

.stepper { position: relative; display: flex; gap: clamp(16px, 3vw, 40px); list-style: none; margin: 0 0 0 auto; padding: 0 0 12px; }
.stepper li { display: flex; align-items: center; gap: 8px; color: var(--grey-400); font-size: .875rem; font-weight: 500; transition: color .4s var(--ease); }
.stepper li span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid currentColor; font-size: .75rem; transition: all .4s var(--ease);
}
.stepper li em { font-style: normal; }
.stepper li.is-active, .stepper li.is-done { color: var(--rc-500); }
.stepper li.is-active span { background: var(--rc-500); color: #fff; border-color: var(--rc-500); box-shadow: 0 0 0 5px var(--rc-50); }
.stepper li.is-done span { background: var(--rc-50); }
.stepper-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grey-100); border-radius: 3px; overflow: hidden; }
.stepper-bar b { display: block; height: 100%; width: 33.33%; background: var(--rc-500); border-radius: 3px; transform-origin: left; }

.screens { position: relative; flex: 1; min-height: 0; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: clamp(16px, 5vh, 64px) clamp(20px, 6vw, 96px) 40px;
  visibility: hidden; pointer-events: none;
}
.screen.is-active { visibility: visible; pointer-events: auto; }
.screen > * { max-width: 640px; width: 100%; }
.screen > .chip, .screen > .back { width: auto; }
.screen-center { align-items: center; justify-content: center; text-align: center; }

.display { font-size: clamp(2.25rem, 4.2vw, 3.75rem); line-height: 1.02; font-weight: 700; margin: 18px 0 14px; letter-spacing: -.015em; text-wrap: balance; }
.red { color: var(--rc-500); }
.lead { font-size: clamp(1.0625rem, 1.3vw, 1.25rem); line-height: 1.45; color: var(--grey-600); margin: 0 0 32px; max-width: 46ch; }
.hint { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--grey-500); margin-top: 18px; }
.hint .icon { color: var(--grey-400); }

/* ---------------- Busca ---------------- */
.search { position: relative; z-index: 2; }
.search input {
  width: 100%; height: 76px; padding: 0 64px 0 66px; border-radius: var(--r-full);
  border: 2px solid var(--grey-200); background: #fff; font-size: 1.375rem; font-weight: 500;
  outline: none; transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--grey-400); font-weight: 400; }
.search input:focus { border-color: var(--rc-500); box-shadow: 0 0 0 6px var(--rc-50), var(--shadow-2); }
.search-icon { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; color: var(--rc-500); pointer-events: none; }
.search-clear {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%) scale(.6); opacity: 0;
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grey-100); color: var(--grey-700);
  display: grid; place-items: center; transition: all .25s var(--ease-out); pointer-events: none;
}
.search.has-value .search-clear { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; }
.search-clear:hover { background: var(--grey-200); }
.search-glow {
  position: absolute; inset: -2px; border-radius: var(--r-full); z-index: -1; opacity: 0;
  background: conic-gradient(from var(--a, 0deg), var(--rc-500), var(--gold), var(--rc-300), var(--rc-500));
  filter: blur(14px); transition: opacity .4s;
}
.search input:focus ~ .search-glow { opacity: .35; }

.results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.result {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 16px;
  padding: 12px 16px 12px 12px; border-radius: var(--r-l); border: 1.5px solid var(--grey-100);
  background: #fff; cursor: pointer; transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease-out);
}
.result:hover, .result.is-focus { border-color: var(--rc-200); box-shadow: var(--shadow-2); transform: translateX(4px); }
.result .avatar { width: 52px; height: 52px; font-size: 1.125rem; }
.result strong { display: block; font-size: 1.125rem; font-weight: 700; }
.result strong mark { background: none; color: var(--rc-500); }
.result small { display: block; color: var(--grey-500); font-size: .875rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result .go { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--rc-50); color: var(--rc-500); transition: all .25s var(--ease); }
.result:hover .go, .result.is-focus .go { background: var(--rc-500); color: #fff; }
.result > div { min-width: 0; }


.empty { text-align: center; padding: 36px 24px; margin-top: 14px; border-radius: var(--r-l); background: var(--grey-100); }
.empty strong { display: block; font-size: 1.25rem; margin: 14px 0 6px; }
.empty p { margin: 0 auto; color: var(--grey-600); max-width: 38ch; line-height: 1.45; }
.empty-dots { display: inline-flex; gap: 8px; }
.empty-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--rc-300); }

/* ---------------- Confirmação ---------------- */
.back {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 0;
  color: var(--grey-600); font-weight: 500; margin-bottom: 6px;
}
.back:hover { color: var(--rc-500); }
.person {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center;
  padding: 28px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-2); border: 1px solid var(--grey-100);
  overflow: hidden; margin-bottom: 32px;
}
.person::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  background: url(../assets/royal-canin-coroa-vermelha.svg) center / contain no-repeat; opacity: .06;
}
.person-avatar { position: relative; width: 104px; height: 104px; }
.person-avatar span {
  position: absolute; inset: 8px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--rc-400), var(--rc-600)); color: #fff; font-size: 2rem; font-weight: 700;
}
.person-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.person-ring circle { fill: none; stroke: var(--rc-500); stroke-width: 3; stroke-dasharray: 296; stroke-dashoffset: 296; stroke-linecap: round; }
.person-info { display: grid; gap: 4px; min-width: 0; }
.person-info strong { font-size: clamp(1.375rem, 2vw, 1.75rem); line-height: 1.1; }
.person-info > span { color: var(--grey-600); }
.person-cat { position: absolute; top: 20px; right: 20px; }
.person-meta { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 32px; margin: 4px 0 0; padding-top: 20px; border-top: 1px dashed var(--grey-200); }
.person-meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--grey-500); }
.person-meta dd { margin: 4px 0 0; font-weight: 500; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------------- Carregando ---------------- */
.loader-crown { width: 200px; overflow: visible; fill: var(--rc-500); margin-bottom: 28px; }
.loader-title { font-size: 1.75rem; }
.loader-sub { color: var(--grey-500); margin-top: 8px; min-height: 1.5em; }

/* ---------------- Credencial ---------------- */
#s-badge { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto 1fr; column-gap: 40px; align-content: start; }
#s-badge > * { max-width: none; }
.badge-head { grid-column: 1 / -1; grid-row: 1; max-width: 640px; }
.badge-head .display { margin-top: 14px; }
.badge-head .lead { margin-bottom: 20px; }
#s-badge > .actions { grid-column: 2; grid-row: 2; flex-direction: column; align-items: stretch; align-self: center; max-width: 240px; }
#s-badge > .hint { grid-column: 2; grid-row: 3; align-self: start; max-width: 240px; }
.chip-ok { gap: 6px; background: var(--green-light); color: var(--green); }
.chip-ok .icon { width: 16px; height: 16px; }

.badge-stage { grid-column: 1; grid-row: 2 / span 2; position: relative; perspective: 1200px; padding: 8px 8px 24px; }
.badge-tilt { transform-style: preserve-3d; will-change: transform; }
.badge-card {
  position: relative; width: clamp(240px, 22vw, 330px); aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow-3), 0 0 0 1px rgba(0,0,0,.04);
}
.badge-card img { display: block; width: 100%; height: 100%; }
.badge-shine {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.75) 48%, transparent 62%);
  transform: translateX(-120%);
}
.burst { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.burst i { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--rc-500); }

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(20px, 4vw, 60px); border-top: 1px solid var(--grey-100); font-size: .8125rem; color: var(--grey-500);
}
.foot a { display: inline-flex; gap: 6px; align-items: center; color: var(--grey-600); text-decoration: none; font-weight: 500; }
.foot a:hover { color: var(--rc-500); }
.foot .icon { width: 16px; height: 16px; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1000px) {
  #s-badge { grid-template-columns: 1fr; }
  #s-badge > *, .badge-stage { grid-column: 1 !important; grid-row: auto !important; }
  .badge-stage { justify-self: center; margin: 8px 0 24px; }
  #s-badge > .actions { flex-direction: row; justify-content: center; max-width: none; width: 100%; }
  #s-badge > .hint { justify-content: center; max-width: none; }
}

@media (max-width: 860px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100dvh; }
  .hero { height: 220px; }
  .hero-crown { display: none; }
  .hero-content { flex-direction: row; align-items: flex-end; padding: 20px; }
  .hero-logo { width: 116px; position: absolute; top: 20px; left: 20px; }
  .hero-event { gap: 4px; }
  .hero-title { font-size: 1.625rem; }
  .hero-eyebrow, .hero-meta { font-size: .8125rem; }
  .hero-meta:last-child { display: none; }
  .panel { height: auto; min-height: calc(100dvh - 220px); }
  .topbar { padding: 14px 20px 6px; }
  .stepper { margin: 0 auto; }
  .stepper li em { display: none; }
  .screens { min-height: 0; }
  .screen { padding: 20px 20px 32px; }
  .screen.is-active { position: relative; overflow: visible; }
  .screen-center.is-active { min-height: 60vh; }
  .search input { height: 64px; font-size: 1.125rem; padding-left: 56px; }
  .search-icon { left: 20px; width: 24px; height: 24px; }
  .person { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 28px 20px 20px; }
  .person-cat { position: static; }
  .person-meta { text-align: left; width: 100%; grid-template-columns: 1fr 1fr; gap: 16px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
  .badge-card { width: min(78vw, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
