/* The account page's plan card: the plan's name, its line and its actions,
   the usage rings once there is a budget to spend, and the free plan's
   picture of a network that ends at your own walls. */

.plan-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: clamp(26px, 3.4vw, 44px);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--highlight);
}

/* A paid plan: lifted by a hairline of the tint (account.js adds .aurora). */
.plan-card.aurora {
  box-shadow: var(--highlight), 0 0 0 1px var(--tint-line), var(--shadow-float);
}

@media (min-width: 860px) {
  .plan-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.plan-kicker {
  color: var(--label-2);
  font-size: var(--footnote);
  font-weight: 510;
}

.plan-name {
  margin-top: 4px;
  font-size: clamp(2.75rem, 1.8rem + 3.4vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--track-display);
}

.plan-line {
  margin-top: 16px;
  color: var(--label);
  font-size: var(--headline);
  font-weight: 600;
}

.plan-sub {
  max-width: 54ch;
  margin-top: 6px;
  font-size: var(--callout);
}

/* Change subscription goes under Manage subscription, as a stack as wide as
   the wider label; on a phone, the card's width. */
.plan-card .actions {
  display: grid;
  justify-content: start;
  margin-top: 28px;
}

@media (max-width: 560px) {
  .plan-card .actions {
    justify-content: stretch;
  }
}

/* The usage rings: how much of the plan is spent, the way the Plan sheet says
   it, in the tint and the running green. */
.meters {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 40px);
  justify-content: center;
}

.meter {
  --tone: var(--tint);
  position: relative;
  width: 140px;
  padding-bottom: 44px;
}

.meter.is-mint {
  --tone: var(--green);
}

.meter.is-over {
  --tone: var(--orange);
}

.ring {
  width: 140px;
  height: 140px;
  overflow: visible;
  rotate: -90deg;
}

.ring circle {
  fill: none;
  stroke-width: 9;
}

.ring-track {
  stroke: var(--fill-2);
}

.ring-fill {
  stroke: var(--tone);
  stroke-dasharray: 100 100;
  stroke-dashoffset: calc(100 - 100 * var(--fill, 0));
  stroke-linecap: round;
  transition: stroke-dashoffset 1200ms var(--ease-out-soft) 200ms;
}

/* A round cap on a zero-length dash still paints a dot. */
.meter.is-empty .ring-fill {
  opacity: 0;
}

.meter figcaption {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  height: 140px;
  line-height: 1.1;
}

.meter b {
  color: var(--label);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: var(--track-title);
  font-variant-numeric: tabular-nums;
}

.meter figcaption > span {
  color: var(--label-2);
  font-size: var(--footnote);
}

.meter small {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  left: -8px;
  color: var(--label-2);
  font-size: var(--footnote);
  line-height: 1.35;
  text-align: center;
}

/* The free plan's picture is the plans page's Free tier (plans-art.css), so it moves the same way. */
.lan-art {
  justify-self: center;
  width: min(100%, 320px);
}

.lan-art svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.lan-caption {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  color: var(--label-2);
  font-size: var(--footnote);
}

@media (prefers-reduced-motion: reduce) {
  .ring-fill {
    transition: none;
  }
}
