:root {
  --bg: #050508;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.14);
  --text: #f0f2f8;
  --muted: #8b93a8;
  --accent-1: #a855f7;
  --accent-2: #ec4899;
  --accent-3: #6366f1;
  --gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
  --error-bg: rgba(239, 68, 68, 0.08);
  --error-border: rgba(239, 68, 68, 0.25);
  --error-text: #fca5a5;
  --success: #34d399;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated background ── */

.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  top: -180px;
  left: -120px;
  animation-delay: 0s;
}

.orb-2 {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #db2777 0%, transparent 70%);
  bottom: -100px;
  right: -80px;
  animation-delay: -6s;
}

.orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
  top: 45%;
  left: 55%;
  animation-delay: -12s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 80%);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -25px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ── Layout ── */

.container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
}

/* ── Hero ── */

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.25rem;
}

.logo {
  position: relative;
  z-index: 1;
  width: 120px;
  height: auto;
  border-radius: 24px;
  filter: drop-shadow(0 12px 32px rgba(168, 85, 247, 0.35));
  animation: logo-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo-glow {
  position: absolute;
  inset: -20%;
  background: var(--gradient);
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  z-index: 0;
}

@keyframes logo-in {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-text {
  animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.version-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-1);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 999px;
}

h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Cards ── */

.card {
  border-radius: var(--radius);
  padding: 1.5rem;
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-subtle);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: var(--accent-1);
}

.card-header label {
  display: block;
  margin-bottom: 0.15rem;
}

.card-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

form.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Input ── */

.input-wrap {
  position: relative;
}

input[type="url"] {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="url"]::placeholder {
  color: rgba(139, 147, 168, 0.6);
}

input[type="url"]:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* ── Platform chips ── */

.platforms {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.platforms-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.platform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-bright);
  background: var(--surface-hover);
}

/* ── Buttons ── */

button {
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.2s, background 0.2s;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(168, 85, 247, 0.35);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(168, 85, 247, 0.5);
  filter: brightness(1.08);
}

.btn-arrow {
  transition: transform 0.2s;
}

.btn-primary:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

.hidden {
  display: none !important;
}

/* ── Result & error ── */

.result,
.error {
  margin-top: 1rem;
}

.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  background: var(--gradient) border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed var(--border-bright);
}

.profile h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.platform-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--gradient-subtle);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: var(--accent-1);
}

.meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

.meta a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color 0.2s;
}

.meta a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

/* ── Footer info cards ── */

.disclaimer {
  margin-top: 2.5rem;
}

.info-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.info-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-bright);
}

.info-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.info-card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Action buttons ── */

.btn-inspect {
  margin-top: 0.5rem;
  width: 100%;
  max-width: 320px;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-inspect:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.4);
}

.success-message {
  text-align: center;
}

.success-message h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
}

.success-message p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  line-height: 1.6;
}

.btn-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
  transition: filter 0.2s, box-shadow 0.2s;
}

.btn-link:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 28px rgba(168, 85, 247, 0.45);
}

/* ── Modal ── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.25s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  animation: modal-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 0;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-bright);
}

.modal-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding-top: 0.25rem;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid var(--border-bright);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.step-dot.active {
  background: var(--accent-1);
  border-color: var(--accent-1);
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

.modal-panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  padding-right: 2rem;
}

.modal-panel label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.modal-panel select {
  width: 100%;
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}

.modal-panel select:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.payment-amount {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1.25rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--gradient-subtle);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.qr-frame {
  padding: 0.75rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.qr-wrap img {
  display: block;
  border-radius: 6px;
}

.pay-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.pay-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pay-value {
  display: block;
  word-break: break-all;
  font-size: 0.78rem;
  font-family: "SF Mono", "Fira Code", monospace;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-copy,
.btn-secondary {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-copy:hover,
.btn-secondary:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.08);
}

.payment-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  color: var(--muted);
  margin: 1rem 0;
  font-size: 0.9rem;
}

.payment-status:not(.complete)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.payment-status.complete {
  color: var(--success);
  font-weight: 600;
}


.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--success);
}

#payment-step-success {
  text-align: center;
}

.success-text {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 1.25rem;
}

/* ── Responsive ── */

@media (max-width: 480px) {
  h1 {
    font-size: 1.85rem;
  }

  .logo {
    width: 96px;
  }

  .container {
    padding: 1.75rem 1rem 2.5rem;
  }

  .card {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
