:root {
  --bill-bg: #061a18;
  --bill-panel: rgba(18, 55, 49, .78);
  --bill-line: rgba(120, 211, 184, .18);
  --bill-text: #e8f4ef;
  --bill-muted: #9bb6ac;
  --bill-accent: #69e7bd;
  --bill-error: #ff8195;
}

body:has(.billing-shell) {
  min-height: 100vh;
  color: var(--bill-text);
  background: radial-gradient(ellipse at 20% 0%, #143a34 0, transparent 52%),
    linear-gradient(145deg, #071a18, #071220 80%);
  font-family: Avenir, "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* style.css gives every main element a horizontal flex layout. Billing pages
   have their own layout so their sections can keep their intended widths. */
.billing-shell {
  display: block;
  width: min(1040px, calc(100% - 36px));
  margin: 28px auto 60px;
}

.billing-auth {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  align-items: center;
  column-gap: clamp(28px, 5vw, 64px);
  row-gap: 18px;
}

.billing-auth > .billing-header,
.billing-auth > .billing-footer {
  grid-column: 1 / -1;
}

.billing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 17px 22px;
  border: 1px solid var(--bill-line);
  border-radius: 24px;
  background: rgba(14, 42, 39, .76);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 50px #03110f55;
}

.billing-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--bill-text);
  text-decoration: none;
}

.billing-link {
  flex: 0 0 auto;
  color: var(--bill-accent);
  font-weight: 700;
  text-decoration: none;
}

.billing-hero {
  width: 100%;
  max-width: 470px;
  min-width: 0;
  padding: 26px 8px;
}

.billing-hero .eyebrow,
.billing-eyebrow {
  color: var(--bill-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

.billing-hero h1 {
  margin: 10px 0 16px;
  font-size: clamp(36px, 4.3vw, 54px);
  line-height: 1.08;
  letter-spacing: -.04em;
  overflow-wrap: normal;
  word-break: normal;
}

.billing-muted,
.billing-small,
.billing-footer {
  color: var(--bill-muted);
  line-height: 1.65;
}

.billing-card,
.billing-panel {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--bill-line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(20, 57, 51, .8), rgba(11, 31, 37, .84));
  box-shadow: 0 24px 70px #020f0d55;
  backdrop-filter: blur(24px);
}

.billing-auth > .billing-card {
  width: 100%;
  max-width: 520px;
  justify-self: end;
}

.billing-tabs {
  display: flex;
  width: 100%;
  max-width: 420px;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px;
  border-radius: 15px;
  background: #071c1a;
}

.billing-tab,
.billing-secondary,
.billing-primary,
.billing-text-button {
  font: inherit;
  cursor: pointer;
}

.billing-tab {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--bill-text);
  white-space: nowrap;
}

.billing-tab.active {
  color: #a2f2d2;
  background: #21473f;
  box-shadow: inset 0 0 0 1px var(--bill-line);
}

.billing-form {
  display: grid;
  width: 100%;
  max-width: 100%;
  gap: 16px;
}

.billing-form[hidden],
.billing-subform[hidden] {
  display: none;
}

.billing-form label {
  display: grid;
  gap: 7px;
  color: #c2d5cd;
  font-size: 14px;
  font-weight: 700;
}

.billing-form input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--bill-line);
  border-radius: 12px;
  background: #071b1b;
  color: var(--bill-text);
  font: inherit;
}

.billing-form small {
  color: var(--bill-muted);
  font-weight: 400;
}

.billing-primary,
.billing-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 800;
  text-decoration: none;
}

.billing-form > .billing-primary,
.billing-form > .billing-secondary {
  width: 100%;
}

.billing-primary {
  color: #08251e;
  background: linear-gradient(110deg, #8bf3cb, #56d5ae);
}

.billing-secondary {
  color: var(--bill-text);
  border-color: var(--bill-line);
  background: #173a36;
}

.billing-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--bill-accent);
  background: transparent;
  font-weight: 700;
  letter-spacing: normal;
  text-align: left;
}

.billing-subform {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--bill-line);
}

.billing-message {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--bill-accent);
  line-height: 1.5;
}

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

.billing-notice {
  margin: 10px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--bill-line);
  border-radius: 14px;
  color: var(--bill-accent);
  background: #09302c;
}

.billing-notice > p {
  margin: 0;
  line-height: 1.5;
}

.billing-notice > .billing-primary {
  width: 100%;
  margin-top: 14px;
}

.billing-notice > .billing-primary[hidden] {
  display: none;
}

.billing-footer {
  margin: 12px 8px 24px;
  font-size: 13px;
  text-align: center;
}

.billing-dashboard {
  display: grid;
  gap: 20px;
}

.billing-dashboard .billing-hero {
  padding: 30px 8px 6px;
}

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

.billing-stat {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--bill-line);
  border-radius: 18px;
  background: #0b2725;
}

.billing-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.billing-stat span,
.billing-row-muted {
  color: var(--bill-muted);
  font-size: 13px;
}

.billing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--bill-line);
}

.billing-row:last-child {
  border-bottom: 0;
}

.billing-status {
  color: var(--bill-accent);
  font-weight: 800;
}

.billing-status.paused {
  color: #ffd181;
}

.billing-signout {
  margin-left: auto;
}

@media (max-width: 760px) {
  .billing-shell {
    width: min(100% - 22px, 560px);
    margin-top: 12px;
  }

  .billing-auth {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }

  .billing-header {
    flex-wrap: wrap;
    padding: 14px;
    border-radius: 18px;
  }

  .billing-header .brand-engine {
    display: none;
  }

  .billing-hero {
    max-width: 100%;
    padding: 30px 6px 12px;
  }

  .billing-hero h1 {
    font-size: clamp(34px, 9vw, 46px);
  }

  .billing-card,
  .billing-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .billing-auth > .billing-card {
    max-width: none;
    justify-self: stretch;
  }

  .billing-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .billing-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .billing-signout {
    width: auto;
  }
}

@media (max-width: 420px) {
  .billing-header {
    align-items: flex-start;
  }

  .billing-header .brand {
    gap: 7px;
    font-size: 14px;
  }

  .billing-header .logo {
    flex: 0 0 auto;
  }

  .billing-header > .billing-link {
    width: 100%;
  }

  .billing-tabs {
    gap: 4px;
  }

  .billing-tab {
    padding-inline: 7px;
    font-size: 14px;
  }
}
