.customer {
  --customer-accent: #c4acff;
  --customer-text: #f7f5fa;
  --customer-muted: #b7b2c0;
  --customer-line: #38333e;
  --customer-card: #211d25;
  color: var(--customer-text);
  padding-block: clamp(42px, 6vw, 88px);
}

.customer h1, .customer h2, .customer p, .customer dl, .customer dd { margin: 0; }
.customer h1 { font-size: clamp(2.35rem, 5.2vw, 4.65rem); line-height: 1.04; letter-spacing: -.059em; overflow-wrap: break-word; }
.customer h2 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); line-height: 1.16; letter-spacing: -.04em; }
.customer p { color: var(--customer-muted); }
.customer-heading { margin-bottom: clamp(24px, 4vw, 44px); }
.customer-heading p, .auth-intro > p { max-width: 46ch; margin-top: 16px; font-size: 1.02rem; line-height: 1.64; }
.customer dt { color: var(--customer-muted); font-size: .82rem; }
.customer dd { font-weight: 650; }
.customer-card {
  min-width: 0;
  padding: clamp(22px, 3.2vw, 44px);
  border: 1px solid var(--customer-line);
  border-radius: 20px;
  background: var(--customer-card);
}
.customer-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 20px;
  color: var(--customer-muted);
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
}
.customer-back span, .profile-actions span { color: var(--customer-accent); }
.customer-back:hover { color: var(--customer-text); }
.customer-button {
  display: inline-flex;
  min-height: 48px;
  padding: 10px 20px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.customer-primary { background: var(--customer-accent); color: #20172d; }
.customer-primary:disabled { background: #37313f; color: #c5bdce; cursor: default; opacity: 1; }
.customer :focus-visible { outline: 3px solid var(--customer-accent); outline-offset: 4px; }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .87fr);
  align-items: start;
  gap: clamp(32px, 8vw, 130px);
  min-height: 67vh;
}
.auth-intro { padding-top: 14px; }
.auth-form { max-width: 530px; width: 100%; justify-self: end; }
.auth-form h2 { margin-bottom: 16px; }
.auth-form .form-intro { margin-bottom: 24px; }
.auth-form > div { margin-block: 18px; }
.auth-form label { display: block; margin-bottom: 7px; color: var(--customer-text); font-size: .91rem; font-weight: 650; }
.auth-form input:not([type="hidden"]) {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #62596b;
  border-radius: 9px;
  background: #18151c;
  color: var(--customer-text);
  font: inherit;
}
.auth-form input[aria-invalid="true"] { border-color: var(--customer-accent); }
.auth-form .customer-button { width: 100%; margin-top: 6px; justify-content: space-between; }
.auth-form .helptext, .auth-form .form-footnote { color: var(--customer-muted); font-size: .83rem; line-height: 1.55; }
.auth-form .form-footnote { margin-top: 15px; }
.auth-form .helptext ul { margin-block: 7px 10px; padding-left: 18px; }
.auth-form .errorlist { margin: 8px 0; list-style: none; padding: 6px 10px; border-left: 2px solid var(--customer-accent); color: #ded0ff; font-size: .9rem; }

.account-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.subscription-card { position: relative; isolation: isolate; overflow: hidden; background: #27222e; }
.subscription-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 58%;
  aspect-ratio: 1;
  top: -26%;
  right: -24%;
  border-radius: 50%;
  border: 1px solid #494052;
  box-shadow: 0 0 0 22px #27222e, 0 0 0 23px #463c50, 0 0 0 44px #27222e, 0 0 0 45px #413848, 0 0 0 66px #27222e, 0 0 0 67px #39333f;
  pointer-events: none;
}
.subscription-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.customer-status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: #39323f; color: #dfd9e5; font-size: .79rem; white-space: normal; }
.customer-status::before { content: ""; flex: 0 0 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { background: #3a2e4e; color: #ddcaff; }
.subscription-data { display: grid; grid-template-columns: 1.05fr .98fr 1fr; gap: 16px; align-items: end; padding-block: 30px 28px; }
.subscription-data dd { margin-top: 5px; font-size: clamp(1rem, 1.7vw, 1.28rem); overflow-wrap: anywhere; }
.subscription-data .day-count dd { font-size: clamp(3.2rem, 7vw, 5.75rem); line-height: .96; letter-spacing: -.075em; color: var(--customer-accent); font-variant-numeric: tabular-nums; }
.profile-card { display: flex; flex-direction: column; }
.profile-data { padding-block: 20px 23px; }
.profile-data dd { margin-top: 2px; font-size: 1.25rem; overflow-wrap: anywhere; }
.profile-actions { margin-top: auto; }
.profile-actions a, .profile-actions button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 45px; margin: 0; padding: 8px 0; border: 0;
  border-top: 1px solid var(--customer-line); background: transparent;
  font: inherit; color: var(--customer-text); text-decoration: none;
}
.profile-actions a:hover, .profile-actions button:hover { color: var(--customer-accent); }

.customer-history { padding-top: clamp(36px, 6vw, 70px); }
.customer-history h2 { margin-bottom: 20px; font-size: clamp(1.5rem, 3vw, 2.35rem); }
.history-empty { padding-block: 22px; border-block: 1px solid var(--customer-line); }
.ledger { padding: 0; margin: 0; border-top: 1px solid var(--customer-line); list-style: none; }
.ledger li { border-bottom: 1px solid var(--customer-line); }
.ledger a { display: grid; grid-template-columns: 1.4fr 1fr auto auto; align-items: center; column-gap: 22px; min-height: 65px; padding: 10px 6px; color: var(--customer-text); text-decoration: none; }
.ledger-plan { font-weight: 700; }
.ledger-plan time { display: block; color: var(--customer-muted); font-size: .85rem; font-weight: 500; }
.ledger-status { color: var(--customer-muted); font-size: .91rem; }
.ledger-arrow { color: var(--customer-accent); }
.ledger-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: .9rem; }
.ledger-pagination a { display: inline-flex; align-items: center; min-height: 44px; color: var(--customer-accent); }

.customer .payment-notice { margin-bottom: 20px; padding: 14px 18px; color: #e4d7fb; border-left: 2px solid var(--customer-accent); background: #292330; border-radius: 0 8px 8px 0; }
.customer-plans { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.customer-plan { display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; gap: clamp(20px, 3vw, 42px); }
.customer-plan h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.customer-price { display: block; padding-block: 10px; line-height: 1; font-size: clamp(2.6rem, 5vw, 4.7rem); font-weight: 650; letter-spacing: -.065em; white-space: nowrap; }
.customer-price span { font-size: .56em; color: var(--customer-muted); font-weight: 500; }
.customer .renew-note { max-width: 70ch; margin-top: 22px; font-size: .9rem; }

.receipt-layout { max-width: 690px; }
.receipt header { padding-bottom: 22px; }
.receipt .receipt-label { margin-bottom: 12px; }
.receipt h1 { font-size: clamp(1.85rem,5vw,3.8rem); line-height: 1.08; }
.receipt-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 14px 0; border-top: 1px solid var(--customer-line); }
.receipt-lines dt { font-size: .92rem; }
.receipt-lines dd { text-align: right; }
.receipt-amount { color: var(--customer-accent); font-size: 1.6rem; letter-spacing: -.04em; }
.receipt .receipt-note { padding-top: 16px; border-top: 1px solid var(--customer-line); }
.receipt .customer-button { margin-top: 16px; }

@media (hover: hover) {
  .customer-primary:not(:disabled):hover { background: #d7c3ff; }
  .ledger a:hover { background: #211e25; }
}
@media (prefers-reduced-motion: no-preference) {
  .customer-button { transition: background-color 140ms linear, transform 140ms cubic-bezier(.2,.8,.2,1); }
  .customer-button:not(:disabled):active { transform: scale(.985); }
  .customer-button span, .profile-actions span, .ledger-arrow { transition: transform 160ms cubic-bezier(.2,.8,.2,1); }
  @media (hover: hover) {
    .customer-button:not(:disabled):hover span, .profile-actions a:hover span, .profile-actions button:hover span, .ledger a:hover .ledger-arrow { transform: translateX(3px); }
  }
}

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(305px, 1.15fr); gap: 24px; }
  .account-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .subscription-data { grid-template-columns: 1fr 1fr; }
  .day-count { grid-column: 1 / -1; }
  .customer-plans { gap: 10px; }
  .customer-plan { padding: 20px; }
}
@media (max-width: 640px) {
  .customer { padding-block: 30px 44px; }
  .auth-layout, .account-grid, .customer-plans { grid-template-columns: 1fr; }
  .auth-layout { gap: 22px; }
  .auth-intro { padding: 0; }
  .auth-form { max-width: none; }
  .customer-back { margin-bottom: 12px; }
  .customer-card { border-radius: 16px; }
  .account-grid { gap: 12px; }
  .subscription-data { padding-block: 22px; }
  .customer .customer-button { width: 100%; }
  .customer-plan { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; }
  .customer-plan .customer-button { grid-column: 1 / -1; }
  .customer-price { padding: 0; font-size: 2.5rem; }
  .ledger a { grid-template-columns: 1fr auto; row-gap: 6px; }
  .ledger-plan { grid-row: 1 / 3; }
  .ledger-status { grid-column: 2; grid-row: 2; font-size: .83rem; text-align: right; }
  .ledger strong { grid-row: 1; grid-column: 2; text-align: right; }
  .ledger-arrow { display: none; }
  .receipt-lines > div { gap: 12px; }
}
