/* ==========================================================================
   Perform — Account
   Built on the Perform design system (perform.css). A focused logged-in
   surface: navy field, faint wordmark, a white beveled panel. All element
   IDs, the billingPlan radios and the coach-id meta are unchanged so
   account.js and coach-redirect-debug.js keep working.
   ========================================================================== */

html { overflow-x: hidden; }

/* the [hidden] attribute must always win over component display rules ------- */
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background:
    radial-gradient(120% 72% at 82% -10%, var(--navy-700), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--ink) 100%);
  color: #fff;
}

/* faint brand wordmark (clipped to the viewport) ---------------------------- */
.account-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.account-word {
  position: absolute; left: 50%; bottom: -2.5vw; transform: translateX(-50%);
  font-size: 27vw; font-weight: 800; letter-spacing: -0.05em; line-height: 1;
  color: rgba(255, 255, 255, 0.04); white-space: nowrap; user-select: none;
}

/* header -------------------------------------------------------------------- */
.account-header {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: clamp(1.4rem, 3vw, 2rem) var(--pad);
}
.account-brand {
  display: inline-flex; background: var(--surface);
  padding: 0.6rem 0.85rem;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
}
.account-brand img { height: 26px; width: auto; display: block; }

/* layout / card ------------------------------------------------------------- */
.account-main {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: clamp(1rem, 3vw, 2rem) var(--pad) clamp(3rem, 8vw, 5.5rem);
}
.account-card {
  width: 100%; max-width: 32rem;
  background: var(--surface); color: var(--ink);
  padding: clamp(1.7rem, 4vw, 2.6rem);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
  filter: drop-shadow(0 36px 50px rgba(0, 0, 0, 0.5));
  animation: account-rise 0.6s var(--ease) both;
}
@keyframes account-rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.account-card .eyebrow { margin-bottom: 0.85rem; }
.account-title {
  font-size: clamp(1.7rem, 3vw, 2.1rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.05; color: var(--ink);
}
.account-email {
  margin-top: 0.7rem;
  font-size: 0.96rem; color: var(--steel); line-height: 1.55;
  word-break: break-word;
}

/* action buttons ------------------------------------------------------------ */
.account-actions {
  display: flex; flex-wrap: wrap; gap: 0.7rem;
  margin-top: 1.5rem;
}
.acct-btn {
  flex: 1 1 auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0.8rem 1.4rem;
  font: inherit; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.01em;
  text-align: center; cursor: pointer;
  transition: background 0.22s var(--ease), color 0.22s var(--ease),
    box-shadow 0.22s var(--ease), transform 0.2s var(--ease);
}
.acct-btn:hover { transform: translateY(-1px); }
.acct-btn:active { transform: translateY(0); }
.acct-btn--primary { background: var(--blue); color: #fff; }
.acct-btn--primary:hover { background: var(--ink); color: #fff; }
.acct-btn--ghost {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1.6px var(--line);
}
.acct-btn--ghost:hover {
  box-shadow: inset 0 0 0 1.6px var(--navy); color: var(--navy);
}
.acct-btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
}

/* premium downloads --------------------------------------------------------- */
.premium-downloads {
  display: flex; flex-direction: column; gap: 0.45rem;
  margin-top: 1.6rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.premium-downloads__title {
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink);
}
.premium-downloads__copy { font-size: 0.92rem; color: var(--steel); line-height: 1.55; }

.store-buttons {
  display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.55rem;
}
.store-button {
  flex: 1 1 auto; min-height: 50px; padding: 0.7rem 1.2rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: var(--navy); color: #fff;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; line-height: 1;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.store-button:hover { background: var(--blue); color: #fff; transform: translateY(-1px); }
.store-button svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.store-button strong { font: inherit; }

/* status line --------------------------------------------------------------- */
.account-status {
  margin-top: 1.15rem;
  font-size: 0.88rem; color: var(--steel); line-height: 1.5;
}
.account-status:empty { display: none; }

/* ============================================================ billing modal */
.billing-modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; padding: clamp(1rem, 4vw, 2rem);
  overflow-y: auto; overscroll-behavior: contain;
}
.billing-modal__backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 14, 28, 0.74);
  backdrop-filter: blur(7px);
  cursor: pointer;
}
.billing-modal__dialog {
  position: relative; z-index: 1;
  width: min(40rem, 100%); margin: auto;
  background: var(--surface); color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
  filter: drop-shadow(0 40px 56px rgba(0, 0, 0, 0.55));
  animation: account-rise 0.4s var(--ease) both;
}

.billing-modal__header {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: clamp(1.6rem, 4vw, 2.3rem) clamp(1.4rem, 4vw, 2.3rem) 0.4rem;
}
.billing-modal__header h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.06; color: var(--ink);
}
.billing-modal__header p { font-size: 0.95rem; color: var(--steel); line-height: 1.55; }

/* plan options -------------------------------------------------------------- */
.billing-plan-list {
  display: flex; flex-direction: column; gap: 0.8rem;
  padding: 1.1rem clamp(1.4rem, 4vw, 2.3rem) 0;
}
.plan-option { position: relative; display: block; }
.plan-option > input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.plan-option__card {
  display: flex; flex-direction: column; gap: 0.7rem;
  padding: 1.15rem 1.2rem;
  background: var(--paper); border: 1.7px solid var(--line);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.plan-option > input:checked + .plan-option__card {
  border-color: var(--blue); background: rgba(31, 124, 232, 0.07);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.plan-option > input:focus-visible + .plan-option__card {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
@media (hover: hover) {
  .plan-option__card:hover { border-color: var(--blue-300); }
}

.plan-option__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem;
}
.plan-option__name {
  font-size: 0.97rem; font-weight: 800; letter-spacing: -0.015em; color: var(--ink);
}
.plan-option__copy {
  display: block; margin-top: 0.2rem;
  font-size: 0.86rem; color: var(--steel); line-height: 1.5;
}
.plan-option__price {
  display: flex; align-items: baseline; gap: 0.25rem;
  white-space: nowrap; color: var(--navy);
}
.plan-option__price strong {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em;
}
.plan-option__price span {
  font-size: 0.74rem; font-weight: 700; color: var(--steel);
}
.plan-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.plan-badge {
  padding: 0.32rem 0.62rem;
  font-size: 0.69rem; font-weight: 800; letter-spacing: 0.04em;
}
.plan-badge--trial {
  color: var(--blue);
  box-shadow: inset 0 0 0 1.4px rgba(31, 124, 232, 0.45);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.plan-badge--save { background: var(--blue); color: #fff; }

.billing-fineprint {
  padding: 1rem clamp(1.4rem, 4vw, 2.3rem) 0;
  font-size: 0.8rem; color: var(--steel); line-height: 1.55;
}
.billing-modal__actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.7rem;
  padding: 1.2rem clamp(1.4rem, 4vw, 2.3rem) clamp(1.6rem, 4vw, 2.3rem);
}
.billing-modal__actions .acct-btn { flex: 0 1 auto; min-width: 10rem; }

/* ==================================================================== toast */
.toast {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 140;
  display: flex; align-items: center; gap: 0.85rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  background: var(--ink); color: #fff;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
  border-left: 3px solid var(--blue);
  font-size: 0.88rem; line-height: 1.5;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.toast__close {
  margin-left: auto; flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--mist); background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem; line-height: 1; cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.toast__close:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }

/* responsive ---------------------------------------------------------------- */
@media (max-width: 560px) {
  .account-card {
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  }
  .acct-btn { flex: 1 1 100%; }
  .billing-modal__dialog {
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  }
  .billing-modal__actions { justify-content: stretch; }
  .billing-modal__actions .acct-btn { flex: 1 1 100%; }
  .plan-option__top { flex-direction: column; gap: 0.5rem; }
  .toast { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
}
