:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #6d28d9;
  --error: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: 'Tahoma', 'Segoe UI', system-ui, sans-serif;
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 32px 24px;
  box-shadow: 0 4px 24px rgba(109, 40, 217, 0.08);
}

.logo {
  display: block;
  height: 72px;
  width: auto;
  margin: 0 auto 12px;
}

h1 {
  font-size: 20px;
  margin: 0 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

/* `.state { display: flex }` above is an author-origin rule, which always
   wins over the UA stylesheet's `[hidden] { display: none }` regardless of
   selector specificity — so the `hidden` property showState() toggles is a
   no-op without this explicit override. */
.state[hidden] {
  display: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-message {
  color: var(--error);
}

.success-message {
  color: var(--success);
  font-weight: 600;
}

p {
  margin: 0;
  color: var(--muted);
}

#payment-form {
  width: 100%;
}

.summary {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
}

.summary-listing-title {
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
}

.summary-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.summary-amount {
  color: var(--accent);
  font-weight: 700;
  font-size: 20px;
}

/* Card form fields (numbers, MM / YY) must stay LTR inside the RTL page */
.wpwl-form {
  direction: ltr;
}
