/* entrance/css/style.css — NEU Library v3 — Apple-smooth x Campus Glass */

:root {
  --accent:         #4a9eff;
  --gold:           #f0c040;
  --success:        #4ade80;
  --error:          #f87171;
  --text-primary:   rgba(255,255,255,0.97);
  --text-secondary: rgba(255,255,255,0.62);
  --text-dim:       rgba(255,255,255,0.35);
  --font-body:      'Inter', system-ui, sans-serif;
  --font-mono:      'DM Mono', 'SF Mono', monospace;
  /* Spring easing — used everywhere */
  --spring:         cubic-bezier(0.34, 1.28, 0.64, 1);
  --ease-out:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════
   BACKGROUND
══════════════════════════════════════════ */
.bg-image {
  position: fixed; inset: 0; z-index: 0;
  background: url('/images/neu-campus.jpg') center center / cover no-repeat;
  filter: blur(20px) brightness(0.5) saturate(1.3);
  transform: scale(1.1);
}

.bg-overlay {
  position: fixed; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 60%, rgba(20,50,110,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(50,20,90,0.35) 0%, transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.5) 100%);
}

#bgCanvas {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.9;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 48px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(24px) saturate(120%) brightness(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(120%) brightness(1.1);
  border-bottom: none;
  box-shadow: 0 2px 32px rgba(0,0,0,0.18);
}
/* Animated glow line at bottom of header */
.header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(220,53,69,0.5) 20%,
    rgba(255,255,255,0.85) 50%,
    rgba(74,222,128,0.5) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: headerShimmer 5s ease-in-out infinite;
  box-shadow:
    0 0 6px 1px rgba(220,53,69,0.25),
    0 0 18px 2px rgba(255,255,255,0.15),
    0 0 6px 1px rgba(74,222,128,0.25);
}
@keyframes headerShimmer {
  0%   { background-position: 200% 0; opacity: 0.6; }
  50%  { opacity: 1; }
  100% { background-position: -200% 0; opacity: 0.6; }
}

.header-logo { display: flex; align-items: center; gap: 14px; flex: 1; }
.header-center { position: absolute; left: 50%; transform: translateX(-50%); }

.neu-logo-wrap {
  position: relative;
  width: 50px; height: 50px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.neu-logo-wrap::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,0.55) 50%,
    transparent 100%
  );
  animation: logoShimmer 3.5s ease-in-out infinite;
  border-radius: 50%;
}
@keyframes logoShimmer {
  0%   { left: -100%; opacity: 0; }
  10%  { opacity: 1; }
  50%  { left: 150%; }
  100% { left: 150%; opacity: 0; }
}
.neu-logo {
  width: 100%; height: 100%; border-radius: 50%; object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.45));
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.15), 0 0 12px rgba(255,255,255,0.08);
}

.title-main { font-size: 14px; font-weight: 700; letter-spacing: 2.5px; color: var(--text-primary); }
.title-sub  { font-size: 11px; letter-spacing: 1.5px; color: var(--text-secondary); margin-top: 1px; }

.clock-time {
  font-family: var(--font-mono); font-size: 28px; font-weight: 400;
  letter-spacing: 3px; color: var(--text-primary);
  text-shadow: 0 0 30px rgba(255,255,255,0.15);
  text-align: right;
}
.clock-date {
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--text-secondary); text-align: right; margin-top: 2px;
}

/* ══════════════════════════════════════════
   MAIN + SCREENS
══════════════════════════════════════════ */
.main-container {
  position: relative; z-index: 10;
  width: 100%; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 72px 40px 40px;
}

.screen {
  width: 100%; max-width: 680px;
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
}
.screen.hidden { display: none; }

/* Shared enter animation — each screen overrides timing */
.screen { animation: screenEnter 0.65s var(--spring) both; }

@keyframes screenEnter {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ══════════════════════════════════════════
   IDLE — HERO
══════════════════════════════════════════ */
.hero {
  text-align: center;
  margin-top: -30px;
  animation: heroEnter 0.8s var(--spring) both;
}
@keyframes heroEnter {
  from { opacity: 0; transform: translateY(-24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

.hero-eyebrow {
  font-size: 11px; font-weight: 600;
  letter-spacing: 4px; color: var(--text-secondary);
  margin-bottom: 10px;
}

.hero-title {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; line-height: 0.95;
}

.hero-line-1 {
  font-size: clamp(40px, 6.5vw, 80px);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  text-shadow: 0 4px 32px rgba(0,0,0,0.4);
}

.hero-line-2 {
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 900;
  letter-spacing: -2px;
  /* Animated gradient text */
  background: linear-gradient(
    90deg,
    #ffffff,
    #7dd3fc,
    #34d399,
    #a78bfa,
    #f9a8d4,
    #ffffff,
    #7dd3fc
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite;
  filter: drop-shadow(0 4px 24px rgba(125,211,252,0.3));
}

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

.hero-subtitle {
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-top: 14px; letter-spacing: 2px;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════
   IDLE — RFID RING
══════════════════════════════════════════ */
.rfid-ring {
  position: relative;
  width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  animation: rfidEnter 0.8s 0.1s var(--spring) both;
}
@keyframes rfidEnter {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.rfid-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.45);
  opacity: 0; animation: pulseRing 3s var(--ease-out) infinite;
}
.pulse-2 { animation-delay: 1s; }
.pulse-3 { animation-delay: 2s; }

@keyframes pulseRing {
  0%   { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 0; }
}

.rfid-icon {
  width: 96px; height: 96px; border-radius: 28px;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.32);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.92);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.28),
    inset 0 2px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.1);
  animation: iconBreath 4s ease-in-out infinite;
}
@keyframes iconBreath {
  0%,100% { transform: scale(1);    box-shadow: 0 12px 40px rgba(0,0,0,0.28), inset 0 2px 0 rgba(255,255,255,0.4), 0 0 0 rgba(255,255,255,0); }
  50%     { transform: scale(1.04); box-shadow: 0 16px 48px rgba(0,0,0,0.32), inset 0 2px 0 rgba(255,255,255,0.4), 0 0 30px rgba(255,255,255,0.1); }
}
.rfid-icon svg { width: 52px; height: 52px; }

/* ══════════════════════════════════════════
   IDLE — INPUT
══════════════════════════════════════════ */
.divider {
  width: 100%; display: flex; align-items: center; gap: 14px;
  color: var(--text-dim); font-size: 12px; letter-spacing: 1px;
  animation: fadeIn 0.8s 0.2s var(--ease-out) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1); }

.id-input-group {
  display: flex; gap: 10px; width: 100%; max-width: 460px;
  margin-top: 12px;
  animation: inputEnter 0.8s 0.25s var(--spring) both;
}
@keyframes inputEnter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rfid-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px; padding: 15px 20px;
  color: var(--text-primary);
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 2px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 2px 16px rgba(0,0,0,0.15);
}
.rfid-input::placeholder { color: var(--text-dim); font-size: 13px; letter-spacing: 0.5px; font-family: var(--font-body); }
.rfid-input:focus {
  border-color: rgba(74,158,255,0.75);
  background: rgba(255,255,255,0.15);
  box-shadow: 0 0 0 4px rgba(74,158,255,0.18), inset 0 1px 0 rgba(255,255,255,0.2);
}

.scan-btn {
  background: rgba(74,158,255,0.8);
  backdrop-filter: blur(20px);
  color: white; border: 1px solid rgba(255,255,255,0.28);
  border-radius: 16px; padding: 15px 28px;
  font-size: 14px; font-weight: 700; letter-spacing: 1px; cursor: pointer;
  transition: all 0.25s var(--spring);
  box-shadow: 0 4px 24px rgba(74,158,255,0.38), inset 0 1.5px 0 rgba(255,255,255,0.3);
}
.scan-btn:hover {
  background: rgba(74,158,255,1);
  box-shadow: 0 8px 32px rgba(74,158,255,0.55), inset 0 1.5px 0 rgba(255,255,255,0.35);
  transform: translateY(-2px) scale(1.02);
}
.scan-btn:active { transform: scale(0.96); transition-duration: 0.1s; }

/* ══════════════════════════════════════════
   SCANNING
══════════════════════════════════════════ */
.scanning-anim {
  width: 140px; height: 140px; border-radius: 32px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,0.22);
  overflow: hidden; position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28), inset 0 1.5px 0 rgba(255,255,255,0.25);
}
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.98), transparent);
  animation: scanMove 1.5s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(255,255,255,0.8);
}
@keyframes scanMove { 0% { top:0; } 50% { top: calc(100% - 2px); } 100% { top:0; } }

.scan-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; }
.scan-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.8); animation: dotBlink 1s ease-in-out infinite; }
.scan-dots span:nth-child(2) { animation-delay: 0.2s; }
.scan-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink { 0%,80%,100% { opacity: 0.15; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.scanning-title {
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  animation: textFlicker 1.5s ease-in-out infinite;
}
.scanning-text {
  font-size: 14px; color: var(--text-secondary);
  margin-top: -8px;
  animation: textFlicker 1.5s 0.2s ease-in-out infinite;
}
@keyframes textFlicker { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ══════════════════════════════════════════
   WELCOME — HERO GREETING
══════════════════════════════════════════ */
#screenWelcome { margin-top: -60px; }
#screenSuccess { margin-top: -80px; }
.first-timer-badge { display: none !important; } /* handled by milestone toast */
@keyframes badgeDrop {
  from { transform: translateY(-20px) scale(0.85); opacity: 0; }
  to   { transform: translateY(0)     scale(1);    opacity: 1; }
}
.badge-emoji { font-size: 20px; }
.badge-text  { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); }

.welcome-hero {
  text-align: center; width: 100%;
  animation: welcomeHeroEnter 0.7s var(--spring) both;
}
@keyframes welcomeHeroEnter {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

.welcome-hero-label {
  font-size: 11px; font-weight: 600; letter-spacing: 4px;
  color: var(--text-secondary); margin-bottom: 6px;
}
.welcome-hero-name {
  font-size: clamp(36px, 5.5vw, 68px);
  font-weight: 800; letter-spacing: -2px;
  color: var(--text-primary);
  text-shadow: 0 4px 32px rgba(0,0,0,0.5);
  line-height: 1;
}
.welcome-hero-msg {
  font-size: 14px; font-weight: 400;
  color: var(--text-secondary); margin-top: 8px;
}

/* ══════════════════════════════════════════
   WELCOME — CARD
══════════════════════════════════════════ */
.welcome-card {
  display: flex; align-items: center; gap: 20px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px; padding: 22px 28px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(0,0,0,0.06);
  animation: cardEnter 0.65s 0.1s var(--spring) both;
}
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.welcome-avatar {
  width: 68px; height: 68px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(74,158,255,0.5), rgba(100,80,220,0.4));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: white; flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(74,158,255,0.32), inset 0 1.5px 0 rgba(255,255,255,0.4);
  animation: avatarPop 0.6s 0.2s var(--spring) both;
}
@keyframes avatarPop {
  from { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  to   { transform: scale(1)   rotate(0);     opacity: 1; }
}

.welcome-info { flex: 1; }
.welcome-college { font-size: 15px; color: rgba(160,210,255,0.9); font-weight: 600; }
.welcome-type {
  display: inline-block; margin-top: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: white;
  background: rgba(74,158,255,0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px; padding: 5px 14px;
}

.welcome-stats {
  display: flex; align-items: center; gap: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px; overflow: hidden;
}
.stat-item { display: flex; flex-direction: column; align-items: center; padding: 10px 18px; gap: 2px; }
.stat-sep  { width: 1px; height: 36px; background: rgba(255,255,255,0.1); }
.stat-val  { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1; letter-spacing: -0.5px; }
.stat-lbl  { font-size: 10px; color: var(--text-secondary); font-weight: 500; white-space: nowrap; }

/* ══════════════════════════════════════════
   PURPOSE — APPLE TAB BAR
══════════════════════════════════════════ */
.purpose-section {
  width: 100%;
  animation: purposeEnter 0.65s 0.2s var(--spring) both;
}
@keyframes purposeEnter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.purpose-label {
  font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
  color: var(--text-secondary); text-align: center; margin-bottom: 14px;
}

.purpose-tabbar {
  display: flex;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 24px; padding: 7px; gap: 5px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22), inset 0 1.5px 0 rgba(255,255,255,0.18);
  width: 100%;
}

.purpose-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: transparent; border: none; border-radius: 18px;
  padding: 16px 8px; cursor: pointer;
  transition: all 0.3s var(--spring);
  color: var(--text-secondary);
}
.purpose-card:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  transform: translateY(-2px);
}
.purpose-card:active { transform: scale(0.93); transition-duration: 0.1s; }
.purpose-card.selected {
  background: rgba(255,255,255,0.17);
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(0,0,0,0.22), inset 0 1.5px 0 rgba(255,255,255,0.32), inset 0 -1px 0 rgba(0,0,0,0.06);
}
.purpose-icon {
  font-size: 26px;
  transition: transform 0.35s var(--spring);
  filter: grayscale(0.3);
}
.purpose-card.selected .purpose-icon { transform: scale(1.2); filter: grayscale(0); }
.purpose-card:hover    .purpose-icon { transform: scale(1.1); }
.purpose-text { font-size: 11px; font-weight: 500; text-align: center; line-height: 1.3; }

/* ══════════════════════════════════════════
   SUCCESS
══════════════════════════════════════════ */
.success-circle {
  width: 104px; height: 104px; border-radius: 50%;
  background: rgba(74,222,128,0.13);
  backdrop-filter: blur(24px);
  border: 2px solid rgba(74,222,128,0.45);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 60px rgba(74,222,128,0.2), inset 0 1.5px 0 rgba(255,255,255,0.2);
  animation: successPop 0.6s var(--spring) both;
}
@keyframes successPop {
  0%  { transform: scale(0.2) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg); }
  100%{ transform: scale(1) rotate(0); opacity: 1; }
}

.checkmark { width: 62px; height: 62px; }
.checkmark-circle { stroke: var(--success); stroke-width: 2; stroke-dasharray: 160; stroke-dashoffset: 160; animation: drawCircle 0.5s ease-out forwards; }
.checkmark-check  { stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: drawCheck 0.4s 0.4s ease-out forwards; }
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }

.success-content {
  text-align: center;
  animation: fadeSlideUp 0.6s 0.2s var(--spring) both;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.success-title    { font-size: clamp(52px, 8vw, 88px); font-weight: 800; color: var(--text-primary); letter-spacing: -3px; line-height: 1; }
.success-subtitle { font-size: 13px; font-weight: 700; letter-spacing: 4px; color: var(--success); margin-top: 10px; }
.success-purpose  { font-size: 24px; font-weight: 500; color: var(--text-secondary); margin-top: 16px; }
.success-msg      { font-size: 17px; color: var(--text-secondary); margin-top: 8px; }

/* ─── PROGRESS BAR COUNTDOWN ─── */
.success-timer    { display: none; } /* hidden — replaced by bar */

.countdown-bar-wrap {
  position: fixed;
  bottom: 12px; left: 50%; right: auto; transform: translateX(-50%); width: 320px;
  z-index: 100;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: hidden;
}
.countdown-bar {
  height: 100%;
  background: linear-gradient(
    to left,
    rgba(220, 53, 69, 0.85),
    rgba(255, 255, 255, 0.7),
    rgba(74, 222, 128, 0.85)
  );
  box-shadow: 0 0 14px rgba(255,255,255,0.25);
  width: 100%;
  transform-origin: left center;
  animation: countdownShrink linear forwards;
}
@keyframes countdownShrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ══════════════════════════════════════════
   ERROR
══════════════════════════════════════════ */
.error-icon-wrap {
  animation: shake 0.5s 0.1s ease both;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-10px); }
  40%     { transform: translateX(10px); }
  60%     { transform: translateX(-6px); }
  80%     { transform: translateX(6px); }
}
.error-icon   { font-size: 64px; }
.error-content { text-align: center; animation: fadeSlideUp 0.5s 0.15s var(--spring) both; }
.error-title  { font-size: 26px; font-weight: 800; color: var(--error); letter-spacing: -0.5px; }
.error-msg    { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }
.retry-btn {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 16px; padding: 14px 36px;
  color: var(--text-primary); font-size: 14px; font-weight: 600;
  cursor: pointer; margin-top: 8px;
  transition: all 0.25s var(--spring);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  animation: fadeSlideUp 0.5s 0.3s var(--spring) both;
}
.retry-btn:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px) scale(1.02); }
.retry-btn:active { transform: scale(0.96); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  position: fixed; bottom: 20px; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: transparent;
  font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,0.06);
}
.footer-sep { display: none; }

/* ══════════════════════════════════════════
   CONFETTI
══════════════════════════════════════════ */
.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px; height: 14px;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0)      rotateZ(0deg)   rotateX(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh)  rotateZ(720deg) rotateX(360deg); opacity: 0; }
}

/* Milestone toast */
.milestone-toast {
  position: fixed;
  bottom: 48px; left: 50%; top: auto;
  transform: translateX(-50%) translateY(20px);
  z-index: 998;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(32px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px;
  padding: 12px 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  font-size: 15px; font-weight: 700;
  color: white; letter-spacing: 0.3px;
  white-space: nowrap;
  opacity: 0;
  animation: milestoneToastIn 0.6s 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.milestone-toast-emoji { font-size: 24px; }
@keyframes milestoneToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.85); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
}
.milestone-toast.toast-out {
  animation: milestoneToastOut 0.5s cubic-bezier(0.34,1.2,0.64,1) forwards;
}
@keyframes milestoneToastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.88); }
}


/* ══════════════════════════════════════════
   SIDE LINES — Animated gradient
══════════════════════════════════════════ */
.side-line {
  position: fixed;
  top: 50%;
  width: 120px;
  height: 180px;
  z-index: 100;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(32px);
  animation: glowPulse 4s ease-in-out infinite;
  opacity: 0.25;
}
.side-line.left  {
  left: -40px;
  background: radial-gradient(ellipse at left, rgba(220,53,69,0.9), rgba(255,255,255,0.5), rgba(74,222,128,0.9));
}
.side-line.right {
  right: -40px;
  background: radial-gradient(ellipse at right, rgba(74,222,128,0.9), rgba(255,255,255,0.5), rgba(220,53,69,0.9));
  animation-delay: 2s;
}

@keyframes glowPulse {
  0%,100% { opacity: 0.2; transform: translateY(-50%) scaleY(1); }
  50%     { opacity: 0.32; transform: translateY(-50%) scaleY(1.1); }
}

/* ══════════════════════════════════════════
   LOGIN TOGGLE — ID vs Email
══════════════════════════════════════════ */
.login-toggle {
  position: relative;
  display: flex;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 100px;
  padding: 4px;
  animation: fadeIn 0.8s 0.15s var(--ease-out) both;
}

/* Sliding pill indicator */
.login-toggle::before {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: rgba(255,255,255,0.18);
  border-radius: 100px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.35s cubic-bezier(0.34, 1.28, 0.64, 1);
  z-index: 0;
}
.login-toggle.email-active::before {
  transform: translateX(100%);
}

.toggle-btn {
  flex: 1;
  position: relative; z-index: 1;
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 10px 24px;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: color 0.25s ease;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.toggle-btn.active { color: var(--text-primary); }
.toggle-btn:active { transform: scale(0.97); }

/* ── Input slide animations ── */
@keyframes slideOutLeft  { from { opacity:1; transform:translateX(0);     } to { opacity:0; transform:translateX(-20px); } }
@keyframes slideOutRight { from { opacity:1; transform:translateX(0);     } to { opacity:0; transform:translateX(20px);  } }
@keyframes slideInLeft   { from { opacity:0; transform:translateX(-20px); } to { opacity:1; transform:translateX(0);     } }
@keyframes slideInRight  { from { opacity:0; transform:translateX(20px);  } to { opacity:1; transform:translateX(0);     } }

.rfid-input.slide-out-left  { animation: slideOutLeft  0.2s var(--ease-out) forwards; }
.rfid-input.slide-out-right { animation: slideOutRight 0.2s var(--ease-out) forwards; }
.rfid-input.slide-in-left   { animation: slideInLeft   0.3s var(--spring)   forwards; }
.rfid-input.slide-in-right  { animation: slideInRight  0.3s var(--spring)   forwards; }

/* ══════════════════════════════════════════
   ADMIN LOGIN MODAL
══════════════════════════════════════════ */
.admin-modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: overlayIn 0.3s ease both;
}
.admin-modal-overlay.hidden { display: none; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.admin-modal {
  width: 100%; max-width: 400px;
  background: rgba(15, 25, 50, 0.75);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: modalIn 0.45s var(--spring) both;
  position: relative;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.admin-modal-header { text-align: center; margin-bottom: 28px; }

.admin-modal-logo {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 0 4px rgba(255,255,255,0.05);
}
.admin-modal-logo img { width: 100%; height: 100%; object-fit: contain; }

.admin-modal-title {
  font-size: 20px; font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.5px;
}
.admin-modal-sub {
  font-size: 12px; color: var(--text-secondary);
  letter-spacing: 0.5px; margin-top: 4px;
}

.admin-modal-close {
  position: absolute; top: 18px; right: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%; width: 30px; height: 30px;
  color: var(--text-secondary); font-size: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--spring);
}
.admin-modal-close:hover { background: rgba(255,255,255,0.15); color: var(--text-primary); transform: scale(1.1); }

.admin-modal-body { display: flex; flex-direction: column; gap: 12px; }

.admin-input-wrap {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px; padding: 14px 18px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.admin-input-wrap:focus-within {
  border-color: rgba(74,158,255,0.6);
  box-shadow: 0 0 0 3px rgba(74,158,255,0.15);
}
.admin-input-icon { font-size: 16px; flex-shrink: 0; }
.admin-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
}
.admin-input::placeholder { color: var(--text-dim); }

.admin-error {
  font-size: 12px; color: var(--error);
  text-align: center; padding: 8px 16px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 10px;
  animation: shake 0.4s ease;
}
.admin-error.hidden { display: none; }

.admin-login-btn {
  margin-top: 4px;
  background: rgba(74,158,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px; padding: 15px;
  color: white; font-size: 15px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.5px;
  transition: all 0.25s var(--spring);
  box-shadow: 0 4px 20px rgba(74,158,255,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}
.admin-login-btn:hover {
  background: rgba(74,158,255,1);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(74,158,255,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}
.admin-login-btn:active { transform: scale(0.97); }
.admin-login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
@keyframes modalOut  { from { opacity:1; transform: scale(1) translateY(0); } to { opacity:0; transform: scale(0.9) translateY(16px); } }
@keyframes overlayOut { from { opacity:1; } to { opacity:0; } }

/* ── Admin Modal — Google Button ── */
.admin-divider {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.25); font-size: 12px;
  margin: 4px 0;
}
.admin-divider::before, .admin-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.1);
}
.admin-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 13px 20px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.admin-google-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}
.admin-google-btn img { width: 20px; height: 20px; }

.google-error-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.35);
  color: #f87171;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  backdrop-filter: blur(10px);
  text-align: center;
  max-width: 420px;
  width: 90%;
}
.google-error-toast.hidden { display: none; }