:root {
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-hover: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-active: #1e40af;
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.15);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.15);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.15);
  --border: #334155;
  --radius: 8px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

.lang-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  min-height: 36px;
  min-width: 44px;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: calc(var(--radius) - 2px);
  padding: 10px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-header-back {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.btn-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.btn-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Cards & Sections */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.gateways-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gateway-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 48px;
  transition: border-color 0.15s ease;
}

.gateway-option:hover {
  border-color: var(--text-secondary);
}

.gateway-option input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

/* Buttons */
.btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--accent-active);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
}

.btn-danger {
  background: var(--danger-bg);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-danger {
  background: var(--danger-bg);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.4);
}

.alert-warning {
  background: var(--warning-bg);
  color: #fcd34d;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

.alert-info {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(37, 99, 235, 0.4);
}

/* Order View Blocks */
.code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  gap: 12px;
}

.code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #60a5fa;
  user-select: all;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
}

.status-active {
  background: var(--success-bg);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-pending {
  background: var(--warning-bg);
  color: #fcd34d;
  border: 1px solid rgba(252, 211, 77, 0.3);
}

.status-review {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.status-neutral {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border: 1px solid var(--border);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  padding: 8px 12px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
}

.recent-item:hover,
.recent-item:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hidden {
  display: none !important;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
