/* ── Variables ─────────────────────────────────────────── */
:root {
  --purple:       #0d004d;
  --purple-mid:   #1a0080;
  --purple-light: #3d0099;
  --purple-pale:  #f0ecff;
  --accent:       #6633cc;
  --white:        #ffffff;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --border:       #d1c4e9;
  --radius:       16px;
  --shadow:       0 8px 40px rgba(13,0,77,0.15);
}

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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #e0d7ff 100%);
  min-height: 100vh;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
  background: var(--purple);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 12px rgba(13,0,77,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.logo {
  height: 28px;
  /* Force the SVG fills white for dark header */
  filter: brightness(0) invert(1);
}

.header-tagline {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  letter-spacing: 0.5px;
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 20px;
  margin-left: 4px;
}

/* ── Main ──────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--purple);
  text-align: center;
  padding: 16px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════════
   SCANNER PAGE
══════════════════════════════════════════════════════════ */
.scanner-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.scanner-card {
  background: var(--white);
  border-radius: 24px;
  padding: 48px 40px 40px;
  text-align: center;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
}

.scanner-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 8px;
}

.scanner-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* ── Rings (ambient glow) ──────────────────────────────── */
.scanner-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(13,0,77,0.08);
  animation: ringPulse 3s ease-in-out infinite;
}
.ring-1 { width: 240px; height: 240px; animation-delay: 0s; }
.ring-2 { width: 200px; height: 200px; animation-delay: 0.4s; }
.ring-3 { width: 160px; height: 160px; animation-delay: 0.8s; }

@keyframes ringPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 0.9; transform: scale(1.03); }
}

/* ── Scanner Button ────────────────────────────────────── */
.scanner-button {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1a0070, #0d004d);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 6px rgba(13,0,77,0.1),
    0 8px 32px rgba(13,0,77,0.35);
  transition: box-shadow 0.2s, transform 0.15s;
  user-select: none;
  -webkit-user-select: none;
  z-index: 1;
}

.scanner-button:hover {
  box-shadow:
    0 0 0 8px rgba(13,0,77,0.15),
    0 12px 40px rgba(13,0,77,0.45);
  transform: scale(1.02);
}

.scanner-button.scanning {
  animation: scannerPulse 0.6s ease-in-out infinite alternate;
}

@keyframes scannerPulse {
  from { box-shadow: 0 0 0 6px rgba(13,0,77,0.2), 0 8px 32px rgba(13,0,77,0.4); }
  to   { box-shadow: 0 0 0 18px rgba(13,0,77,0.05), 0 12px 48px rgba(102,51,204,0.5); }
}

/* ── Progress ring (SVG overlay) ──────────────────────── */
.scanner-progress {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(#a78bfa 0%, transparent 0%);
  border-radius: 50%;
  transition: none;
  pointer-events: none;
  /* mask the center out so only a ring shows */
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
}

/* ── Icon inside scanner ───────────────────────────────── */
.scanner-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.fingerprint-icon {
  width: 64px;
  height: 64px;
  color: rgba(255,255,255,0.85);
  transition: color 0.3s;
}

.scanner-button.scanning .fingerprint-icon {
  color: #a78bfa;
  animation: scanLines 0.4s linear infinite;
}

@keyframes scanLines {
  0%   { clip-path: inset(0 0 100% 0); }
  100% { clip-path: inset(0 0 0% 0); }
}

.scan-status-text {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.scanner-button.scanning .scan-status-text {
  color: #c4b5fd;
}

.scanner-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Scan Overlay (success flash) ─────────────────────── */
.scan-overlay {
  position: fixed;
  inset: 0;
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 999;
}

.scan-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.scan-overlay-content {
  text-align: center;
  color: var(--white);
}

.scan-success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.overlay-text {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.overlay-subtext {
  font-size: 14px;
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════
   REGISTER PAGE
══════════════════════════════════════════════════════════ */
.register-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.register-card {
  background: var(--white);
  border-radius: 24px;
  padding: 48px 40px 44px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 460px;
}

.register-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
}

.register-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--purple);
  text-align: center;
  margin-bottom: 6px;
}

.register-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 36px;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: 0.2px;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102,51,204,0.12);
  background: var(--white);
}

.form-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 2px;
}

.submit-btn {
  margin-top: 8px;
  padding: 15px;
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(13,0,77,0.25);
}

.submit-btn:hover {
  background: var(--purple-mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13,0,77,0.35);
}

.submit-btn:active {
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════
   SUCCESS PAGE
══════════════════════════════════════════════════════════ */
.success-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.success-card {
  background: var(--white);
  border-radius: 24px;
  padding: 52px 40px 44px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.success-icon-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 28px;
}

.success-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.success-circle svg {
  width: 44px;
  height: 44px;
}

.success-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px solid rgba(13,0,77,0.2);
  animation: successRing 1.8s ease-out infinite;
}

@keyframes successRing {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

.success-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 24px;
}

.success-message-box {
  background: var(--purple-pale);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 36px;
}

.success-message {
  font-size: 15px;
  color: var(--purple);
  font-weight: 500;
  line-height: 1.6;
}

/* ── Submitted details ─────────────────────────────────── */
.success-details {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
  text-align: left;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--purple);
}

/* ── Steps ─────────────────────────────────────────────── */
.success-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-pending .step-num {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-muted);
}

.step-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 70px;
  text-align: center;
}

.step:not(.step-pending) .step-text {
  color: var(--purple);
}

.step-connector {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin-bottom: 18px;
}

/* ── Back button ───────────────────────────────────────── */
.back-btn {
  display: inline-block;
  padding: 13px 32px;
  background: transparent;
  border: 2px solid var(--purple);
  border-radius: 10px;
  color: var(--purple);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.back-btn:hover {
  background: var(--purple);
  color: var(--white);
}

/* ── Scanner divider + status button ──────────────────── */
.scanner-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.scanner-divider::before,
.scanner-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.status-check-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border: 2px solid var(--purple);
  border-radius: 10px;
  color: var(--purple);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.status-check-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.status-check-btn:hover {
  background: var(--purple);
  color: var(--white);
  transform: translateY(-1px);
}

/* ── Back link ─────────────────────────────────────────── */
.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--purple); }

/* ── Status error box ──────────────────────────────────── */
.status-error-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 24px;
}
.status-error-box svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.status-error-box p {
  font-size: 13px;
  color: #dc2626;
  line-height: 1.5;
}

/* ── Status result badges ──────────────────────────────── */
.status-badge-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
}

.status-badge-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.status-badge-circle svg { width: 44px; height: 44px; }

.paid-circle    { background: #16a34a; }
.pending-circle { background: #d97706; }

.paid-pulse, .pending-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  animation: successRing 1.8s ease-out infinite;
}
.paid-pulse    { border: 3px solid rgba(22,163,74,0.3); }
.pending-pulse { border: 3px solid rgba(217,119,6,0.3); }

.paid-title    { color: #16a34a; }
.pending-title { color: #d97706; }

/* ── Status pill ───────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 24px;
}
.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.paid-pill    { background: #dcfce7; color: #16a34a; }
.paid-pill .pill-dot    { background: #16a34a; }
.pending-pill { background: #fef3c7; color: #d97706; }
.pending-pill .pill-dot { background: #d97706; }

/* ── Status message box colour overrides ───────────────── */
.paid-box    { background: #f0fdf4; border-color: #bbf7d0; }
.pending-box { background: #fffbeb; border-color: #fde68a; }
.paid-box    .success-message { color: #166534; }
.pending-box .success-message { color: #92400e; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .scanner-card,
  .register-card,
  .success-card { padding: 36px 24px; }

  .scanner-card { padding-top: 36px; }

  .header-tagline { display: none; }
}
