/* ===========================================================================
   ACCOUNT PORTAL — layout ported from the Axos child theme (axos-child),
   measured from its own stylesheet:
     .axos-account      padding 48px 16px 64px
     .axos-welcome      mb 40px (48 on dashboard), eyebrow mb 14px
     .axos-shell        flex row, align-items flex-start
     .axos-sidebar      flex 0 0 210px
     .axos-content      flex 1 1 auto, min-width 0
     nav item           10px/12px pad, radius 10px, gap 11px, 13.5px/500
     block              mb 40px; head flex space-between align-end mb 18px
     tiles              grid 4 → 2 → 1, gap 12px; tile pad 16px
     stats              grid 3 → 1, gap 12px; stat pad 20px 22px; value 30px
     orders             flex col gap 12px; order pad 22px

   Colour, radius and type resolve through OUR tokens — the Axos palette
   (lime), display font and Tabler webfont are deliberately not carried over.
   =========================================================================== */

/* WP prints the page's own title above the portal — the account templates
   carry their own welcome header, so the block title is duplicate furniture. */
body.ms-account-page .wp-block-post-title,
body.ms-account-page .entry-title { display: none; }
body.ms-account-page main { padding-top: 0; margin-top: 0; }

body.ms-account-page .woocommerce { width: 100%; max-width: none; padding: 0; margin: 0; }
body.ms-account-page .woocommerce::before,
body.ms-account-page .woocommerce::after { content: none; display: none; }
/* Woo's own float nav is replaced by our sidebar */
body.ms-account-page .woocommerce-MyAccount-navigation { display: none; }
body.ms-account-page .woocommerce-MyAccount-content { width: 100%; max-width: none; float: none; margin: 0; padding: 0; }

.acct {
  box-sizing: border-box; width: 100%;
  max-width: calc(80rem + 2rem); margin-inline: auto;
  padding: 3rem 1rem 4rem;
}
@media (min-width: 640px) { .acct { max-width: calc(80rem + 3rem); padding-inline: 1.5rem; } }

/* ---- welcome -------------------------------------------------------------- */
.acct-welcome { margin-bottom: 2.5rem; }
.acct-welcome--lg { margin-bottom: 3rem; }
.acct-eyebrow {
  margin: 0 0 0.875rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.acct-eyebrow--brand { color: var(--brand); }
.acct-eyebrow--muted { color: var(--ink-4); }
.acct-display {
  margin: 0; font-size: clamp(1.875rem, 3vw, 2.5rem); line-height: 1.1;
  letter-spacing: -0.025em; font-weight: 600; color: var(--foreground); text-wrap: balance;
}
.acct-display--lg {
  font-size: clamp(2.5rem, 6vw, 4rem); line-height: 0.98; letter-spacing: -0.028em;
  margin-bottom: 0.875rem;
}
.acct-lede { margin: 0; max-width: 34rem; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }

/* ---- shell ---------------------------------------------------------------- */
.acct-shell { display: flex; flex-direction: column; gap: 2rem; align-items: flex-start; }
@media (min-width: 900px) {
  .acct-shell { flex-direction: row; gap: 3rem; }
  .acct-sidebar { flex: 0 0 210px; width: 210px; max-width: 210px; }
}
.acct-sidebar { width: 100%; min-width: 0; }
.acct-content { flex: 1 1 auto; min-width: 0; width: 100%; }

.acct-sidebar__section + .acct-sidebar__section { margin-top: 2.25rem; }
.acct-sidebar__section .acct-eyebrow { padding-left: 0.75rem; }
.acct-sidebar__support { margin: 0; padding-left: 0.75rem; font-size: 0.84375rem; line-height: 1.55; color: var(--ink-2); }

/* ---- nav ------------------------------------------------------------------ */
.acct-nav { display: flex; flex-direction: column; gap: 2px; }
.acct-nav__item {
  display: flex; align-items: center; gap: 11px;
  padding: 0.625rem 0.75rem; border: 1px solid transparent; border-radius: var(--radius-2xl);
  font-size: 0.84375rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: color 200ms var(--ease-out-quart), background-color 200ms var(--ease-out-quart);
}
.acct-nav__item:hover { background: color-mix(in oklab, var(--foreground) 4%, transparent); color: var(--foreground); }
.acct-nav__item:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.acct-nav__item.is-active { background: var(--brand-muted); color: var(--foreground); font-weight: 600; }
.acct-nav__icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.7; transition: opacity 200ms var(--ease-out-quart); }
.acct-nav__item:hover .acct-nav__icon,
.acct-nav__item.is-active .acct-nav__icon { opacity: 1; }
.acct-nav__item.is-active .acct-nav__icon { color: var(--brand); }

/* ---- blocks --------------------------------------------------------------- */
.acct-block { margin-bottom: 2.5rem; }
.acct-block:last-child { margin-bottom: 0; }
.acct-block__head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; margin-bottom: 1.125rem;
}
.acct-h2 { margin: 0; font-size: 1.375rem; line-height: 1.15; letter-spacing: -0.015em; font-weight: 600; color: var(--foreground); }

/* ---- reorder tiles -------------------------------------------------------- */
.acct-tiles { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 560px)  { .acct-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .acct-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.acct-tile {
  display: flex; flex-direction: column; padding: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card);
  transition: border-color 220ms var(--ease-out-quart), transform 220ms var(--ease-out-quart);
}
@media (hover: hover) and (pointer: fine) {
  .acct-tile:hover { border-color: color-mix(in oklab, var(--foreground) 16%, transparent); transform: translateY(-1px); }
}
.acct-tile__img {
  display: block; aspect-ratio: 1 / 1; overflow: hidden; margin-bottom: 0.875rem;
  border: 1px solid color-mix(in oklab, var(--foreground) 4%, transparent);
  border-radius: var(--radius-lg); background: var(--p-stage-light-2);
}
.acct-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-tile__name { margin: 0 0 0.3125rem; font-size: 0.875rem; font-weight: 600; letter-spacing: -0.008em; line-height: 1.3; }
.acct-tile__name a { color: var(--foreground); text-decoration: none; }
.acct-tile__name a:hover { color: var(--brand); }
.acct-tile__meta {
  margin: 0 0 0.875rem; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.acct-tile__cta { margin-top: auto; align-self: flex-start; }

/* ---- stats ---------------------------------------------------------------- */
.acct-stats { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
@media (min-width: 640px) { .acct-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.acct-stat {
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card);
  transition: border-color 220ms var(--ease-out-quart);
}
.acct-stat:hover { border-color: color-mix(in oklab, var(--foreground) 16%, transparent); }
.acct-stat .acct-eyebrow { margin-bottom: 0.625rem; }
.acct-stat__value {
  margin: 0; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.875rem; line-height: 1; letter-spacing: -0.014em; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--foreground);
}
.acct-stat__value .woocommerce-Price-amount { color: inherit; font: inherit; }

/* ---- order cards ---------------------------------------------------------- */
.acct-orders { display: flex; flex-direction: column; gap: 0.75rem; }
.acct-order {
  padding: 1.375rem; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); transition: border-color 220ms var(--ease-out-quart);
}
.acct-order:hover { border-color: color-mix(in oklab, var(--foreground) 16%, transparent); }
.acct-order__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.875rem; }
.acct-order__num { margin: 0; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; color: var(--foreground); }
.acct-order__date { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--ink-3); }
.acct-order__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 0.875rem; border-top: 1px solid var(--border); }
.acct-order__total {
  margin: 0; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--foreground);
}
.acct-order__total .woocommerce-Price-amount { color: inherit; font: inherit; }

.acct-status {
  display: inline-flex; align-items: center; flex-shrink: 0;
  border-radius: 999px; padding: 0.25rem 0.625rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--secondary); color: var(--ink-2);
}
.acct-status--completed { background: color-mix(in oklab, var(--stock-in) 12%, transparent); color: var(--stock-in); }
.acct-status--processing { background: var(--brand-muted); color: var(--brand); }
.acct-status--cancelled, .acct-status--failed, .acct-status--refunded { background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); }

/* ---- empty state ---------------------------------------------------------- */
.acct-empty {
  display: grid; place-items: center; text-align: center; gap: 0.25rem;
  padding: 4rem 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card);
}
.acct-empty__glyph {
  display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 0.75rem;
  border-radius: 999px; background: var(--secondary); color: var(--ink-3);
}
.acct-empty__note { margin: 0.25rem 0 1.25rem; max-width: 30rem; color: var(--ink-2); }

/* ---- Woo's own account tables/forms, in our register ----------------------- */
body.ms-account-page .woocommerce-orders-table,
body.ms-account-page .shop_table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden;
  background: var(--card);
}
body.ms-account-page .shop_table th {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); text-align: left; padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
body.ms-account-page .shop_table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
body.ms-account-page .shop_table tr:last-child td { border-bottom: none; }
body.ms-account-page .woocommerce-Price-amount { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

body.ms-account-page .woocommerce-Address {
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); padding: 1.25rem;
}
body.ms-account-page .woocommerce-Address-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
body.ms-account-page .woocommerce-Address-title h2, body.ms-account-page .woocommerce-Address-title h3 { margin: 0; font-size: 1rem; font-weight: 600; }

body.ms-account-page .woocommerce-form-row label,
body.ms-account-page .form-row label { display: block; margin-bottom: 0.375rem; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
body.ms-account-page .woocommerce-Input,
body.ms-account-page .form-row input[type="text"],
body.ms-account-page .form-row input[type="email"],
body.ms-account-page .form-row input[type="password"],
body.ms-account-page .form-row input[type="tel"],
body.ms-account-page .form-row select {
  width: 100%; height: 2.75rem; padding-inline: 0.75rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--background); color: var(--foreground);
  font-family: inherit; font-size: 0.9375rem; outline: none;
  transition: border-color 150ms var(--ease-out-quart), box-shadow 150ms var(--ease-out-quart);
}
body.ms-account-page .woocommerce-Input:focus,
body.ms-account-page .form-row input:focus,
body.ms-account-page .form-row select:focus {
  border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 26%, transparent);
}
body.ms-account-page .woocommerce-Button,
body.ms-account-page .woocommerce-button,
body.ms-account-page button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.75rem; padding-inline: 1.25rem;
  border: 1px solid transparent; border-radius: var(--radius-lg);
  background: var(--brand); color: var(--brand-foreground);
  font-family: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  box-shadow: var(--elevation-key);
  transition: background-color 150ms var(--ease-out-quart), box-shadow 200ms var(--ease-out-quart), transform 160ms var(--ease-out-quart);
}
body.ms-account-page .woocommerce-Button:hover,
body.ms-account-page button[type="submit"]:hover { background: var(--brand-hover); box-shadow: var(--shadow-brand); }
body.ms-account-page .woocommerce-Button:active,
body.ms-account-page button[type="submit"]:active { transform: scale(0.98); }


/* ---- logged-out auth surface ---------------------------------------------- */
.acct--auth .acct-welcome { margin-bottom: 2rem; }
.acct-auth { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 30rem; }
.acct-auth--split { max-width: 56rem; }
@media (min-width: 820px) { .acct-auth--split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; } }
.acct-card {
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); box-shadow: var(--elevation-whisper); padding: 1.5rem;
}
.acct-card .acct-h2 { margin-bottom: 1.25rem; }
.acct-card .form-row { margin-bottom: 1rem; }
.acct-card .required { color: var(--destructive); }
.acct-auth__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin: 0.25rem 0 1.25rem;
}
.acct-check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--ink-2); cursor: pointer; }
.acct-check input { width: 1rem; height: 1rem; accent-color: var(--brand); }
.acct-auth__lost { font-size: 0.8125rem; color: var(--ink-3); text-decoration: none; }
.acct-auth__lost:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.acct-auth__note { margin: 0 0 1.25rem; font-size: 0.8125rem; line-height: 1.55; color: var(--ink-3); }

/* Woo draws its own border/padding on the login+register forms; our .acct-card
   already provides the frame, so the default produced a box-in-box. */
body.ms-account-page .woocommerce-form-login,
body.ms-account-page .woocommerce-form-register,
body.ms-account-page form.login,
body.ms-account-page form.register {
  border: none; padding: 0; margin: 0; background: none; border-radius: 0;
}
body.ms-account-page .woocommerce-form-login__submit { margin: 0; float: none; }
