body {
  padding: var(--size-5);
}

header {
  display: flex;
  align-items: center;
  gap: var(--size-2);
}

main {
  width: 100%;
  max-width: var(--width-sm);
  margin-inline: auto;
  padding-block: var(--size-6) var(--size-10);

  h1 {
    display: flex;
    align-items: center;
    gap: var(--size-3);
    font-size: var(--scale-fluid-5);
    letter-spacing: var(--letter-sm);
    margin-bottom: var(--size-3);
  }
}

/* the indexable intro above the configurator: real copy so the page isn't a
   bare picker. Mirrors the home hero's tagline — muted, a notch smaller. */
.lede {
  font-size: var(--scale-fluid-1);
  color: var(--muted-foreground);
  max-width: var(--prose-sm);
  line-height: var(--line-md);
  margin-bottom: var(--size-6);
}

/* the configurator card: option rows, then a divider, then the order
   summary (price, what the selection buys, buy button) */
#plan-selector {
  display: flex;
  flex-direction: column;
  gap: var(--size-5);
  padding: var(--size-6);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

@media (max-width: 480px) {
  #plan-selector {
    padding: var(--size-4);
  }
}

/* micro-label shared by the option rows and the price: tiny uppercase
   caption with a leading icon */
#plan-selector .label {
  display: inline-flex;
  align-items: center;
  gap: var(--size-1);
  font-size: var(--scale-000);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--letter-lg);
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.option-row {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);

  [role='group'] {
    display: flex;
    flex-wrap: wrap;
    gap: var(--size-2);
  }

  button {
    position: relative;
    padding: var(--size-2) var(--size-4);
    cursor: pointer;
    border-radius: var(--radius-sm);
    /* 2px on every state so toggling solid/dotted never shifts layout */
    border: 2px solid var(--border);
    background-color: var(--background);
    color: var(--foreground);
    font-weight: var(--weight-medium);
    transition: background-color 0.15s ease, border-color 0.15s ease,
      opacity 0.15s ease;

    &:hover:not(.selected) {
      background-color: var(--accent);
      border-color: var(--muted-foreground);
    }

    &.selected {
      border-color: var(--primary);
      background-color: var(--primary-muted);
      color: var(--primary-muted-foreground);
    }

    /* the dotted border + muted text carry the "unavailable" meaning in
       both themes. --unavailable-foreground is lighter than the body text
       (zinc-600 in light, zinc-400 in dark) so the chip reads as clearly
       muted while still clearing the 4.5:1 AA floor. Don't dim with opacity:
       it sinks the label below AA. The button stays clickable (it repairs
       the combo) and still wakes up via the shared :hover rule. */
    &.unavailable {
      border-style: dotted;
      color: var(--unavailable-foreground);
    }
  }
}

/* the optional "where are you going?" coverage filter: a disclosure of country
   chips that narrow the selector to plans covering every picked country. Chips
   reuse the option-row button look; .picked mirrors .selected. */
.region-picker {
  summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--size-1);
    list-style: none;
    font-size: var(--scale-000);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--letter-lg);
    text-transform: uppercase;
    color: var(--muted-foreground);

    &::-webkit-details-marker {
      display: none;
    }

    &:hover {
      color: var(--foreground);
    }

    /* flex layout drops the browser's default disclosure marker, so draw a
       chevron and rotate it on open to signal the toggle expands */
    &::after {
      content: "";
      width: 0.45em;
      height: 0.45em;
      margin-left: auto;
      border-right: 2px solid currentColor;
      border-bottom: 2px solid currentColor;
      transform: translateY(-0.15em) rotate(45deg);
      transition: transform 0.15s ease;
    }
  }

  &[open] summary::after {
    transform: rotate(225deg);
  }

  [role='group'] {
    display: flex;
    flex-wrap: wrap;
    gap: var(--size-2);
    margin-top: var(--size-2);
  }

  .country-chip {
    padding: var(--size-1) var(--size-3);
    cursor: pointer;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background-color: var(--background);
    color: var(--foreground);
    font-weight: var(--weight-medium);
    font-size: var(--scale-000);
    transition: background-color 0.15s ease, border-color 0.15s ease;

    &:hover:not(.picked) {
      background-color: var(--accent);
      border-color: var(--muted-foreground);
    }

    &.picked {
      border-color: var(--primary);
      background-color: var(--primary-muted);
      color: var(--primary-muted-foreground);
    }
  }
}

/* shown when the picked countries share no single covering plan */
.no-coverage {
  color: var(--unavailable-foreground);
  font-weight: var(--weight-medium);
}

/* country page: links to the region shelves that also cover this country,
   shown instead of mixing multi-country plans into the single-country picker */
.regional-links {
  margin-top: var(--size-6);

  h2 {
    font-size: var(--scale-1);
    margin-bottom: var(--size-1);
  }

  > p {
    color: var(--muted-foreground);
    margin-bottom: var(--size-3);
  }

  nav {
    display: flex;
    flex-direction: column;
    gap: var(--size-2);
  }

  a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--size-3);
    padding: var(--size-3) var(--size-4);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--foreground);
    text-decoration: none;
    font-weight: var(--weight-medium);
    transition: background-color 0.15s ease, border-color 0.15s ease;

    &:hover {
      background-color: var(--accent);
      border-color: var(--muted-foreground);
    }

    .meta {
      display: flex;
      align-items: center;
      gap: var(--size-3);
    }

    /* country-count pill, inline just before the price */
    .coverage {
      padding: 0 var(--size-2);
      border-radius: var(--radius-full);
      background-color: var(--primary-muted);
      color: var(--primary-muted-foreground);
      font-size: var(--scale-000);
      font-weight: var(--weight-medium);
      line-height: 1.6;
      white-space: nowrap;
    }

    .from {
      color: var(--muted-foreground);
      font-size: var(--scale-00);
      white-space: nowrap;
    }
  }
}

/* the country-count badge on a region page's route buttons: the coverage is the
   real differentiator between region variants, so each route shows its size */
.route-coverage {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(35%, -45%);
  padding: 0 var(--size-1);
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--scale-000);
  font-weight: var(--weight-medium);
  line-height: 1.6;
  white-space: nowrap;
}

/* the order summary: caption over a big amount, mirroring the option rows
   so the whole card reads as one labeled stack */
.price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--size-2);
  padding-top: var(--size-5);
  border-top: 1px solid var(--border);

  .amount {
    font-size: var(--scale-5);
    font-weight: var(--weight-bold);
    letter-spacing: var(--letter-sm);
    line-height: var(--line-none);
    /* prices swap in place as the selection changes; keep digits steady */
    font-variant-numeric: tabular-nums;
  }
}

/* spec sheet: muted icon+label column, value column — grid keeps the
   pairs aligned no matter how long the labels run */
.plan-details {
  padding: var(--size-4);
  background-color: var(--background);
  border-radius: var(--radius-md);

  dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    gap: var(--size-2) var(--size-6);
    margin: 0;
  }

  dt {
    display: flex;
    align-items: center;
    gap: var(--size-2);
    font-size: var(--scale-00);
    color: var(--muted-foreground);
  }

  dd {
    margin: 0;
    font-weight: var(--weight-medium);
  }

  /* coverage/networks and the plan/breakout meta render in wrappers so each
     shows once per coverage group (not per data/validity variant); contents
     keeps the wrapped dt/dd as items of the dl grid above. */
  .detail-group {
    display: contents;
  }

  /* region coverage disclosure: the summary is the clickable toggle, and the
     expanded country list is set smaller to keep the box compact */
  summary {
    cursor: pointer;

    &:hover {
      color: var(--foreground);
    }
  }

  .coverage-list {
    display: block;
    margin-top: var(--size-1);
    font-size: var(--scale-00);
    font-weight: var(--weight-regular);
    color: var(--muted-foreground);
  }

  /* per-country network + speed rows inside the Networks toggle */
  .network-list {
    display: flex;
    flex-direction: column;
    gap: var(--size-1);
    margin-top: var(--size-1);
    font-size: var(--scale-00);
    font-weight: var(--weight-regular);
  }

  .network-row {
    display: flex;
    justify-content: space-between;
    gap: var(--size-4);
  }

  .network-ops {
    color: var(--muted-foreground);
    text-align: right;
  }
}

.purchase-notes {
  margin-top: var(--size-8);

  h2 {
    font-size: var(--scale-1);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--size-3);
  }

  ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--size-3);
    padding: 0;
    margin: 0;
  }

  /* icon in the left column replaces the list marker */
  li {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--size-3);
    font-size: var(--scale-00);
    color: var(--muted-foreground);

    .icon {
      color: var(--primary);
      /* center against the first text line */
      margin-top: 2px;
    }
  }
}

.buy-now {
  display: block;
  width: 100%;
  padding: var(--size-3);
  border: none;
  border-radius: var(--radius-md);
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--scale-1);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: opacity 0.15s ease;

  &:hover {
    opacity: 0.9;
  }
}

/* reassurance line under the CTA: the buying decision is made here, so we
   name Stripe right where the card details will be entered. */
.secured-by-stripe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-1);
  margin-top: var(--size-2);
  font-size: var(--scale-00);
  color: var(--muted-foreground);

  .icon {
    color: var(--success);
  }
}
