:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 20px 16px 28px;
}

header {
  padding: 4px 0 18px;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.status {
  min-height: 22px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.amount {
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  font-size: 13px;
  font-weight: 700;
}

.pill[data-status="saved"],
.pill[data-status="active"],
.pill[data-status="completed"] {
  background: #dcfce7;
  color: #166534;
}

.pill[data-status="cancelled"],
.pill[data-status="expired"] {
  background: #fee2e2;
  color: #991b1b;
}

form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-size: 16px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(22, 163, 74, 0.22);
  border-color: var(--accent);
}

.receipt-link {
  display: none;
  padding: 0 18px 18px;
}

.receipt-link a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 18px 18px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

button.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

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

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

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #eef2ff;
  color: #3730a3;
}

.error {
  display: none;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
  font-weight: 700;
}

.done {
  display: none;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: #166534;
  background: #f0fdf4;
  font-weight: 800;
}

@media (min-width: 560px) {
  main {
    padding-top: 32px;
  }

  .summary {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

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