/* ============================================================
   Contact Convoy: /pricing page extras. Load after site.css and
   pages-common.css. Numbers never live here or in the HTML by hand:
   cards come from the cc:plan-cards generator block, and the matrix,
   Play table and top-up packs are rebuilt from js/plan-data.js.
   ============================================================ */

/* ---------- Plan cards: hover lift + price-change flash ---------- */
.pricing-grid .price-card {
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur);
}

.pricing-grid .price-card:not(.price-card--soon):hover,
.pricing-grid .price-card:not(.price-card--soon):focus-within {
  box-shadow: var(--sh-lg);
}

.pricing-grid .price-card:not(.price-card--soon):not(.price-card--featured):hover,
.pricing-grid .price-card:not(.price-card--soon):not(.price-card--featured):focus-within {
  border-color: var(--border-strong);
}

@media (prefers-reduced-motion: no-preference) {
  .pricing-grid .price-card:not(.price-card--soon):not(.price-card--featured):hover {
    transform: translateY(-6px);
  }
  .price-card.is-updated .price-card__price {
    animation: price-flash 700ms var(--ease-out);
  }
  .billing-toggle button {
    transition: background-color var(--dur), color var(--dur), transform var(--dur-fast) var(--ease-out);
  }
  .billing-toggle button:active {
    transform: scale(0.96);
  }
}

@keyframes price-flash {
  0% {
    color: var(--accent);
    transform: translateY(-3px);
  }
  100% {
    color: inherit;
    transform: none;
  }
}

.billing-toggle {
  max-width: 100%;
  justify-content: center;
}

@media (max-width: 479px) {
  .billing-toggle {
    border-radius: var(--r-lg);
  }
}

/* ---------- Buying options (below the plan cards) ---------- */
.buy-opts {
  display: grid;
  gap: var(--sp-6);
  max-width: 1000px;
  margin: clamp(2.5rem, 1.5rem + 3vw, 4rem) auto 0;
  padding-top: clamp(2rem, 1.25rem + 2vw, 3rem);
  border-top: 1px solid var(--border);
}

.buy-opts__head {
  text-align: center;
}

.buy-opts__head h3 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-2xl);
}

.buy-opts__head p {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--text-2);
}

/* Where you buy: two cards side by side, stacked below 760 px */
.where-grid {
  display: grid;
  gap: var(--sp-5);
}

@media (min-width: 760px) {
  .where-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.where-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  /* `translate` (not `transform`) so the lift never fights Motion's reveal styles */
  transition: translate var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur);
}

.where-card--web {
  border-top: 3px solid var(--accent-bg);
}

.where-card--play {
  border-top: 3px solid var(--border-strong);
}

.where-card:hover,
.where-card:focus-within {
  box-shadow: var(--sh-md);
}

@media (prefers-reduced-motion: no-preference) {
  .where-card:hover {
    translate: 0 -4px;
  }
}

.where-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
}

.where-card__head .icon-tile {
  flex: none;
  margin: 0;
}

.where-card__head > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  min-width: 0;
}

.where-card h4 {
  margin: 0;
  font-size: var(--fs-xl);
  line-height: 1.2;
}

.where-card__sub {
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  font-size: 0.8em;
}

.where-card .play-badge {
  margin: 0;
}

.where-card .play-badge img {
  height: 40px;
}

.where-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.where-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.where-chips svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.where-list {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.where-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  color: var(--text-2);
}

.where-list svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--success);
}

.where-list strong {
  color: var(--text);
}

/* Google Play monthly prices (filled from plan-data.js) */
.play-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin: 0;
}

.play-prices[hidden] {
  display: none;
}

.play-prices__row {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.section--surface .play-prices__row {
  background: var(--surface);
}

.play-prices dt {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.play-prices dd {
  margin: 0;
  color: var(--text-2);
}

.play-prices dd strong {
  color: var(--text);
  font-size: var(--fs-xl);
  font-weight: var(--fw-black);
}

/* "Why do prices differ?" disclosure */
.why-differ {
  margin-top: auto;
  border-top: 1px dashed var(--border-strong);
  padding-top: var(--sp-3);
}

.why-differ summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 32px;
  border-radius: var(--r-sm);
  color: var(--accent);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  cursor: pointer;
  list-style: none;
}

.why-differ summary::-webkit-details-marker {
  display: none;
}

.why-differ summary::after {
  content: '';
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--dur) var(--ease-out);
}

.why-differ[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.why-differ summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.why-differ p {
  margin: var(--sp-2) 0 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

/* Promo code: compact inline field inside the Website card */
.promo-field {
  display: grid;
  gap: var(--sp-2);
  margin-top: auto;
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: box-shadow var(--dur);
}

.section--surface .promo-field {
  background: var(--surface);
}

.promo-field__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.promo-field__label svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.promo-field__row {
  display: flex;
  gap: var(--sp-2);
}

.promo-field .input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.promo-field .input::placeholder {
  text-transform: none;
  letter-spacing: normal;
}

.promo-field .btn {
  flex: none;
  min-height: 44px;
}

.promo-field .promo-status {
  min-height: 0;
}

.promo-field .promo-status:empty {
  display: none;
}

.promo-field[data-state='ok'] .input {
  border-color: var(--success);
}

.promo-field[data-state='ok'],
.promo-field[data-state='error'] {
  box-shadow: inset 3px 0 0 currentColor;
}

.promo-field[data-state='ok'] {
  color: var(--success);
}

.promo-field[data-state='error'] {
  color: var(--danger);
}

.promo-field .promo-status-ok,
.promo-field .promo-status-error {
  font-weight: var(--fw-semibold);
}

.promo-field.is-busy .btn {
  opacity: 0.7;
  cursor: progress;
}

@media (prefers-reduced-motion: no-preference) {
  .promo-field[data-state] .promo-status:not(:empty) {
    animation: promo-in var(--dur) var(--ease-out);
  }
  .promo-field[data-state='error'] .input {
    animation: promo-nudge 320ms var(--ease-out);
  }
}

@keyframes promo-in {
  from {
    opacity: 0;
    translate: 0 -4px;
  }
}

@keyframes promo-nudge {
  25% { translate: -4px 0; }
  60% { translate: 3px 0; }
}

/* Top-up module */
.topup-mod {
  display: grid;
  gap: var(--sp-5);
  padding: clamp(1.25rem, 0.75rem + 2vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 90% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  box-shadow: var(--sh-md);
}

@media (min-width: 960px) {
  .topup-mod {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    column-gap: var(--sp-8);
    align-items: start;
  }
  .topup-mod__intro {
    grid-row: span 2;
  }
}

.topup-mod__intro .eyebrow {
  margin-bottom: var(--sp-3);
}

.topup-mod__intro h4 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-2xl);
  line-height: 1.15;
  text-wrap: balance;
}

.topup-mod__intro p {
  margin: 0;
  color: var(--text-2);
}

.pack-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.pack-pick[hidden] {
  display: none;
}

.pack-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur), background-color var(--dur), box-shadow var(--dur) var(--ease-out), translate var(--dur) var(--ease-out);
}

.pack-tile__input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pack-tile__top {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
}

.pack-tile__cards {
  color: var(--text);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: var(--fw-black);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pack-tile__unit {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.pack-tile__tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  align-self: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: #fff;
  transition: background-color var(--dur), border-color var(--dur), scale var(--dur) var(--ease-out);
}

.pack-tile__tick svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.pack-tile__bar {
  display: block;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.pack-tile__fill {
  display: block;
  height: 100%;
  width: calc(var(--fill, 1) * 100%);
  border-radius: inherit;
  background: var(--border-strong);
  transform-origin: left;
  transition: background-color var(--dur), transform var(--dur-slow) var(--ease-out);
}

.pack-tile__price {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.pack-tile__price strong {
  color: var(--text);
  font-size: var(--fs-lg);
}

.pack-tile__rate {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

.pack-tile:hover {
  border-color: var(--accent-bg);
}

.pack-tile:has(input:checked) {
  border-color: var(--accent-bg);
  background: color-mix(in srgb, var(--accent-bg) 8%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent-bg), var(--sh-md);
}

.pack-tile:has(input:checked) .pack-tile__tick {
  border-color: transparent;
  background: var(--grad-button);
}

.pack-tile:has(input:checked) .pack-tile__tick svg {
  opacity: 1;
}

.pack-tile:has(input:checked) .pack-tile__fill {
  background: var(--grad-button);
}

.pack-tile:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .pack-tile:hover {
    translate: 0 -2px;
  }
  .pack-tile:has(input:checked) .pack-tile__fill {
    animation: pack-fill var(--dur-slow) var(--ease-out);
  }
  .pack-tile:has(input:checked) .pack-tile__tick {
    animation: pack-tick 300ms var(--ease-out);
  }
}

@keyframes pack-fill {
  from { transform: scaleX(0.15); }
}

@keyframes pack-tick {
  0% { scale: 0.4; }
  70% { scale: 1.15; }
  100% { scale: 1; }
}

@media (max-width: 479px) {
  .pack-pick {
    grid-template-columns: 1fr;
  }
  .pack-tile {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: var(--sp-4);
  }
  .pack-tile__top,
  .pack-tile__bar {
    grid-column: 1 / -1;
  }
  .pack-tile__rate {
    text-align: right;
  }
}

.topup-mod__buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
}

.topup-plan {
  align-items: center;
}

.topup-plan legend {
  /* visible label: override .segmented's visually-hidden legend */
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  float: left;
  padding: 0 var(--sp-2) 0 var(--sp-3);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.topup-mod__cta {
  flex: 1 1 auto;
}

@media (min-width: 600px) {
  .topup-mod__cta {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

.topup-mod__summary {
  flex-basis: 100%;
  margin: 0;
  color: var(--text-2);
}

.topup-mod__summary:empty {
  display: none;
}

/* How website purchases work */
.buy-fine {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
}

.buy-fine__h {
  margin: 0;
  font-size: var(--fs-base);
}

.fine-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--sp-3) var(--sp-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fine-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.fine-list svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--accent);
}

.buy-fine__links {
  margin: 0;
  color: var(--text-muted);
}

/* ---------- Feature matrix ---------- */
.matrix th,
.matrix td {
  text-align: center;
  vertical-align: middle;
}

.matrix thead th:first-child,
.matrix tbody th {
  text-align: left;
}

.matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 11rem;
  background: var(--surface);
}

.matrix thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.matrix thead th small {
  display: block;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  font-size: var(--fs-xs);
}

.matrix .col-featured {
  background: var(--accent-soft);
}

.matrix thead .col-featured {
  background: var(--accent-soft);
  color: var(--accent);
}

.matrix .row-note {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
}

.mx-yes,
.mx-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  font-weight: var(--fw-semibold);
}

.mx-yes svg,
.mx-no svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.mx-yes {
  color: var(--success);
}

.mx-no {
  color: var(--text-muted);
}

.mx-val {
  font-weight: var(--fw-semibold);
  color: var(--text);
  white-space: nowrap;
}

/* Zebra rows + row hover so a feature can be followed across the plans */
.matrix tbody tr:nth-child(even) > :not(.col-featured) {
  background-color: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
}

.matrix tbody tr:hover > :not(.col-featured) {
  background-color: var(--bg-tint);
}

.matrix thead th {
  font-size: var(--fs-base);
}

.matrix .mx-yes svg {
  width: 20px;
  height: 20px;
}

/* ---------- Top-ups ---------- */
.flow {
  display: grid;
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

@media (min-width: 760px) {
  .flow {
    grid-template-columns: repeat(3, 1fr);
  }
}

.flow > li {
  counter-increment: flow;
  position: relative;
  padding: var(--sp-5);
  padding-top: calc(var(--sp-5) + 2.25rem);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.flow > li::before {
  content: counter(flow);
  position: absolute;
  top: var(--sp-5);
  left: var(--sp-5);
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--grad-button);
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
}

.flow h3 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-lg);
}

.flow p {
  margin: 0;
  color: var(--text-2);
}

/* ---------- Renewal: web vs Google Play ---------- */
.channel-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.channel-card header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.channel-card h3 {
  margin: 0;
  font-size: var(--fs-xl);
}

.channel-card .timeline {
  margin: 0;
}

.state-list {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.state-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  align-items: start;
}

.state-list .badge {
  min-width: 6.5rem;
  justify-content: center;
}

.state-list p {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

@media (max-width: 479px) {
  .state-list li {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }
  .state-list .badge {
    justify-self: start;
  }
}

.center-row {
  justify-content: center;
}
