/* ============================================================
   We Love Soho - Account pages shared stylesheet
   Loaded on all /account/* pages, after tokens-app.css and tokens-web.css.
   ============================================================ */

/* ---- Layout ---- */

.account-header {
  display: flex;
  align-items: center;
  padding: var(--s-4) var(--page-pad-web);
  border-bottom: 1px solid var(--border-1);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.account-header .wordmark {
  font-size: 18px;
  color: var(--fg-1);
}

.account-main {
  padding-top: var(--s-10);
  padding-bottom: var(--s-18);
  min-height: calc(100vh - 120px);
}

.account-footer {
  border-top: 1px solid var(--border-1);
  padding: var(--s-6) var(--page-pad-web);
  text-align: center;
}

.account-footer a {
  color: var(--fg-3);
}

/* ---- Card ---- */

.account-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--s-8);
  max-width: 560px;
  box-shadow: var(--shadow-sm);
  /* Stacked cards (e.g. subscription page header card + body card) must have a
     gap between them; without this they sit flush. Last card resets below. */
  margin-bottom: var(--s-5);
}

.account-card:last-child {
  margin-bottom: 0;
}

.account-card--centred {
  text-align: center;
  margin-inline: auto;
}

.account-card--wide {
  max-width: 800px;
}

.account-card .t-eyebrow {
  margin-bottom: var(--s-2);
}

.account-card .t-h1 {
  margin: 0 0 var(--s-6);
}

.account-card .web-lede {
  margin: var(--s-4) 0;
}

/* ---- Definition list ---- */

.account-dl {
  display: grid;
  gap: 0;
  margin: var(--s-6) 0 0;
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.account-dl__row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--bg);
  border-bottom: 1px solid var(--border-1);
}

.account-dl__row:last-child {
  border-bottom: 0;
}

.account-dl dt {
  flex: 0 0 140px;
  color: var(--fg-2);
  font: var(--t-label);
  font-weight: var(--fw-medium);
}

.account-dl dd {
  flex: 1;
  margin: 0;
  font: var(--t-body);
  color: var(--fg-1);
}

/* ---- Badges ---- */

.account-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font: var(--t-caption);
  font-weight: var(--fw-semi);
  text-transform: capitalize;
}

.account-badge--success {
  background: var(--success-soft);
  color: var(--success);
}

.account-badge--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ---- Buttons ---- */

.account-btn {
  /* Label is ALWAYS centred both axes - robust even when a button gets an
     explicit width (e.g. width:100%) or other inline styles. Do NOT override
     `display` inline (use inline-flex only) or centring breaks. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  gap: var(--s-2);
  padding: 0 var(--s-6);
  height: 44px;
  border-radius: var(--r-sm);
  font: var(--t-label);
  font-weight: var(--fw-semi);
  text-decoration: none;
  transition: background var(--d-fast) var(--ease-out),
              color var(--d-fast) var(--ease-out),
              box-shadow var(--d-fast) var(--ease-out);
  cursor: pointer;
  border: none;
}

.account-btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.account-btn--primary:hover {
  background: var(--accent-hover);
}

.account-btn--secondary {
  background: var(--surface-2);
  color: var(--fg-1);
  border: 1px solid var(--border-2);
}

.account-btn--secondary:hover {
  background: var(--surface-3);
}

/* Size + intent variants - centrally defined so pages use the class, not
   re-invented inline styles. */
.account-btn--sm {
  height: 36px;
  padding: 0 var(--s-5);
  font-size: 13px;
}
.account-btn--danger {
  background: var(--accent);
  color: #fff;
  border: none;
}
.account-btn--danger:hover {
  opacity: 0.88;
}

/* ---- Form fields (centralised - used by sign-in, /join, coupon, etc.) ---- */
/* A form field is ALWAYS a readable light field with dark text, in any theme,
   so typed text never goes light-on-white (the dark-theme --fg-1 token rendered
   near-white on the white input = illegible). Defined ONCE here, not per page. */
.account-input {
  width: 100%;
  padding: var(--s-4, 12px) var(--s-5, 16px);
  border: 1.5px solid #cfd4dc;
  border-radius: var(--r-md, 8px);
  font-size: 16px; /* >=16px so iOS doesn't zoom on focus */
  color: #131820;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}
.account-input::placeholder { color: #6b7280; opacity: 1; }
.account-input:focus {
  border-color: var(--accent);
  /* Focus glow = brand orange (--accent / --red-7 #BA492D) at 20% alpha. Kept as
     an rgba literal because a hex token can't carry alpha here; update alongside
     --red-7 in tokens-app.css if the brand colour changes. */
  box-shadow: 0 0 0 3px rgba(201, 62, 31, 0.20);
}
.account-input--otp {
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  color: #131820;
}
.account-error {
  color: var(--accent);
  font-size: var(--t-caption-size, 12px);
  margin-top: var(--s-3, 8px);
}

/* ---- Actions group ---- */

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
  justify-content: center;
}

/* ---- Table ---- */

.account-table-wrap {
  margin-top: var(--s-6);
  overflow-x: auto;
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
}

.account-table {
  width: 100%;
  border-collapse: collapse;
}

.account-table th,
.account-table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--border-1);
  white-space: nowrap;
}

.account-table th {
  background: var(--surface-1);
  font: var(--t-label);
  font-weight: var(--fw-semi);
  color: var(--fg-2);
}

.account-table tbody tr:last-child td {
  border-bottom: 0;
}

.account-table tbody tr:hover td {
  background: var(--surface-1);
}

.account-table__empty {
  text-align: center;
  padding: var(--s-8) !important;
  color: var(--fg-3) !important;
}

/* ---- Links ---- */

.account-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--d-fast) var(--ease-out);
}

.account-link:hover {
  text-decoration-color: var(--accent);
}

/* ---- Success icon ---- */

.account-success-icon {
  display: inline-flex;
  margin-bottom: var(--s-5);
}

/* ---- Dashboard hub grid ---- */

.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5, 16px);
  max-width: 860px;
  margin-top: var(--s-8);
}

.hub-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-7);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.hub-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.hub-card__title {
  font: var(--t-label);
  font-weight: var(--fw-semi);
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.hub-card__link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.hub-card__link:hover {
  text-decoration: underline;
}

.hub-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border-subtle, #e6e6ea);
  gap: var(--s-3);
}

.hub-plan-row:last-child {
  border-bottom: none;
}

.hub-plan-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-plan-context {
  color: var(--fg-3);
}

.hub-plan-tier {
  font-weight: var(--fw-semi);
  font-size: 15px;
  color: var(--fg-1);
}

.hub-inv-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-subtle, #e6e6ea);
}

.hub-inv-row:last-child {
  border-bottom: none;
}

.hub-empty {
  color: var(--fg-3);
  padding: var(--s-3) 0;
}

.hub-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-8);
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .account-card {
    padding: var(--s-5);
    border-radius: var(--r-md);
  }

  .account-dl dt {
    flex: 0 0 100px;
  }

  .account-table th,
  .account-table td {
    font-size: 13px;
    padding: var(--s-2) var(--s-3);
  }

  .hub-inv-row {
    grid-template-columns: 70px 1fr auto;
  }
}
