/* Wholesome Wellness — the customer's own subscription page (account.html).

   Reuses the checkout's header, footer and field styles (css/checkout.css); everything here is the
   subscription cards and the cancel panel inside them. One column throughout: this is a page people
   open on a phone, from an email, to press one button. */

.acct {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px var(--pad-x) 72px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.acct-view { display: flex; flex-direction: column; gap: 18px; }
.acct-loading { color: var(--c-text-2); }
.acct-title { margin: 0; }
.acct-lede { margin: 0; max-width: 48ch; }
.acct-help { margin: 8px 0 0; }
.acct-help a, .acct-lede a { color: var(--c-honey-deep); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- sign in ---------- */
.acct-signin { display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
.acct-signin__go { align-self: flex-start; }

/* ---------- the flash line ---------- */
/* One place for every answer the server gives, above the cards rather than inside one: an action can
   change more than the card it was pressed in (a skip moves a date, a cancel empties the list). */
.acct-flash {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-beige-dark);
  background: var(--c-white);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.25;
  color: var(--c-text);
}
.acct-flash--ok { border-color: var(--c-green); background: #f2fbef; }
.acct-flash--warn { border-color: var(--c-alert); background: #fdf3f3; color: #8f2b2b; }

/* ---------- one subscription ---------- */
.acct-list { display: flex; flex-direction: column; gap: 16px; }
.acct-card {
  background: var(--c-card);
  border: 1px solid var(--c-beige-dark);
  border-radius: var(--r-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.acct-card__status {
  margin: 0;
  font-family: var(--f-label);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.acct-card__status--ok { color: var(--c-green-deep); }
.acct-card__status--warn { color: var(--c-alert); }
.acct-card__status--off { color: var(--c-text-2); }

.acct-card__items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--f-display);
  font-size: 22px;
  line-height: 1.15;
  color: var(--c-black);
}

/* Label above value, so a long product name or a two-line date never squeezes its own label. */
.acct-card__facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px 18px;
  padding: 16px 0;
  border-top: 1px solid var(--c-beige-dark);
  border-bottom: 1px solid var(--c-beige-dark);
}
.acct-card__facts dt {
  font-family: var(--f-label);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-text-2);
  margin-bottom: 5px;
}
.acct-card__facts dd {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.2;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.acct-card__note { margin: -4px 0 0; }

/* Sits beside the figure, not under it: it explains the number rather than competing with it. */
.acct-card__off {
  display: inline-block;
  margin-left: 8px;
  font: 600 11px/1.4 var(--f-body);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-honey-deep);
  white-space: nowrap;
  vertical-align: 2px;
}

/* Cancelling one product sits with that product, not down in the actions row — it is a smaller
   decision than cancelling the lot and should not look like the same size of button. */
.acct-card__drop {
  border: 0;
  background: none;
  padding: 2px 4px;
  font: 600 12px/1 var(--f-body);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-text-2);
  cursor: pointer;
  border-radius: var(--r-xs, 6px);
  vertical-align: 1px;
}
.acct-card__drop:hover, .acct-card__drop:focus-visible { color: var(--c-alert); text-decoration: underline; }

.acct-card__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* Cancel is findable but not the thing the eye lands on first. */
.acct-card__cancel { color: var(--c-text-2); }
.acct-card__cancel:hover { color: var(--c-alert); border-color: var(--c-alert); }

/* ---------- cancelling ---------- */
.acct-cancel {
  background: var(--c-white);
  border: 1px solid var(--c-beige-dark);
  border-radius: var(--r-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.acct-cancel[hidden] { display: none; }
.acct-cancel__title {
  margin: 0;
  font-family: var(--f-display);
  font-size: 19px;
  line-height: 1.2;
  color: var(--c-black);
}
.acct-cancel .body { margin: 0; }
.acct-cancel__label { font-size: 13px; color: var(--c-text); }
.acct-cancel__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* checkout.css styles inputs and selects; the comment box is only ever on this page. */
.acct-cancel textarea {
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--c-text);
  background: var(--c-white);
  border: 1px solid var(--c-beige-dark);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  resize: vertical;
  min-height: 56px;
}
.acct-cancel textarea:focus {
  outline: none;
  border-color: var(--c-text);
  box-shadow: 0 0 0 3px rgba(84, 74, 66, .12);
}

.acct-none { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.acct-none[hidden] { display: none; }

/* ---------- delivery address ----------
   One address for the person, not one per subscription: see netlify/lib/account.mjs updateShipping. */
.acct-addr {
  background: var(--c-white);
  border: 1px solid var(--c-beige-dark);
  border-radius: var(--r-sm);
  padding: 22px;
  margin-top: 18px;
}
.acct-addr[hidden] { display: none; }
.acct-addr__title { margin: 0; font: 600 19px/1.2 var(--f-body); color: var(--c-text); }
.acct-addr__lede { margin: 6px 0 0; }
.acct-addr__now { margin: 14px 0 16px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.acct-addr__form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 16px; }
.acct-addr__form[hidden] { display: none; }
.acct-addr__form .co-field { grid-column: 1 / -1; }
.acct-addr__form .co-field--half { grid-column: span 1; }
.acct-addr__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.acct-addr [data-addr-edit][hidden] { display: none; }

@media (max-width: 560px) {
  .acct { padding-top: 30px; }
  .acct-card { padding: 18px; }
  .acct-card__items { font-size: 20px; }
  /* full-width buttons stacked: one thumb, one target */
  .acct-card__actions .btn, .acct-cancel__actions .btn { width: 100%; justify-content: center; }
  .acct-addr { padding: 18px; }
  /* one column: a two-up address form at phone width leaves fields too narrow to read what you typed */
  .acct-addr__form { grid-template-columns: 1fr; }
  .acct-addr__form .co-field--half { grid-column: 1 / -1; }
  .acct-addr__actions .btn, .acct-addr > [data-addr-edit] { width: 100%; justify-content: center; }
}
