:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #647086;
  --line: #dce3ed;
  --accent: #167c80;
  --accent-strong: #0e5f63;
  --danger: #b42318;
  --success: #0f7a42;
  --warning: #9a5b00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent-strong);
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
}

.topbar a {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 16px;
}

.topbar nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.container,
.auth-container {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px;
}

.auth-container {
  align-items: center;
  display: flex;
  min-height: 100vh;
  max-width: 460px;
}

.auth-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  width: 100%;
}

.hero {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 22px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 12px;
}

h2 {
  font-size: 22px;
}

h4 {
  font-size: 17px;
  margin-bottom: 10px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 18px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-group {
  margin-top: 20px;
}

.plan-group:first-of-type {
  margin-top: 14px;
}

.plan-group h3 {
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  margin-bottom: 14px;
  padding-bottom: 8px;
}

.plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.price {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

.inline-form {
  display: inline-grid;
}

.spaced-form {
  margin-top: 18px;
}

label {
  color: var(--ink);
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 9px 11px;
  width: 100%;
}

button,
.button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  text-decoration: none;
  width: fit-content;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary,
.ghost {
  background: #ffffff;
  color: var(--accent-strong);
}

.danger {
  background: #ffffff;
  border-color: #f2c7c2;
  color: var(--danger);
}

.small {
  font-size: 13px;
  min-height: 34px;
  padding: 6px 10px;
}

.details {
  display: grid;
  gap: 8px;
  grid-template-columns: 130px minmax(0, 1fr);
  margin: 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
  word-break: break-word;
}

.subscription-summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.subscription-summary:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.flash {
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.flash.success {
  background: #eaf8f0;
  color: var(--success);
}

.flash.error {
  background: #fff0ef;
  color: var(--danger);
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
}

.badge.active,
.badge.paid {
  background: #eaf8f0;
  color: var(--success);
}

.badge.pending,
.badge.for_authentication {
  background: #fff6df;
  color: var(--warning);
}

.badge.failed,
.badge.past_due,
.badge.cancelled {
  background: #fff0ef;
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
}

pre,
code {
  background: #eef3f8;
  border-radius: 4px;
  padding: 2px 4px;
}

.checkout {
  max-width: 720px;
}

.card-list {
  display: grid;
  gap: 12px;
}

.saved-card {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
}

.saved-card p {
  margin-bottom: 6px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 820px) {
  .container {
    padding: 18px;
  }

  .hero,
  .section-head {
    display: grid;
  }

  .two,
  .three,
  .plans {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
