/* Ramz — account pages and their forms (ADR-0070): the account's pages down the start side,
   orders and their codes, addresses and memberships. Loaded on the customer pages and the review
   page only. */

/* ---------- Account ---------- */

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

@media (min-width: 990px) {
  .account-layout {
    grid-template-columns: 15.5rem minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: start;
  }

  .account-nav {
    position: sticky;
    inset-block-start: calc(var(--header-height) + 1.5rem);
  }
}

.account-main {
  display: grid;
  align-content: start;
  min-width: 0;
}

.account-main > .breadcrumbs {
  margin-block-end: 0.75rem;
}

.account-nav ul {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-nav a,
.account-nav button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 0;
  border-radius: var(--radius-chip);
  background: none;
  color: var(--fg-muted);
  font-size: var(--text-small);
  font-weight: 500;
  text-align: start;
  text-decoration: none;
}

.account-nav .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.account-nav a:hover,
.account-nav button:hover {
  background: var(--bg-raised);
  color: var(--fg);
}

.account-nav a[aria-current='page'] {
  background: var(--bg-raised-2);
  color: var(--fg);
  font-weight: 600;
}

@media (max-width: 989px) {
  .account-nav ul {
    display: flex;
    gap: 0.5rem;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .account-nav li {
    flex: none;
  }

  .account-nav a,
  .account-nav button {
    width: auto;
    border: 1px solid var(--line);
  }
}

.surface {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.account-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-chip);
  background: var(--bg-raised);
  font-size: var(--text-small);
}

.account-credit .icon {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--accent);
}

.account-credit .subtle {
  flex-basis: 100%;
}

/* Orders: a row each with its number and date, what it holds, its status, total and a way in. */
.order-list {
  margin: 0;
  padding: 0;
  border-block-start: 1px solid var(--line-strong);
  list-style: none;
}

.order-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) 9rem 7rem auto;
  align-items: center;
  gap: 1rem;
  padding-block: 1.125rem;
  border-block-end: 1px solid var(--line-strong);
  font-size: var(--text-small);
}

.order-row__name {
  display: grid;
  gap: 0.125rem;
  text-decoration: none;
}

.order-row__name strong {
  font-family: var(--font-heading);
  font-size: var(--text-label);
  letter-spacing: -0.01em;
}

.order-row__items {
  overflow: hidden;
  color: var(--fg-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-row__total {
  font-weight: 600;
  text-align: end;
}

.order-row__open {
  min-height: 2.5rem;
}

@media (max-width: 749px) {
  .order-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 1rem;
  }

  .order-row__items {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .order-row__status {
    grid-column: 1;
    grid-row: 3;
  }

  .order-row__total {
    grid-column: 2;
    grid-row: 1;
  }

  .order-row__open {
    grid-column: 2;
    grid-row: 3;
  }
}

/* An order: its cards on the start side, the summary on the end. */
.order-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1100px) {
  .order-layout {
    grid-template-columns: minmax(0, 1fr) 18.5rem;
    gap: 1.75rem;
    align-items: start;
  }

  .order-summary {
    position: sticky;
    inset-block-start: calc(var(--header-height) + 1.5rem);
  }
}

.order-lines {
  display: grid;
  gap: 1rem;
}

.order-card {
  display: grid;
  gap: 1.125rem;
  padding: 1.25rem;
  border-radius: var(--radius);
}

.order-card__head {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
}

.order-card__art {
  border-radius: 6px;
}

.order-card__art img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--card-ratio);
  object-fit: cover;
}

.order-card__text {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  font-size: var(--text-small);
}

.order-card__title {
  margin: 0;
  font-size: var(--text-label);
}

.order-card__variant,
.order-card__answer {
  margin: 0;
  color: var(--fg-muted);
}

.order-card__text .badge,
.order-card__text .status {
  margin-block-start: 0.25rem;
}

.order-card__price {
  font-weight: 600;
}

.order-card__links {
  margin: 0;
  font-size: var(--text-small);
}

/* A code: masked but for its last four, Show and Copy beside it; whole without scripts. */
.codes {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.code-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.code-box {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  border-radius: var(--radius-chip);
  background: var(--color-background);
  white-space: nowrap;
}

.code-box__masked {
  display: none;
  color: var(--fg-muted);
}

.js .code-row:not(.is-shown) .code-box__full {
  display: none;
}

.js .code-row:not(.is-shown) .code-box__masked {
  display: inline;
}

.code-box__label {
  display: none;
}

.js .code-row:not(.is-shown) .code-box__label {
  display: inline;
}

.code-row__toggle {
  flex: none;
  width: 3.25rem;
  height: auto;
  border-radius: var(--radius-chip);
}

.code-row__toggle .icon--hide,
.code-row.is-shown .code-row__toggle .icon--show {
  display: none;
}

.code-row.is-shown .code-row__toggle .icon--hide {
  display: block;
}

.code-row__copy {
  flex: none;
  min-width: 7rem;
  min-height: 3.25rem;
  border-radius: var(--radius-chip);
}

.code-row__copy.is-copied {
  border-color: transparent;
  background: var(--bg-raised-2);
}

.code-row__copy.is-copied .code-row__copy-icon {
  display: none;
}

.code-row__copy.is-copied::before {
  content: '';
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 749px) {
  .code-row {
    flex-wrap: wrap;
  }

  .code-box {
    flex-basis: 100%;
  }

  .code-row__copy {
    flex: 1;
  }
}

.order-files {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-small);
}

.order-files li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}

.order-files .icon {
  width: 1rem;
  height: 1rem;
}

/* A top-up's way to the game: Paid, then Sent, each ticked once it's so. */
.order-steps {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 0 0;
  border-block-start: 1px solid var(--line);
  list-style: none;
  font-size: var(--text-small);
}

.order-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg-muted);
}

.order-steps li.is-done {
  color: var(--fg);
}

.order-steps .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.order-steps li.is-done .icon {
  color: var(--accent);
}

.notice--warn {
  border: 1px solid color-mix(in oklab, var(--warning) 50%, transparent);
  background: transparent;
}

.notice--warn .icon {
  color: var(--warning);
}

/* The summary beside the order: totals, the invoice, and where to ask. */
.order-summary {
  display: grid;
  gap: 1rem;
}

.order-summary .panel {
  display: grid;
  gap: 1.125rem;
  padding: 1.25rem;
  border: 1px solid var(--line-strong);
  background: transparent;
}

.order-summary h2 {
  margin: 0;
  font-size: var(--text-h2);
}

.order-summary .cart-summary__total .amount {
  font-size: 1.5rem;
}

.order-summary__help {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: var(--text-small);
}

.order-summary__help .icon {
  width: 1rem;
  height: 1rem;
  color: var(--fg-muted);
}

.return-instructions {
  display: grid;
  gap: 0.5rem;
}

.address-list {
  display: grid;
  gap: 1rem;
}

@media (min-width: 750px) {
  .address-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.address {
  display: grid;
  color: var(--fg-muted);
  font-style: normal;
}

.address-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.75rem;
}

.address-card .address {
  color: var(--fg);
}

.address-card .address-form {
  width: 100%;
}

/* Disclosures opened by a button or a link, not by a full-width row. */
.disclosure:has(> summary.button),
.disclosure:has(> summary.link) {
  border: 0;
}

.disclosure > summary.button {
  display: inline-flex;
  justify-content: center;
  min-height: 3.25rem;
}

.disclosure > summary.link {
  display: inline-flex;
  min-height: 2.75rem;
}

.disclosure[open] > .address-form {
  margin-block-start: 1rem;
}

.address-form {
  display: grid;
}

.address-new {
  margin-block: 2rem 1.5rem;
}

.subscriptions {
  display: grid;
  gap: 1rem;
}

.subscription__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.subscription__head h2 {
  margin: 0;
  font-size: var(--text-h3);
}

.subscription__lines {
  margin: 0.75rem 0;
}

.subscription__next {
  color: var(--fg-muted);
  font-size: var(--text-small);
}

.subscription__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-block-start: 1rem;
}

.order-return {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
  width: 100%;
  padding-block: 0 0.75rem;
  border-block-end: 1px solid var(--line);
}

.order-return p {
  margin: 0;
}

.order-return__lines {
  margin: 0;
  padding-inline-start: 1.1rem;
  font-size: var(--text-small);
}

.return-lines {
  display: grid;
  gap: 0.75rem;
  margin-block-end: 1.5rem;
}

.return-line {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
}

.return-line:has(input:checked) {
  border-color: var(--fg);
}

.return-line__title {
  font-weight: 500;
}

.review-request {
  display: grid;
  gap: 1.5rem;
  margin-block-end: 1rem;
}

.review-request__product {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.review-request__product h2 {
  margin: 0;
  font-size: var(--text-h3);
}

.review-request__product img {
  width: 3.75rem;
}

.star-input {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.star-input__options {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.25rem;
}

.star-input__options input {
  position: absolute;
  opacity: 0;
}

.star-input__options label {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--line-strong);
  font-size: 1.75rem;
  cursor: pointer;
}

.star-input__options input:checked ~ label,
.star-input__options label:hover,
.star-input__options label:hover ~ label {
  color: var(--fg);
}

.star-input__options input:focus-visible + label {
  outline: 1.5px solid var(--fg);
  outline-offset: 2px;
}

/* ---------- Forms and tables of the account pages ---------- */

.table-wrapper {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
}

.table th,
.table td {
  padding: 1rem 1rem 1rem 0;
  border-block-end: 1px solid var(--line);
  font-weight: 400;
  text-align: start;
  vertical-align: top;
}

.table thead th {
  padding-block: 0 0.75rem;
  color: var(--fg-muted);
  font-size: var(--text-small);
  font-weight: 500;
}

.table th:last-child,
.table td:last-child {
  padding-inline-end: 0;
  text-align: end;
}

[dir='rtl'] .table th,
[dir='rtl'] .table td {
  padding-inline: 0 1rem;
}

[dir='rtl'] .table th:last-child,
[dir='rtl'] .table td:last-child {
  padding-inline: 0;
}

.table tfoot th,
.table tfoot td {
  padding-block: 0.375rem;
  border-block-end: 0;
  color: var(--fg-muted);
}

.table tfoot tr:first-child > * {
  padding-block-start: 1rem;
}

.table tfoot .table__total > * {
  padding-block: 0.75rem 0;
  color: var(--fg);
  font-weight: 500;
}

.table td .money,
.table th .money {
  justify-content: flex-end;
}

input[type='file'] {
  width: 100%;
  font-size: var(--text-small);
}

input[type='file']::file-selector-button {
  margin-inline-end: 0.75rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.form-footer {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  margin-block-start: 1.5rem;
  color: var(--fg-muted);
  font-size: var(--text-small);
  text-align: center;
}

.choice-group legend {
  font-size: var(--text-small);
  font-weight: 500;
}

.choice-group {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.field-row {
  display: grid;
  gap: 0 0.875rem;
}

@media (min-width: 750px) {
  .field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The wishlist's note for guests (ADR-0084). */
.wishlist-page__note{margin-block-start:2rem;color:var(--fg-muted);font-size:var(--text-small)}

/* ---------- Your data (ADR-0100) ---------- */

.privacy-choices {
  display: grid;
  gap: 2rem;
  max-width: 40rem;
}

.privacy-choice h2,
.privacy-requests__title {
  margin: 0 0 0.5rem;
  font-size: var(--text-h3);
}

.privacy-choice p {
  margin: 0 0 1rem;
}

.privacy-requests__title {
  margin-block-start: 3rem;
}

.privacy-requests {
  display: grid;
  max-width: 40rem;
  border-block-start: 1px solid var(--line);
}

.privacy-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 1rem;
  border-block-end: 1px solid var(--line);
}

.privacy-request > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

/* Rewards (ADR-0131) */
.rewards {
  display: grid;
  gap: 2.5rem;
  max-inline-size: 44rem;
}

.rewards h2 {
  margin-block: 0 0.75rem;
  font-size: var(--text-h3);
}

.rewards .rewards__label {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
  font-weight: inherit;
}

.rewards__figure {
  margin-block: 0.25rem 0.5rem;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.rewards__tier {
  margin-block: 1rem 0;
}

.rewards__progress {
  display: grid;
  gap: 0.5rem;
  margin-block-start: 1rem;
  font-size: var(--text-small);
}

.rewards__progress progress {
  inline-size: 100%;
  block-size: 0.375rem;
  accent-color: currentColor;
}

.rewards__form,
.rewards__dates {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.rewards__form .field,
.rewards__dates .field {
  flex: 1 1 8rem;
  margin: 0;
}

.rewards__earn ul,
.rewards__history ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rewards__earn li {
  padding-block: 0.25rem;
}

.rewards__entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.875rem;
  border-block-end: 1px solid var(--line);
}

.rewards__entry p {
  margin: 0;
  font-size: var(--text-small);
}

.rewards__entry--voided {
  opacity: 0.55;
  text-decoration: line-through;
}

.rewards__amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rewards__amount--gain {
  font-weight: 600;
}
