:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0f766e;
  --accent-h: #0d9488;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #ccfbf1 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e0f2fe 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 48px;
}

header {
  text-align: center;
  margin-bottom: 28px;
  max-width: 420px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.panel {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.panel + .panel,
.bin-panel {
  margin-top: 18px;
}

.bin-panel h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.bin-lead {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 7px;
}

.bin-row {
  display: flex;
  gap: 8px;
}

#bin-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 12px 12px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}

#bin-input:focus {
  border-color: var(--accent);
}

#bin-submit {
  flex: 0 0 auto;
  border: none;
  border-radius: 9px;
  background: var(--text);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

#bin-submit:hover:not(:disabled) {
  opacity: 0.88;
}

#bin-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field-hint {
  margin-top: 7px;
  font-size: 0.75rem;
  color: var(--muted);
}

#bin-result {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  padding: 12px 14px;
}

#bin-result.error {
  background: var(--error-bg);
  border-color: #fecaca;
  color: var(--error);
  font-size: 0.9rem;
}

.bin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.bin-item {
  min-width: 0;
}

.bin-item.full {
  grid-column: 1 / -1;
}

.bin-item .k {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 2px;
}

.bin-item .v {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.bin-item .v.muted {
  font-weight: 500;
  color: var(--muted);
}

.note {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 20px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}

#payment-element {
  margin-bottom: 18px;
  min-height: 48px;
}

button#submit {
  width: 100%;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

button#submit:hover:not(:disabled) {
  background: var(--accent-h);
}

button#submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#status {
  margin-top: 18px;
  display: none;
  border-radius: 9px;
  padding: 14px 14px;
  font-size: 0.95rem;
  line-height: 1.45;
}

#status.visible {
  display: block;
}

#status.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

#status.error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #fecaca;
}

#status .title {
  font-weight: 700;
  margin-bottom: 4px;
}

#status .meta {
  font-size: 0.85rem;
  opacity: 0.9;
}

footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  max-width: 420px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
