@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg: #07070f;
  --surface: rgba(255,255,255,0.05);
  --surface2: rgba(255,255,255,0.03);
  --surface-solid: #0f0f1e;
  --border: rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.14);

  --violet: #8b5cf6;
  --violet-light: #a78bfa;
  --violet-bright: #c4b5fd;
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --coral: #ff4d6d;
  --green: #10b981;
  --green-light: #34d399;
  --yellow: #f59e0b;
  --yellow-light: #fbbf24;
  --red: #ef4444;

  /* legacy compat */
  --accent: #8b5cf6;
  --accent2: #06b6d4;

  --text: #f0f0ff;
  --muted: #7070a0;
  --muted-bright: #9090c0;
  --radius: 16px;
  --shadow: 0 8px 40px rgba(0,0,0,0.6);
}

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

/* Animated mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 40%, rgba(139,92,246,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(6,182,212,0.14) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 60% 85%, rgba(255,77,109,0.08) 0%, transparent 45%);
  animation: meshDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

@keyframes meshDrift {
  0%   { opacity: 1; transform: scale(1) translate(0,0); }
  33%  { transform: scale(1.04) translate(-1%, 1%); }
  66%  { transform: scale(0.98) translate(1%, -0.5%); }
  100% { opacity: 0.85; transform: scale(1.06) translate(-0.5%, 0.5%); }
}

h1 { font-family: 'Syne', sans-serif; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; }
h2 { font-family: 'Syne', sans-serif; font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: .01em; }

.card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-top-color: var(--border-bright);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
  width: 100%;
  max-width: 480px;
}

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, opacity .2s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: .02em;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(.95) !important; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, #6d28d9, var(--violet), #a78bfa);
  color: #fff;
  box-shadow: 0 4px 24px rgba(139,92,246,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:not(:disabled):hover {
  box-shadow: 0 8px 36px rgba(139,92,246,0.65), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border-bright);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.btn-success {
  background: linear-gradient(135deg, #047857, var(--green), var(--green-light));
  color: #fff;
  box-shadow: 0 4px 24px rgba(16,185,129,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-success:not(:disabled):hover {
  box-shadow: 0 8px 36px rgba(16,185,129,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c, var(--red), #f87171);
  color: #fff;
  box-shadow: 0 4px 24px rgba(239,68,68,0.35);
}

.btn-cyan {
  background: linear-gradient(135deg, #0e7490, var(--cyan), var(--cyan-light));
  color: #fff;
  box-shadow: 0 4px 24px rgba(6,182,212,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-cyan:not(:disabled):hover {
  box-shadow: 0 8px 36px rgba(6,182,212,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-lg { padding: 1.1rem 2.25rem; font-size: 1.15rem; border-radius: 14px; }
.btn-full { width: 100%; }

/* ── Inputs ───────────────────────────────── */
input, select {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border-bright);
  color: var(--text);
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.2);
}
input::placeholder { color: var(--muted); }
select option { background: #1a1a2e; }

/* ── Logo & PIN ───────────────────────────── */
.logo {
  font-family: 'Syne', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--violet-bright), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  filter: drop-shadow(0 0 24px rgba(139,92,246,0.5));
}

.pin {
  font-family: 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: .4rem;
  background: linear-gradient(135deg, var(--violet-bright), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(139,92,246,0.6));
}

/* ── Badges ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .3rem .9rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.badge-purple {
  background: rgba(139,92,246,.18);
  color: var(--violet-bright);
  border: 1px solid rgba(139,92,246,.35);
  box-shadow: 0 0 12px rgba(139,92,246,.2);
}
.badge-cyan {
  background: rgba(6,182,212,.15);
  color: var(--cyan-light);
  border: 1px solid rgba(6,182,212,.3);
  box-shadow: 0 0 12px rgba(6,182,212,.2);
}
.badge-red {
  background: rgba(239,68,68,.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.3);
}

/* ── Utils ────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.w-full { width: 100%; }

/* ── Animations ───────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.06); }
}
@keyframes popIn {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes countdown {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 283; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px); }
}

.fade-in { animation: fadeIn .35s cubic-bezier(.22,1,.36,1); }
