/* One centred reading column for the whole account, its heading included. */
.account-root {
  display: grid;
  gap: 22px;
  margin-top: 28px;
  max-width: 780px;
  margin-inline: auto;
}
.account-page-main > h1 {
  max-width: 780px;
  margin-inline: auto;
}
.account-panel {
  display: grid;
  gap: 16px;
}
.account-step,
.account-form {
  display: grid;
  gap: 14px;
  max-width: 560px;
}
.account-step h3,
.account-root .account-step h2 {
  font-size: 22px;
}
.account-root h2 {
  font-size: 26px;
}
.account-root label,
.checkout-identity label {
  font-size: 12px;
  font-weight: 600;
  display: grid;
  gap: 7px;
}
.account-root label small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.account-root input,
.account-root select,
.account-root textarea,
.checkout-identity select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #9da99c;
  border-radius: 6px;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}
.account-root [aria-invalid='true'],
.checkout-identity [aria-invalid='true'] {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}
.account-note {
  font-size: 13px;
  line-height: 1.6;
}
.account-message {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}
.account-message:empty {
  display: none;
}
.account-message.is-error {
  color: var(--error);
}
.account-link {
  border: 0;
  background: none;
  padding: 8px 0;
  min-height: 44px;
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
  text-align: start;
  text-decoration: underline;
  justify-self: start;
}
.account-check {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 44px;
  font-size: 13px !important;
}
.account-check input {
  width: 20px !important;
  height: 20px;
  min-height: 20px !important;
  padding: 0 !important;
  accent-color: var(--green);
  flex-shrink: 0;
}
/* The join form's two WhatsApp boxes: long sentences, so the box sits on the first line. */
.register-whatsapp {
  display: grid;
  gap: 8px;
}
.register-whatsapp .account-check {
  align-items: flex-start;
  line-height: 1.6;
}
.register-whatsapp .account-check input {
  margin-top: 2px;
}
.checkout-identity {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  margin-bottom: 16px;
}
.checkout-identity h3 {
  font-size: 18px;
}
.checkout-signed {
  font-size: 14px;
  color: var(--ink);
  max-width: none;
}
.checkout-saved {
  display: grid;
  gap: 8px;
}
.commerce-dialog button.checkout-option {
  width: 100%;
  text-align: start;
  color: var(--ink);
}
.account-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  scrollbar-width: thin;
  /* A tab scrolled into view stops clear of the edge, and the strip comes to rest on a tab. */
  scroll-padding-inline: 16px;
  scroll-snap-type: x proximity;
}
.account-tabs button {
  scroll-snap-align: start;
}
.account-tabs button {
  white-space: nowrap;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.account-tabs button[aria-selected='true'] {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.account-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.account-card p {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.account-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
/* One line each: the label, then its number at the row's end, so a count does not sit alone in a
   tall card. */
.account-card.account-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px;
}
.account-stat span {
  order: -1;
}
.account-stat strong {
  display: block;
  font-size: 28px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.account-stat span {
  font-size: 13px;
  color: var(--muted);
}
.account-list {
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.account-badge {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-light);
  color: var(--green);
  font-weight: 700;
}
.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.account-danger {
  color: var(--error) !important;
  border-color: var(--error) !important;
}
.account-page-main h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
}
@media (max-width: 760px) {
  .account-card {
    padding: 16px;
  }
  .account-grid {
    grid-template-columns: 1fr 1fr;
  }
  .account-stat strong {
    font-size: 24px;
  }
}

/* Registration: the address is its own group inside the form. */
.register-address {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m, 10px);
}
.register-address legend {
  padding-inline: 6px;
  font-weight: 800;
}
.account-panel:focus-visible {
  outline-offset: 6px;
}
.account-empty {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m, 10px);
}

/* Registration in two short steps: you, then your address. */
.account-step [hidden] {
  display: none !important;
}
.register-part {
  display: grid;
  gap: 14px;
}
.register-progress {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.register-more > :not(summary) {
  margin-block-start: 14px;
}
.register-more summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  cursor: pointer;
}
.account-step .field-error,
.account-root .field-error {
  margin: -6px 0 0;
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
/* The WhatsApp code: spaced, larger digits. */
.account-step .code-input {
  max-width: 260px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.45em;
  text-align: center;
  padding-inline-start: calc(14px + 0.45em);
  font-variant-numeric: tabular-nums;
}
.account-step .code-input::placeholder {
  letter-spacing: 0.45em;
}
/* Overview: the points card carries the points mark and the reward. */
.points-card {
  gap: 14px;
  background: var(--green);
  border-color: var(--green);
  color: var(--paper);
}
.points-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.points-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--green);
  flex-shrink: 0;
}
.points-mark .icon {
  width: 34px;
  height: 34px;
}
.points-figure {
  display: grid;
  gap: 2px;
}
.points-figure strong {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.points-figure span,
.points-figure small {
  font-size: 14px;
  color: #d6e3d8;
}
.points-card .points-reward {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: none;
  margin: 0;
  padding-block-start: 12px;
  border-block-start: 1px solid #ffffff2e;
  font-size: 14px;
  color: var(--paper);
}
.points-reward strong {
  display: block;
  font-weight: 600;
}
.points-reward small {
  display: block;
  margin-block-start: 4px;
  font-size: 14px;
  color: #d6e3d8;
}
.points-reward .icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--crema);
}
.points-card .account-link {
  color: var(--paper);
}
.account-actions .account-remove {
  margin-inline-start: auto;
}
.points-card :focus-visible {
  outline-color: var(--paper);
}
/* Phone numbers (packages/phone-field): flag, +code and country list before the number, left
   to right in Arabic too. The list is an invisible <select> over the flag. */
.phone-field {
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #9da99c;
  border-radius: 6px;
  background: var(--white);
}
.phone-field:has(input:focus-visible),
.phone-field:has(select:focus-visible) {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
.phone-field:has([aria-invalid='true']) {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}
.phone-field > input[type='tel'] {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  min-height: 46px;
  border: 0;
  box-shadow: none;
  border-radius: 6px;
  background: transparent;
  letter-spacing: 0.03em;
}
.phone-field > input:focus-visible,
.phone-field select:focus-visible {
  outline: none;
}
.phone-field-country {
  order: -1;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 12px 8px;
  border-inline-end: 1px solid var(--line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.phone-field-country select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.phone-field-flag,
.phone-field-iso {
  width: 24px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line);
}
.phone-field-iso {
  display: inline-grid;
  place-items: center;
  background: var(--line);
  font-size: 10px;
  font-weight: 700;
}
.phone-field-caret {
  width: 10px;
  height: 10px;
  opacity: 0.6;
}
.phone-field:has(select:disabled) .phone-field-caret {
  display: none;
}
