/* My Account — checkout-style shell */

.account-page {
  padding: 0;
  margin: 0;
}

.account-page .woocommerce > .woocommerce-notices-wrapper:first-child {
  display: none;
}

.account-hero__center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.account-hero__avatar {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
}

.account-hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-hero__initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.account-body {
  padding-bottom: 80px;
}

.account-panel {
  width: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.account-panel__layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 0;
  min-height: 480px;
  align-items: start;
}

.account-panel--guest {
  max-width: 480px;
  margin-inline: auto;
}

.account-nav {
  padding: 24px 16px 24px 24px;
  border-right: 1px solid var(--border-subtle);
  background: #0c0c0c;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.account-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  transition: color var(--transition), background var(--transition);
}

.account-nav__link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.account-nav__item.is-active .account-nav__link {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.account-nav__item--logout {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.account-nav__item--logout .account-nav__link {
  color: var(--text-muted);
}

.account-nav__icon {
  display: flex;
  flex-shrink: 0;
  opacity: 0.75;
}

.account-content {
  padding: 28px 28px 32px;
  background: #111111;
  min-height: 360px;
}

.account-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.account-section__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-section__link {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.account-section__link:hover {
  color: var(--text-primary);
}

/* Dashboard KPI cards */
.account-cards--kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.account-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.account-card__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account-card__value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.account-card__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.account-card__link:hover {
  color: var(--text-primary);
}

.account-card__value--money {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.account-card__value--date {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: -0.02em;
}

/* Orders list */
.account-orders {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-order-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  transition: border-color var(--transition), background var(--transition);
}

.account-order-row:hover {
  border-color: var(--border-default);
  background: rgba(255, 255, 255, 0.04);
}

.account-order-row__number {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.account-order-row__date,
.account-order-row__total {
  font-size: 14px;
  color: var(--text-secondary);
}

.account-order-row__total {
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
}

.account-status {
  display: inline-flex;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.account-status.is-completed {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.account-status.is-processing {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.account-status.is-pending,
.account-status.is-hold {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.account-status.is-cancelled,
.account-status.is-failed,
.account-status.is-refunded {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.account-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.account-pagination {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* View order — invoice layout */
.account-order-view__back {
  margin: 0 0 20px;
  font-size: 13px;
}

.account-order-view__back a {
  color: var(--text-muted);
}

.account-order-view__back a:hover {
  color: var(--text-primary);
}

.account-invoice {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.account-invoice__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.account-invoice__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-invoice__meta {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.account-invoice__body {
  padding: 0;
}

.account-invoice__section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.account-invoice__section:last-child {
  border-bottom: none;
}

.account-invoice__section-title {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account-invoice__section--downloads .thankyou-downloads {
  margin: 0;
}

.account-invoice__section--downloads .thankyou-downloads__table thead th {
  background: transparent;
  padding-top: 0;
}

.account-invoice__table-wrap {
  overflow-x: auto;
}

.account-invoice__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.account-invoice__table thead th {
  padding: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.account-invoice__table thead .product-total {
  text-align: right;
}

.account-invoice__table tbody td {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

.account-invoice__table tbody .product-name {
  color: var(--text-primary);
  font-weight: 500;
}

.account-invoice__table tbody .product-total {
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-invoice__table tbody tr:last-child td {
  border-bottom: none;
}

.account-invoice__totals th,
.account-invoice__totals td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.account-invoice__totals th {
  font-weight: 500;
  text-align: left;
}

.account-invoice__totals td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.account-invoice__total-row--order_total th,
.account-invoice__total-row--order_total td {
  padding-top: 14px;
  border-bottom: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.account-invoice__action-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: background var(--transition), border-color var(--transition);
}

.account-invoice__action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-default);
}

/* LMFWC license keys + plugin sections after order table */
.account-invoice__body > h2,
.account-invoice__body > section > h2 {
  margin: 0;
  padding: 24px 28px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account-invoice__body > table.shop_table,
.account-invoice__body > div > table.shop_table {
  width: calc(100% - 56px);
  margin: 16px 28px 24px;
  border-collapse: collapse;
  font-size: 14px;
}

.account-invoice__body > table.shop_table th,
.account-invoice__body > table.shop_table td,
.account-invoice__body > div > table.shop_table th,
.account-invoice__body > div > table.shop_table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-align: left;
  vertical-align: top;
}

.account-invoice__body > table.shop_table tbody tr:last-child td,
.account-invoice__body > div > table.shop_table tbody tr:last-child td {
  border-bottom: none;
}

.account-invoice__body > table.shop_table code,
.account-invoice__body > div > table.shop_table code {
  display: inline-block;
  padding: 6px 10px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  letter-spacing: 0.04em;
}

.account-order-view .woocommerce-customer-details {
  display: none !important;
}

.account-invoice__section--items > h2 {
  margin: 24px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account-invoice__section--items > table.shop_table,
.account-invoice__section--items > div > table.shop_table {
  width: 100%;
  margin: 16px 0 0;
}

.account-invoice__section--notes {
  border-bottom: 1px solid var(--border-subtle);
}

.account-order-notes {
  margin-bottom: 0;
}

.account-order-notes__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-order-notes__item {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text-secondary);
}

.account-order-notes__item time {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Guest login / lost password */
.account-guest {
  padding: 32px 28px;
}

.account-guest__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-align: center;
}

.account-guest__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.account-guest__footer {
  margin: 16px 0 0;
  font-size: 13px;
  text-align: center;
}

.account-guest__footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.account-guest__footer a:hover {
  color: var(--text-primary);
}

/* Forms */
.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.account-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-form__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.account-form__input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color var(--transition);
}

.account-form__input:focus {
  border-color: var(--border-default);
}

.account-form__input::placeholder {
  color: var(--text-muted);
}

.account-form__fieldset {
  margin: 8px 0 0;
  padding: 0;
  border: none;
}

.account-form__legend {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.account-form__row {
  display: flex;
  align-items: center;
}

.account-form__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.account-form__checkbox input {
  accent-color: var(--accent);
}

.account-form__actions {
  margin-top: 4px;
}

.account-form__submit {
  width: 100%;
}

/* Notices */
.account-page .woocommerce-error,
.account-page .woocommerce-info,
.account-page .woocommerce-message,
.account-notices .woocommerce-error,
.account-notices .woocommerce-info,
.account-notices .woocommerce-message {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  list-style: none;
}

.account-page .woocommerce-error {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.account-page .woocommerce-message {
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

/* Hide stray page titles */
.account-page > h1,
.account-page .entry-header,
.account-page .entry-title,
.account-page .wp-block-post-title {
  display: none !important;
}

@media (max-width: 900px) {
  .account-cards--kpi {
    grid-template-columns: 1fr;
  }

  .account-panel__layout {
    grid-template-columns: 1fr;
  }

  .account-nav {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px;
    overflow-x: auto;
  }

  .account-nav__list {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: max-content;
  }

  .account-nav__item--logout {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  .account-nav__link {
    white-space: nowrap;
  }

  .account-order-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .account-order-row__date {
    grid-column: 1 / -1;
    font-size: 13px;
  }

  .account-form__grid {
    grid-template-columns: 1fr;
  }

  .account-invoice__header,
  .account-invoice__section {
    padding: 20px 18px;
  }

  .account-invoice__body > table.shop_table,
  .account-invoice__body > div > table.shop_table {
    width: calc(100% - 36px);
    margin-inline: 18px;
  }
}
