/* ═══════════════════════════════════════════
   QR Task Viewer — styles.css (Simplified)
   One team → one QR code, premium dark UI
═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #07090f;
  --surface:    #0d1117;
  --border:     rgba(255,255,255,0.07);
  --purple:     #7c3aed;
  --blue:       #2563eb;
  --purple-lt:  #a78bfa;
  --blue-lt:    #60a5fa;
  --white:      #f1f5f9;
  --muted:      #64748b;
  --error:      #ef4444;
  --grad:       linear-gradient(135deg, #7c3aed, #2563eb);
  --radius:     20px;
  --card-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
}

html { font-size: 16px; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* ── Ambient Blobs ── */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  width: 550px; height: 550px;
  background: radial-gradient(circle, rgba(124,58,237,0.3), transparent 70%);
  top: -180px; left: -180px;
  animation: drift 14s ease-in-out infinite;
}
.blob-2 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(37,99,235,0.25), transparent 70%);
  bottom: -150px; right: -150px;
  animation: drift 18s ease-in-out infinite reverse;
}
@keyframes drift {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(24px,-24px) scale(1.06); }
}

/* ── Page layout ── */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 40px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  filter: drop-shadow(0 4px 20px rgba(124,58,237,0.55));
  flex-shrink: 0;
}
.title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── Input Section ── */
.input-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.input-wrap:focus-within {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.input-icon {
  padding: 0 12px 0 18px;
  color: var(--muted);
  flex-shrink: 0;
}
#teamInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 17px 0;
  caret-color: var(--purple);
}
#teamInput::placeholder { color: rgba(100,116,139,0.5); font-weight: 400; }
#goBtn {
  background: var(--grad);
  border: none;
  outline: none;
  color: white;
  width: 56px;
  height: 56px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}
#goBtn:hover  { opacity: 0.88; }
#goBtn:active { transform: scale(0.93); }
#goBtn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hint {
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}
.hint kbd {
  display: inline-block;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 1px 7px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.74rem;
  color: var(--purple-lt);
}

/* ── Error ── */
.error {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 12px;
  padding: 13px 18px;
  color: #fca5a5;
  font-size: 0.88rem;
  font-weight: 500;
  width: 100%;
  animation: pop 0.25s ease;
}
.error svg { flex-shrink: 0; color: var(--error); }

/* ── Result ── */
.result {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: rise 0.45s cubic-bezier(0.22,1,0.36,1);
}

/* ── Team Chip ── */
.team-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.28);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--purple-lt);
  letter-spacing: 0.04em;
}
.chip-dot {
  width: 7px; height: 7px;
  background: var(--purple-lt);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--purple-lt);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.75); }
}

/* ── QR Card ── */
.qr-card {
  width: 100%;
  background: linear-gradient(150deg, rgba(124,58,237,0.07), rgba(37,99,235,0.04));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px);
}

.scan-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── QR Frame ── */
.qr-frame {
  position: relative;
  width: 300px;
  height: 300px;
  background: #ffffff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.45);
}

/* Corner brackets */
.corner {
  position: absolute;
  width: 28px; height: 28px;
  border-color: var(--purple);
  border-style: solid;
  z-index: 2;
  transition: border-color 0.3s;
}
.tl { top:-1px; left:-1px;  border-width: 3px 0 0 3px; border-radius: 5px 0 0 0; }
.tr { top:-1px; right:-1px; border-width: 3px 3px 0 0; border-radius: 0 5px 0 0; }
.bl { bottom:-1px; left:-1px;  border-width: 0 0 3px 3px; border-radius: 0 0 0 5px; }
.br { bottom:-1px; right:-1px; border-width: 0 3px 3px 0; border-radius: 0 0 5px 0; }

#qrImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  display: block;
}

/* ── Spinner ── */
.spinner-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ── Missing ── */
.missing {
  position: absolute;
  inset: 0;
  background: #fff5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 16px;
  text-align: center;
}
.missing small { color: #dc2626; font-weight: 400; font-size: 0.72rem; word-break: break-all; }

/* ── QR ID Pill ── */
.qr-id-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 18px;
}
.pill-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.pill-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--blue-lt);
  letter-spacing: 0.05em;
}

/* ── Utilities ── */
.hidden { display: none !important; }

/* ── Animations ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop  {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .page { padding: 28px 16px 48px; gap: 22px; }
  .title { font-size: 1.4rem; }
  .qr-frame { width: 260px; height: 260px; }
  .qr-card { padding: 24px 18px 20px; }
}
