/* =========================================================
   DARN — Customer account page
   Same storefront language as the rest of the site: sharp corners,
   black borders and actions, Archivo Black headings, colour only
   for order status.
   ========================================================= */

.account-alert[hidden],
.account-auth [hidden],
.account-shell [hidden] {
  display: none;
}

/* Signed in, the greeting replaces the big banner. */
body.account-signed-in .page-header {
  display: none;
}

.account-muted {
  color: var(--mid-gray);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

.account-optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--mid-gray);
}

.account-field-hint {
  font-size: 0.78rem;
  color: var(--mid-gray);
  margin: -12px 0 16px;
}

.account-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.account-link:hover {
  text-decoration-thickness: 2px;
}

.account-text-btn {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.account-text-danger {
  color: #b42318;
}

#login-form .account-text-btn,
#forgot-form .account-text-btn {
  display: block;
  margin: 16px auto 0;
}

.account-alert {
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 10px 12px;
  margin: 0 0 14px;
  border-left: 3px solid currentColor;
}

.account-alert-error {
  background: #fdeceb;
  color: #a1281c;
}

.account-alert-success {
  background: #e9f5ec;
  color: #1f6b35;
}

.account-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 12px;
  cursor: pointer;
}

.account-check input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--black);
  flex-shrink: 0;
}

.account-check a {
  text-decoration: underline;
}

.account-check-large {
  padding: 16px 0;
  margin: 0;
  border-bottom: 1px solid #ecece9;
}

.account-check-large:first-of-type {
  padding-top: 0;
}

.account-lines {
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0;
  overflow-wrap: anywhere;
}

.account-empty {
  border: 1px dashed #d4d4cf;
  padding: 48px 24px;
  text-align: center;
}

.account-empty p {
  margin: 0 0 18px;
  color: var(--mid-gray);
}

.account-loading {
  padding: 24px 0;
}

/* ---------- Sign in / register ---------- */
.account-auth {
  max-width: 1000px;
  margin: 8px auto 0;
}

.account-auth-tabs {
  display: none;
}

.account-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.account-panel {
  border: 1px solid #e6e6e3;
  padding: 36px 32px;
  background: var(--white);
}

.account-panel-invite {
  background: var(--off-white);
  border-color: var(--off-white);
}

.account-panel-title {
  font-family: var(--font-display);
  text-transform: none;
  font-size: 1.4rem;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-panel .account-muted {
  margin-bottom: 24px;
}

.account-benefits {
  list-style: none;
  padding: 0;
  margin: -8px 0 28px;
}

.account-benefits li {
  position: relative;
  padding: 10px 0 10px 28px;
  font-size: 0.9rem;
  border-bottom: 1px solid #e2e2de;
}

.account-benefits li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 15px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
  transform: rotate(-45deg);
}

/* ---------- Signed-in shell ---------- */
.account-greeting {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 32px;
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
}

.account-greeting h1 {
  font-family: var(--font-display);
  text-transform: none;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 2px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.account-nav {
  display: flex;
  flex-direction: column;
  border: 1px solid #e6e6e3;
  position: sticky;
  top: 96px;
}

.account-nav a,
.account-nav-logout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark-gray);
  text-decoration: none;
  border-bottom: 1px solid #e6e6e3;
  background: var(--white);
  transition: background var(--transition), color var(--transition);
}

.account-nav a:hover {
  background: var(--off-white);
  color: var(--black);
}

.account-nav a.active {
  background: var(--black);
  color: var(--white);
}

.account-nav-count {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--mid-gray);
}

.account-nav-count:empty {
  display: none;
}

.account-nav a.active .account-nav-count {
  color: var(--light-gray);
}

.account-nav-logout {
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--mid-gray);
}

.account-nav-logout:hover {
  color: #b42318;
  background: var(--off-white);
}

.account-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.account-section-head h2 {
  font-family: var(--font-display);
  text-transform: none;
  font-size: 1.4rem;
  margin: 0 0 4px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.account-card {
  border: 1px solid #e6e6e3;
  padding: 24px;
  background: var(--white);
  min-width: 0;
}

.account-card h3,
.account-address-form h3 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

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

.account-card-narrow {
  max-width: 560px;
}

.account-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.account-card-wide {
  grid-column: 1 / -1;
}

.account-overview-btn {
  margin-top: 20px;
}

.account-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.account-thumb {
  width: 56px;
  height: 70px;
  background: var(--white);
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.account-thumb-more {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mid-gray);
}

.account-order-thumbs,
.account-fav-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Order status ---------- */
.account-status {
  display: inline-block;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--off-white);
  color: var(--dark-gray);
}

.account-status-new { background: #e9efff; color: #1d4ed8; }
.account-status-preparing { background: #fff2d9; color: #955300; }
.account-status-shipped { background: var(--black); color: var(--white); }
.account-status-delivered { background: #e5f4ea; color: #19703a; }
.account-status-cancelled { background: #efefec; color: #6b6b67; }
.account-status-default { background: var(--black); color: var(--white); }

.account-progress {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 22px 0 4px;
}

.account-progress li {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  min-width: 0;
}

/* connector to the previous step */
.account-progress li + li::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #deded9;
}

.account-progress li.done::before,
.account-progress li.current::before {
  background: var(--black);
}

.account-progress-dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid #cfcfca;
}

.account-progress li.done .account-progress-dot {
  background: var(--black);
  border-color: var(--black);
}

.account-progress li.current .account-progress-dot {
  background: var(--black);
  border-color: var(--black);
  box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.12);
}

.account-progress-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mid-gray);
  line-height: 1.3;
}

.account-progress li.done .account-progress-label,
.account-progress li.current .account-progress-label {
  color: var(--black);
}

.account-order-cancelled {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--mid-gray);
}

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

.account-order {
  border: 1px solid #e6e6e3;
  padding: 22px 24px;
}

.account-order.open {
  border-color: var(--black);
}

.account-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.account-order-head h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.account-order-head strong {
  white-space: nowrap;
}

.account-order-toggle {
  display: block;
  margin: 18px 0 0;
  padding: 0;
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.account-order-detail {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e6e6e3;
}

.account-order-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0ed;
  font-size: 0.9rem;
}

.account-order-item-info {
  flex: 1;
  min-width: 0;
}

.account-order-item-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.account-order-item-name a:hover {
  text-decoration: underline;
}

.account-order-item .account-muted {
  font-size: 0.8rem;
}

.account-order-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.account-order-columns h4 {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.account-order-columns h4:not(:first-child) {
  margin-top: 16px;
}

.account-tracking-number {
  font-weight: 600;
}

.account-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  padding: 4px 0;
}

.account-summary-total {
  font-weight: 800;
  border-top: 1px solid var(--black);
  margin-top: 6px;
  padding-top: 10px;
}

.account-order-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e6e6e3;
}

.account-cancel-btn {
  border-color: #b42318;
  color: #b42318;
}

.account-cancel-btn:hover {
  background: #b42318;
  color: var(--white);
}

/* ---------- Addresses ---------- */
.account-address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-address.is-default {
  border-color: var(--black);
}

.account-address-actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.account-address-form {
  margin-bottom: 24px;
  border-color: var(--black);
}

.account-address-form h3 {
  margin-bottom: 18px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}

.account-address-form textarea {
  min-height: 90px;
}

.account-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ---------- Details, preferences, favourites ---------- */
.account-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.account-forms .account-card h3 {
  margin-bottom: 18px;
}

.account-fav-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- Confirm dialog ---------- */
.account-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 300;
}

.account-dialog {
  background: var(--white);
  padding: 28px;
  width: 100%;
  max-width: 420px;
}

.account-dialog p {
  margin: 0 0 22px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.account-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .account-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
  }

  .account-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-order-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .account-fav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Phone ---------- */
@media (max-width: 768px) {
  .account-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 20px;
    border: 1px solid var(--black);
  }

  .account-auth-tabs button {
    padding: 13px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--white);
    color: var(--black);
    border: none;
    cursor: pointer;
  }

  .account-auth-tabs button.active {
    background: var(--black);
    color: var(--white);
  }

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

  .account-auth[data-mode="register"] .account-auth-login,
  .account-auth:not([data-mode="register"]) .account-auth-register {
    display: none;
  }

  .account-panel {
    padding: 0;
    border: none;
  }

  .account-panel-title {
    display: none;
  }

  .account-auth[data-mode="forgot"] .account-panel-title {
    display: block;
  }

  .account-auth[data-mode="forgot"] .account-auth-tabs {
    display: none;
  }

  .account-greeting {
    margin-bottom: 18px;
  }

  .account-avatar {
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
  }

  .account-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* The menu becomes a row of tabs you swipe sideways. */
  .account-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border: none;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }

  .account-nav::-webkit-scrollbar {
    display: none;
  }

  .account-nav a,
  .account-nav-logout {
    flex: 0 0 auto;
    border: 1px solid #d8d8d4;
    padding: 10px 14px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .account-nav a.active {
    border-color: var(--black);
  }

  .account-nav-logout {
    border-color: transparent;
  }

  .account-section-head h2 {
    font-size: 1.15rem;
  }

  .account-section-head .btn {
    width: 100%;
  }

  .account-card,
  .account-order {
    padding: 18px 16px;
  }

  .account-overview,
  .account-address-grid,
  .account-order-columns,
  .account-form-grid {
    grid-template-columns: 1fr;
  }

  .account-order-columns {
    gap: 18px;
  }

  .account-order-head h3 {
    font-size: 0.95rem;
  }

  .account-progress-label {
    font-size: 0.7rem;
  }

  .account-order-actions .btn,
  .account-overview-btn,
  .account-form-actions .btn,
  .account-forms .btn,
  #prefs-form .btn {
    width: 100%;
  }

  .account-fav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
