:root {
  --bg-color: #030014;
  --bg-accent: #0f0728;
  --panel-bg: rgba(15, 7, 40, 0.45);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-hover: rgba(255, 255, 255, 0.15);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --secondary: #1e1b4b;
  --secondary-hover: #2e266f;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --input-bg: rgba(255, 255, 255, 0.03);
  --input-border: rgba(255, 255, 255, 0.1);
  --radius: 24px;
  --radius-sm: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
  position: relative;
}

.bg-animated {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 40%);
  z-index: -2;
  animation: pulse-bg 15s infinite alternate ease-in-out;
}

.bg-glow {
  position: fixed;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 40vh;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.2), transparent 70%);
  filter: blur(80px);
  z-index: -1;
}

@keyframes pulse-bg {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.05) translate(2%, 2%); }
  100% { transform: scale(1) translate(-2%, -2%); }
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 60px 0 80px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slide-down {
  animation: slide-down 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-down {
  0% { opacity: 0; transform: translateY(-30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-chip {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 99px;
  color: #c4b5fd;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  margin: 20px 0 0;
  max-width: 600px;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.layout {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}

.panel {
  padding: 36px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color var(--transition);
}

.panel:hover {
  border-color: var(--panel-border-hover);
}

.panel-form {
  display: grid;
  gap: 28px;
}

.form-stagger > * {
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.form-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.form-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.form-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.form-stagger > *:nth-child(5) { animation-delay: 0.5s; }

@keyframes fade-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.field {
  display: grid;
  gap: 12px;
}

.label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: #fff;
  min-height: 56px;
  padding: 0 18px;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

.input:focus, .input:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(139, 92, 246, 0.5);
}

.input:focus {
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.select-wrapper {
  position: relative;
}

.select-input {
  appearance: none;
  padding-right: 48px;
  cursor: pointer;
  height: 56px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-input option {
  background-color: var(--bg-color);
  color: var(--text-main);
  white-space: nowrap;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  transition: transform var(--transition);
}

.select-wrapper:focus-within::after {
  transform: translateY(-50%) rotate(180deg);
}

.hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.quick-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  cursor: pointer;
  min-width: 60px;
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
}

.quick-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.quick-btn:active {
  transform: translateY(0);
}

.inline-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.action-btn {
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 56px;
  padding: 0 24px;
  font-weight: 600;
  font-size: 1.05rem;
  font-family: inherit;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-icon {
  width: 20px;
  height: 20px;
}

.primary-btn {
  width: 100%;
  color: #fff;
  background: var(--primary);
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  box-shadow: 0 8px 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(139, 92, 246, 0.45);
}

.primary-btn:hover:not(:disabled)::after {
  opacity: 1;
  transform: scale(1);
}

.secondary-btn {
  color: var(--primary-hover);
  background: var(--secondary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.secondary-btn:hover {
  background: var(--secondary-hover);
  border-color: var(--primary);
  color: #fff;
}

.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(1);
  box-shadow: none;
  transform: none;
}

.actions {
  display: flex;
  margin-top: 10px;
}

.status-box {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  border: 1px solid transparent;
  animation: fade-in 0.3s ease;
  font-weight: 500;
}

.status-box.is-success {
  color: #34d399;
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.2);
}

.status-box.is-info {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.status-box.is-error {
  color: #f87171;
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.2);
}

.panel-preview {
  display: grid;
  align-content: start;
  gap: 24px;
}

.fade-in {
  animation: fade-in 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 60px 30px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.preview-state {
  display: grid;
  gap: 24px;
  animation: scale-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scale-up {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.qr-container {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
}

.qr-frame {
  position: relative;
  min-height: 320px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #7c3aed;
  box-shadow: 0 0 10px 2px #a78bfa;
  animation: scan 3s infinite linear;
  z-index: 2;
  opacity: 0.7;
}

@keyframes scan {
  0% { top: -10%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 110%; opacity: 0; }
}

.qr-image {
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.summary-grid {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition);
}

.summary-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sr-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.sr-val {
  color: #fff;
  max-width: 65%;
  text-align: right;
  word-break: break-word;
}

.mono-val {
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.05em;
  color: #c4b5fd;
}

.amount-val {
  font-weight: 700;
  color: #34d399;
  font-size: 1.1rem;
}

.highlight-val {
  font-weight: 600;
  color: #f8fafc;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1200px);
    padding-top: 30px;
    padding-bottom: 50px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .panel {
    padding: 24px;
  }

  .inline-input {
    grid-template-columns: 1fr;
  }

  .select-input {
    font-size: 0.95rem;
  }
  
  .action-btn {
    width: 100%;
  }

  .summary-row {
    flex-direction: column;
    gap: 6px;
  }

  .sr-val {
    max-width: 100%;
    text-align: left;
  }

  .qr-frame {
    min-height: 260px;
  }
}
