:root {
  --bg: #0b0e14;
  --bg-card: #141926;
  --bg-input: #0e1320;
  --border: #232b3d;
  --text: #e8ecf4;
  --text-dim: #8b94a7;
  --accent: #2775ca; /* USDC blue */
  --coinbase: #0052ff;
  --stripe: #635bff;
  --error: #ff6b6b;
  --ok: #3ecf8e;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(39, 117, 202, 0.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(99, 91, 255, 0.14), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    sans-serif;
  min-height: 100vh;
}

.shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 40px;
}

.hero h1 {
  font-size: 2rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.accent {
  color: var(--accent);
}

.sub {
  color: var(--text-dim);
  margin: 0 0 28px;
  line-height: 1.5;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  flex: 1;
}

.row {
  display: flex;
  gap: 16px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

input,
select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  font-family: inherit;
}

input:focus,
select:focus {
  border-color: var(--accent);
}

input.invalid {
  border-color: var(--error);
}

.hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
  min-height: 1em;
}

.providers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.provider {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color 0.15s,
    transform 0.1s,
    opacity 0.15s;
}

.provider:hover:not(:disabled) {
  transform: translateY(-1px);
}

.provider.coinbase:hover:not(:disabled) {
  border-color: var(--coinbase);
}

.provider.stripe:hover:not(:disabled) {
  border-color: var(--stripe);
}

.provider:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.provider-name {
  font-weight: 700;
  font-size: 1rem;
}

.provider.coinbase .provider-name {
  color: #6f9dff;
}

.provider.stripe .provider-name {
  color: #a5a0ff;
}

.provider-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.provider-cta {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.error {
  color: var(--error);
  font-size: 0.85rem;
  margin: 14px 0 0;
}

.foot {
  margin-top: 22px;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

/* Stripe modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.7);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover {
  color: var(--text);
}

#onramp-element {
  min-height: 480px;
}

.modal-status {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 10px 0 0;
  text-align: center;
  min-height: 1em;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--ok);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.9rem;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media (max-width: 560px) {
  .row {
    flex-direction: column;
    gap: 0;
  }

  .providers {
    grid-template-columns: 1fr;
  }

  .shell {
    padding-top: 32px;
  }
}
