/* techweek - Photobooth - Kiosk Totem Theme */

/*
 * Tokens taken from the techweek hackathon site (hackathon-743240428180.europe-west1.run.app):
 *   background #08090b, elevated #111216, foreground #f5f6f8, muted #9aa0ab,
 *   blue #1874e8, blue-light #5aa8ff, indigo #0c3f94, mint #34d8ae, navy #020712.
 * Fonts: Unbounded (titles) and Inter (text), loaded from Google Fonts in each page.
 * The same file dresses the totem (index.html), the /painel page (backend/painel.py) and, through
 * its own copy of the tokens, the QR page (/foto in backend/main.py).
 */
:root {
  --tw-bg: #08090b;
  --tw-bg-elevated: #111216;
  --tw-fg: #f5f6f8;
  --tw-muted: #9aa0ab;
  --tw-blue: #1874e8;
  --tw-blue-light: #5aa8ff;
  --tw-indigo: #0c3f94;
  --tw-mint: #34d8ae;
  --tw-navy: #020712;
  --tw-mint-ink: #06120d;
  --tw-line: rgba(255, 255, 255, 0.08);
  --tw-line-strong: rgba(255, 255, 255, 0.12);
  --tw-fill: rgba(255, 255, 255, 0.04);
  --font-display: 'Unbounded', 'Inter', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* per-archetype pair, set by aplicarAccentDoArquetipo() in script.js */
  --accent-from: #1874e8;
  --accent-to: #34d8ae;
}

/* Trava a tela em 100vh para Totem Kiosk sem scroll */
html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  touch-action: manipulation;
}

/* Celular: a trava de kiosk acima prenderia as telas altas (quiz com 8 opções, resultado
   empilhado) sem como rolar. Abaixo de 768px a página volta a rolar; o fundo é fixo, então
   não estica a página. O totem (1080px de largura) não entra aqui. */
@media (max-width: 767px) {
  html, body {
    height: auto;
    min-height: 100vh;
    overflow: auto !important;
    overflow-x: hidden !important;
  }
  main {
    height: auto !important;
    overflow: visible !important;
  }
}

body {
  font-family: var(--font-sans);
  background: var(--tw-bg);
  color: var(--tw-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--tw-mint);
  color: var(--tw-mint-ink);
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--tw-bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--tw-blue), var(--tw-mint));
  border-radius: 999px;
}

/* Background: the hero of the site. A panning blue grid faded at the edges, two pulsing glows
   (blue and mint), the floating lines (linhas.js) screen-blended over them, and two sparkles. */
.fundo {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.fundo-grade {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(90deg, rgba(90, 168, 255, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(90, 168, 255, 0.1) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000, transparent 75%);
  animation: gridPan 24s linear infinite;
}

@keyframes gridPan {
  from { background-position: 0 0; }
  to { background-position: 64px 64px; }
}

.fundo-brilho {
  position: absolute;
  border-radius: 999px;
  animation: glowPulse 4s ease-in-out infinite;
}

.fundo-brilho--azul {
  left: 50%;
  top: 33%;
  width: min(36rem, 120vw);
  height: min(36rem, 120vw);
  margin: calc(min(36rem, 120vw) / -2) 0 0 calc(min(36rem, 120vw) / -2);
  background: rgba(24, 116, 232, 0.25);
  filter: blur(120px);
}

.fundo-brilho--menta {
  right: 2.5rem;
  top: 50%;
  width: 18rem;
  height: 18rem;
  background: rgba(52, 216, 174, 0.2);
  filter: blur(100px);
  animation-delay: 1.5s;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.07); }
}

.fundo-linhas {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
}

.fundo-linhas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Four-point sparkle of the site (the path lives in each page as <symbol id="tw-sparkle">) */
.sparkle {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex-shrink: 0;
  fill: currentColor;
  vertical-align: -0.1em;
}

.animate-twinkle { animation: twinkle 2.6s ease-in-out infinite; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.05) rotate(8deg); }
}

.fundo .sparkle { position: absolute; }
.fundo .sparkle--1 { left: 12%; top: 18%; font-size: 1.5rem; color: rgba(52, 216, 174, 0.7); }
.fundo .sparkle--2 { right: 14%; top: 28%; font-size: 1rem; color: rgba(90, 168, 255, 0.7); animation-delay: 1.3s; }
.fundo .sparkle--3 { left: 18%; bottom: 16%; font-size: 1rem; color: rgba(90, 168, 255, 0.6); animation-delay: 0.7s; }
.fundo .sparkle--4 { right: 10%; bottom: 24%; font-size: 1.25rem; color: rgba(52, 216, 174, 0.6); animation-delay: 2s; }

/* Surfaces: the site's .glass, over a dark base so text stays legible above the lines */
.totem-card {
  position: relative;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.016)),
    rgba(11, 12, 15, 0.72);
  border: 1px solid var(--tw-line);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 20px 48px -16px rgba(24, 116, 232, 0.2);
}

@media (min-width: 640px) {
  .totem-card { border-radius: 2rem; }
}

/* Welcome card: the site's .glow-border (blue -> mint -> blue-light), always on */
.totem-card--arch::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--tw-blue), var(--tw-mint), var(--tw-blue-light));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  pointer-events: none;
  opacity: 0.8;
}

.pill { border-radius: 999px; }

/* Typography */
.display-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--tw-fg);
}

.gradient-text {
  background: linear-gradient(90deg, var(--tw-blue-light) 0%, var(--tw-mint) 55%, var(--tw-blue-light) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tw-muted);
}

.text-soft { color: var(--tw-muted); }
.text-ink { color: var(--tw-fg); }

/* Buttons */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.025em;
  transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0, 0, 0.2, 1),
              background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn:active { transform: scale(0.98); }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--tw-bg), 0 0 0 4px var(--tw-mint);
}

.btn .btn-seta { transition: transform 0.3s ease; }
.btn:hover .btn-seta { transform: translateX(4px); }

/* Primary: the site's "Inscrever Minha Equipe" button */
.btn-primary,
.btn-capture {
  background: linear-gradient(90deg, var(--tw-blue), var(--tw-indigo));
  color: #FFFFFF;
  box-shadow: 0 10px 15px -3px rgba(24, 116, 232, 0.25), 0 4px 6px -4px rgba(24, 116, 232, 0.25);
}

.btn-primary:hover,
.btn-capture:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(24, 116, 232, 0.4), 0 8px 10px -6px rgba(24, 116, 232, 0.4);
}

.btn-secondary {
  background: var(--tw-fill);
  color: var(--tw-fg);
  border: 1px solid var(--tw-line-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(52, 216, 174, 0.4);
  transform: translateY(-2px);
}

/* Accent: mint, the site's highlight colour, for the "Reimaginar con Gemini" call */
.btn-accent {
  background: linear-gradient(90deg, var(--tw-mint), var(--tw-blue-light));
  color: var(--tw-mint-ink);
  box-shadow: 0 10px 24px -8px rgba(52, 216, 174, 0.45);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px -8px rgba(52, 216, 174, 0.55);
}

.btn-ghost {
  background: rgba(17, 18, 22, 0.95);
  color: var(--tw-fg);
  border: 1px solid var(--tw-line-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  border-color: rgba(52, 216, 174, 0.6);
  color: var(--tw-mint);
}

.link-suave {
  color: var(--tw-muted);
  transition: color 0.3s ease;
}

.link-suave:hover { color: var(--tw-mint); }

/* Chips: the site's .badge */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .chip { font-size: 0.75rem; }
}

.chip-neutral {
  background: var(--tw-fill);
  color: var(--tw-fg);
  border: 1px solid var(--tw-line-strong);
}

.chip-event {
  background: rgba(52, 216, 174, 0.1);
  color: var(--tw-mint);
  border: 1px solid rgba(52, 216, 174, 0.2);
}

.chip-accent {
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  color: #FFFFFF;
}

/* Form fields of the /painel page: the inputs of the site's /inscrever. body is user-select: none
   (kiosk), inputs need it back to place the caret. */
.campo {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tw-fg);
}

.campo input {
  -webkit-user-select: text;
  user-select: text;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1.1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--tw-line-strong);
  background: var(--tw-fill);
  color: var(--tw-fg);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.campo input::placeholder { color: rgba(154, 160, 171, 0.6); }

.campo input:focus {
  border-color: rgba(52, 216, 174, 0.5);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(52, 216, 174, 0.2);
}

/* Autofill would paint the field light yellow/blue on a dark card */
.campo input:-webkit-autofill {
  -webkit-text-fill-color: var(--tw-fg);
  -webkit-box-shadow: 0 0 0 100px #15171b inset;
  caret-color: var(--tw-fg);
}

/* Quiz Options: the site's library cards (.glass.card-hover) */
.option-btn {
  width: 100%;
  padding: 1.15rem 1.4rem;
  border-radius: 1rem;
  border: 1px solid var(--tw-line-strong);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.016));
  color: var(--tw-fg);
  text-align: left;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.option-btn--compact {
  padding: 0.85rem 1.1rem !important;
  border-radius: 0.85rem !important;
}

.option-btn:hover {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border-color: rgba(24, 116, 232, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 20px 48px -16px rgba(24, 116, 232, 0.28);
}

.option-btn.is-selected {
  border-color: rgba(52, 216, 174, 0.6);
  background: rgba(52, 216, 174, 0.08);
  box-shadow: 0 20px 48px -16px rgba(52, 216, 174, 0.3);
  font-weight: 600;
}

.option-mark {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--tw-line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: transparent;
  transition: all 0.3s ease;
}

.option-btn.is-selected .option-mark {
  background: var(--tw-mint);
  border-color: var(--tw-mint);
  color: var(--tw-mint-ink);
  transform: scale(1.1);
}

/* Loading Screen Styles */
.spinner {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 999px;
  border: 5px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--tw-blue);
  border-right-color: var(--tw-mint);
  animation: spin 0.85s linear infinite;
  box-shadow: 0 0 40px rgba(24, 116, 232, 0.3);
}

.spinner--accent {
  border-top-color: var(--accent-from);
  border-right-color: var(--accent-to);
  box-shadow: 0 0 40px rgba(52, 216, 174, 0.25);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Screen Transitions */
.step-section {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.media-frame {
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--tw-line);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.7), 0 20px 48px -20px rgba(24, 116, 232, 0.3);
  background: var(--tw-navy);
}

/* Info Panels */
.info-panel {
  border-radius: 1rem;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.016));
  border: 1px solid var(--tw-line);
}

.info-panel-accent {
  border-left: 3px solid var(--accent-from);
}

.info-panel--qr { align-items: center; }

/* Original / IA toggle (classes swapped by alternarImagemResultado() in script.js) */
.segmented {
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--tw-fill);
  border: 1px solid var(--tw-line-strong);
}

.segmented button {
  padding: 0.55rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  color: var(--tw-muted);
  transition: background 0.3s ease, color 0.3s ease;
}

.segmented button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.segmented button.is-active {
  background: linear-gradient(90deg, var(--tw-blue), var(--tw-indigo));
  color: #FFFFFF;
}

.totem-nosel {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Image Swapping */
.img-swapping { opacity: 0; }

#shot-preview-img,
#fluxo1-preview-img,
#final-persona-card-img,
#qr-code-img,
#qr-code-img-choice {
  transition: opacity 0.18s ease;
}

.camera-feed {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: scaleX(-1) !important;
}

.camera-espelhada {
  transform: scaleX(-1) !important;
}

@media (prefers-reduced-motion: reduce) {
  .fundo-grade, .fundo-brilho, .animate-twinkle, .gradient-text { animation: none !important; }
}
