:root {
  --bg: #070913;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(124, 58, 237, 0.4);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

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

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 40%);
  background-attachment: fixed;
  padding: 2rem 1rem;
}

body.app-loading > * {
  visibility: hidden;
}

body.app-ready > * {
  animation: appReveal 0.22s ease-out;
}

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

h1,
h2,
h3,
h4 {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
}

.container {
  width: 100%;
  max-width: 620px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.logo-icon {
  font-size: 28px;
}

.title {
  font-size: 2.25rem;
  background: linear-gradient(to right, #ffffff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #e5e7eb;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.form-control {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.875rem 1rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control.has-prefix {
  padding-left: 2rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
  background-color: rgba(255, 255, 255, 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
  padding: 0.875rem 1.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

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

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

.btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.input-action-group {
  display: flex;
  gap: 0.75rem;
}

.input-action-group .form-control {
  flex: 1;
}

.status-msg {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-msg.success {
  color: var(--success);
}
.status-msg.error {
  color: var(--error);
}
.status-msg.warning {
  color: var(--warning);
}
.status-msg.loading {
  color: var(--text-muted);
}

/* Tabs styling */
.tabs {
  display: flex;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background-color: var(--surface-hover);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

/* Keys list display */
.keys-box {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1rem;
  font-family: monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  max-height: 250px;
  white-space: pre-wrap;
  word-break: break-all;
}

.alert {
  padding: 1rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 1.5rem 0;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.alert-info {
  background-color: rgba(6, 182, 212, 0.05);
  border-color: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
}

.price-tag {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin: 1.5rem 0;
  font-family: "Outfit", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.price-sub {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  font-family: "Plus Jakarta Sans", sans-serif;
}

.divider {
  height: 1px;
  background-color: var(--border);
  margin: 2rem 0;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.flex-actions {
  display: flex;
  gap: 0.75rem;
}

.flex-actions > * {
  flex: 1;
}

/* Key displays specifically format */
.key-item {
  margin-bottom: 0.5rem;
}
.key-item:last-child {
  margin-bottom: 0;
}
.key-label {
  color: var(--accent);
  font-weight: bold;
}

/* Toast overlay */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-color: var(--success);
}
.toast-error {
  border-color: var(--error);
}

.footer {
  margin-top: 2rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.75;
  font-family: "Plus Jakarta Sans", sans-serif;
  transition: opacity 0.2s ease;
}

.footer:hover {
  opacity: 1;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--accent-hover);
}

.result-container {
  text-align: center;
}

.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  margin-bottom: 1rem;
  font-weight: 700;
}

.result-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--success);
}

.result-details {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
  text-align: left;
}

.result-details div {
  display: grid;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.result-details dt {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.result-details dd {
  overflow-wrap: anywhere;
  font-family: monospace;
}

.result-action {
  width: 100%;
}

@media (max-width: 640px) {
  body {
    justify-content: flex-start;
    padding: 1rem;
  }

  .container {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .input-action-group,
  .flex-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
