/* /account page — tabbed layout. Loaded via content_for :css from account/show.html.erb. */

.account-wrap { max-width: 1000px; margin: 0 auto; padding: 20px 12px; }

.account-hero h1 { font-size: 1.6rem; font-weight: 700; color: var(--fg-strong); margin: 0 0 2px; }
.account-hero .account-sub { color: var(--fg-muted); font-size: 0.85rem; margin: 0 0 18px; }

/* Desktop: nav + panel side by side */
.account-body { display: flex; gap: 20px; align-items: flex-start; }

.account-nav {
  width: 190px; flex-shrink: 0;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 6px;
  position: sticky; top: 12px; align-self: flex-start;
}
.account-nav a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 12px; border-radius: 6px;
  color: var(--fg-text); text-decoration: none; font-weight: 500; font-size: 0.92rem;
}
.account-nav a:hover { background: var(--bg-accent-tint); }
.account-nav a:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.account-nav a.active { background: var(--brand-blue); color: #fff; }
.account-nav a .chev { color: var(--fg-muted); display: none; }

.account-panel {
  flex: 1; min-width: 0;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 22px;
}
.account-panel h2 { font-size: 1.2rem; font-weight: 700; color: var(--fg-strong); margin: 0 0 16px; }
.account-panel h3 { font-size: 0.95rem; font-weight: 700; color: var(--fg-strong); margin: 22px 0 8px; }
.account-panel a { color: var(--brand-blue); text-decoration: none; font-weight: 500; }
.account-panel a:hover { text-decoration: underline; }

.account-back { display: none; font-size: 0.85rem; margin-bottom: 10px; } /* shown via media query below */

/* Mobile: stack. Menu root shows nav only; a tab page shows panel + back link. */
@media (max-width: 819px) {
  .account-body { flex-direction: column; }
  .account-nav { width: 100%; }
  .account-nav a .chev { display: inline; }
  .account-panel { width: 100%; }
  .account-back { display: block; }
  body.account-root .account-panel { display: none; }
  body.account-tab  .account-nav   { display: none; }
  .account-field-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .account-field-grid label { margin-top: 8px; }
}

.account-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.account-dl dt { color: var(--fg-muted); font-size: 0.9rem; }
.account-dl dd { margin: 0; color: var(--fg-text); font-size: 0.9rem; }

.account-msg { padding: 14px; border-radius: 6px; margin-bottom: 18px; text-align: center; font-size: 0.9rem; }
.account-msg-error   { background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-fg); }
.account-msg-success { background: var(--ok-bg);  border: 1px solid var(--ok-border);  color: var(--ok-fg); }

.account-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.account-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.account-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border-subtle); color: var(--fg-muted); font-weight: 600; }
.account-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--fg-text); }
.account-empty { color: var(--fg-muted); font-size: 0.9rem; }

.account-panel .account-btn {
  display: inline-block; padding: 7px 16px; font-size: 0.88rem;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--brand-blue); color: #fff; cursor: pointer; text-decoration: none;
}
.account-panel .account-btn:hover { background: var(--brand-blue-hover); text-decoration: none; }
.account-panel .account-btn-secondary { background: var(--bg-card); color: var(--fg-text); }
.account-panel .account-btn-danger { background: var(--bg-card); color: var(--err-fg); border-color: var(--err-border); }
.account-table td form { display: inline-block; }

/* Billing contact form grid */
.account-field-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: center; max-width: 520px; }
.account-field-grid label { color: var(--fg-muted); font-size: 0.88rem; }
.account-field-grid input { width: 100%; padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: 5px; background: var(--bg-card); color: var(--fg-text); font-size: 0.88rem; }
.account-field-actions { grid-column: 1 / -1; text-align: right; }
/* ─── Checkbox preference toggles ──────────────────────────────────────────*/
.account-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--fg-text); margin: 6px 0; cursor: pointer; }
.account-check input { flex: none; width: 1rem; height: 1rem; }
.account-check-saved { opacity: 0; font-size: 0.8rem; color: var(--ok-fg); margin-left: 4px; pointer-events: none; }
.account-check-saved.show { animation: account-check-saved-flash 1.4s ease forwards; }
@keyframes account-check-saved-flash {
  0%   { opacity: 0; transform: translateX(-4px); }
  15%  { opacity: 1; transform: translateX(0); }
  70%  { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(0); }
}

/* ─── Contact form compat (home/_contact_us_form partial) ──────────────────
   The shared contact partial uses legacy `form-control` / `btn` classes that
   are only styled by legacy.css. The redesigned /account chrome does not load
   legacy.css, so re-style those classes here, scoped to .account-panel only so
   nothing leaks to other pages that use the same partial (and still load
   legacy.css). */
.account-panel .form-control {
  width: 100%; padding: 6px 8px;
  border: 1px solid var(--border-subtle); border-radius: 5px;
  background: var(--bg-card); color: var(--fg-text); font-size: 0.88rem;
}
.account-panel textarea.form-control {
  font-family: inherit; min-height: 150px;
}
.account-panel #contact_us_form table { width: 100%; }
.account-panel #contact_us_form td:first-child {
  color: var(--fg-muted); font-size: 0.88rem; padding: 4px 12px 4px 0;
  white-space: nowrap; vertical-align: top;
}
.account-panel #contact_us_form td { padding: 4px 0; }
.account-panel .btn {
  display: inline-block; padding: 7px 16px; font-size: 0.88rem;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--brand-blue); color: #fff; cursor: pointer;
}
.account-panel .btn:hover { background: var(--brand-blue-hover); }

/* ─── Legacy credit-card form styles ───────────────────────────────────────
   Still used by account/subscribe.html.erb, account/update_cc.html.erb and
   account/_credit_card_form.html.erb (Pin Payments inline form). Not part of
   the tabbed /account redesign — do not remove. */
.cc-spinner {
  display:none;
}

#credit_card_name {
  width: 200px;
}
#credit_card_address1 {
  width:250px;
}
#credit_card_city, #credit_card_state {
  width:200px;
}
#credit_card_zip {
  width:150px;
}
#credit_card_verification_value {
  width:42px;
}
