/* Subscription plans (plans.html, plans.js). Built on login.css: the same sky and frosted card, wider, with the
   plans as a radio group of tiles (three across from 640 px, stacked on phones). */

.plans-page .sky { background: linear-gradient(var(--sky), var(--sky-horizon) 55%, var(--snow)); }
.ridge { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: min(38vh, 34vw); min-height: 160px; }
.ridge-far { fill: #dbe7f4; }
.ridge-near { fill: var(--snow); }

.plans-card { width: min(100%, 680px); }
.plans-card .brand { margin-bottom: 18px; }
.plans-card .brand-mark svg { width: 140px; }   /* a little under the sign-in card's, above the plans */
.plans-card .brand-name { font-size: 20px; }

/* ---------- The 48-hour trial (plans.js renderTrial): its own offer above the plans ---------- */
.trial {
  margin-bottom: 20px; padding: 16px 18px 18px;
  border: 1.5px solid rgb(var(--accent-rgb) / .35); border-radius: var(--radius);
  background: linear-gradient(rgba(255,255,255,.92), rgba(255,255,255,.78));
}
.trial h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--navy); letter-spacing: var(--tracking-title); }
.trial-terms { margin: 0 0 12px; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.trial-terms li { position: relative; padding-left: 20px; font-size: 13.5px; line-height: 1.35; color: var(--text); }
.trial-terms li::before {
  content: ""; position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.trial-state { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--text); }
.trial-detail { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
#trial-left { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.trial .btn { margin-top: 12px; }
.trial .btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.trial-msg { margin-top: 12px; }
/* The live region stays in the page: empty, it takes no room and isn't seen, but stays in the accessibility tree, so
   the text set later is read (A10 SEC-20) */
.trial-msg:empty { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.trial-state:empty { display: none; }
.plans-heading { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- The plans ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.plan {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  min-height: 132px; padding: 16px 14px 14px;
  border: 1.5px solid var(--stroke); border-radius: var(--radius);
  background: rgba(255,255,255,.7); color: var(--text);
  font: inherit; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-out);
}
.plan:hover { background: #fff; }
.plan:active { transform: scale(.98); }
.plan[aria-checked="true"] {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .16), 0 8px 20px rgb(var(--navy-rgb) / .08);
}
.plan:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.plan-name { font-size: 15px; font-weight: 700; color: var(--navy); padding-right: 26px; }
.plan-price { line-height: 1.2; }
.plan-price strong { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: var(--tracking-title); }
.plan-price small { display: block; font-size: 13px; color: var(--muted); }
.plan-sub { margin-top: auto; font-size: 12px; line-height: 1.35; color: var(--muted); }
/* The tick in the corner */
.plan-check {
  position: absolute; top: 14px; right: 12px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgb(var(--navy-rgb) / .5); background: #fff;   /* the unticked circle at 3:1 or more (WCAG 1.4.11) */
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.plan[aria-checked="true"] .plan-check {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.plan-badge {
  position: absolute; top: -10px; left: 12px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--navy); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}

/* ---------- What every plan includes ---------- */
.included { margin-bottom: 18px; padding: 14px 16px; border-radius: var(--radius); background: rgba(255,255,255,.55); }
.included h2 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.included ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.included li { position: relative; padding-left: 24px; font-size: 14px; line-height: 1.35; }
.included li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(31, 157, 85, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%2314683a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}

.plans-card .form-msg { margin-bottom: 12px; }
.plans-card .btn + .btn { margin-top: 10px; }
.fine { margin: 14px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); text-align: center; }

/* ---------- Phones: the plans stack ---------- */
@media (max-width: 640px) {
  .plans-page .stage { justify-content: flex-start; padding-top: max(20px, env(safe-area-inset-top) + 12px); }   /* no Home pill to clear */
  .plans-card .brand-mark svg { width: 112px; }
  .plans-card .brand-name { font-size: 17px; }
  .plans { grid-template-columns: 1fr; gap: 12px; }
  .plan { min-height: 0; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name price" "sub price"; align-items: center; column-gap: 12px; padding: 14px 14px 14px 46px; }
  .plan-check { top: 50%; left: 14px; right: auto; margin-top: -10px; }
  .plan-name { grid-area: name; padding-right: 0; }
  .plan-price { grid-area: price; text-align: right; }
  .plan-price strong { font-size: 21px; }
  .plan-sub { grid-area: sub; margin-top: 0; }
  .plan-badge { left: auto; right: 12px; }
  .trial { margin-bottom: 16px; padding: 14px 14px 16px; }
  .trial-terms { grid-template-columns: 1fr; }
  .included { margin-bottom: 14px; padding: 12px 14px; }
  .included ul { grid-template-columns: 1fr; gap: 4px; }
  .plans-card .brand { margin-bottom: 14px; }
  .plans { margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .plan, .plan-check { transition: none; }
}
