:root {
  --account-bg: #07111f;
  --account-card: rgba(15, 23, 42, 0.84);
  --account-card-strong: rgba(15, 23, 42, 0.96);
  --account-line: rgba(148, 163, 184, 0.28);
  --account-text: #f8fafc;
  --account-muted: #b8c7dc;
  --account-accent: #38bdf8;
  --account-good: #22c55e;
  --account-warn: #f59e0b;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 28rem),
    var(--account-bg);
  color: var(--account-text);
}

.fieldbase-account-page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 44px;
}

.account-hero-card,
.account-section-card {
  border: 1px solid var(--account-line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.76));
  box-shadow: 0 24px 58px rgba(2, 6, 23, 0.34);
}

.account-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  padding: 28px;
  align-items: stretch;
}

.account-hero-copy h1,
.account-section-head h2 {
  margin: 6px 0 10px;
  letter-spacing: -0.03em;
}

.account-hero-copy h1 { font-size: clamp(2rem, 5vw, 4rem); }
.account-section-head h2 { font-size: clamp(1.35rem, 2.5vw, 2rem); }

.account-hero-copy p,
.account-section-head p,
.account-hero-status p,
.account-placeholder-grid span {
  color: var(--account-muted);
  line-height: 1.65;
}

.account-kicker {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(125, 211, 252, 0.28);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.account-hero-status {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(2, 6, 23, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.account-logo {
  width: 66px;
  height: 66px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 16px 32px rgba(2, 6, 23, 0.28);
}

.account-plan-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 12px;
  color: #052e16;
  background: linear-gradient(135deg, #86efac, #38bdf8);
  font-size: 0.82rem;
  font-weight: 950;
}

.account-section-card {
  margin-top: 20px;
  padding: 24px;
}

.account-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.account-data-grid article,
.account-placeholder-grid article {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  padding: 16px;
  background: rgba(2, 6, 23, 0.24);
  min-width: 0;
}

.account-data-grid span,
.account-placeholder-grid span {
  display: block;
  font-size: 0.8rem;
  color: var(--account-muted);
  margin-bottom: 7px;
}

.account-data-grid strong,
.account-placeholder-grid strong {
  display: block;
  font-size: 1rem;
  color: var(--account-text);
  overflow-wrap: anywhere;
}

.account-warning-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.82));
}

html.fb-light-preload body,
body.light-mode,
body.light-theme,
html.light body {
  --account-bg: #f4f7fb;
  --account-card: #ffffff;
  --account-card-strong: #ffffff;
  --account-line: rgba(15, 23, 42, 0.16);
  --account-text: #0f172a;
  --account-muted: #475569;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.12), transparent 28rem),
    var(--account-bg);
}

html.fb-light-preload .account-hero-card,
html.fb-light-preload .account-section-card,
body.light-mode .account-hero-card,
body.light-mode .account-section-card,
body.light-theme .account-hero-card,
body.light-theme .account-section-card,
html.light .account-hero-card,
html.light .account-section-card {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

html.fb-light-preload .account-data-grid article,
html.fb-light-preload .account-placeholder-grid article,
html.fb-light-preload .account-hero-status,
body.light-mode .account-data-grid article,
body.light-mode .account-placeholder-grid article,
body.light-mode .account-hero-status,
body.light-theme .account-data-grid article,
body.light-theme .account-placeholder-grid article,
body.light-theme .account-hero-status,
html.light .account-data-grid article,
html.light .account-placeholder-grid article,
html.light .account-hero-status {
  background: rgba(248, 250, 252, 0.88);
}

@media (max-width: 900px) {
  .account-hero-card { grid-template-columns: 1fr; padding: 20px; }
  .account-data-grid,
  .account-placeholder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .fieldbase-account-page { width: min(100% - 18px, 1180px); padding-top: 14px; }
  .account-hero-card,
  .account-section-card { border-radius: 20px; padding: 16px; }
  .account-actions { flex-direction: column; }
  .account-actions .primary-btn,
  .account-actions .outline-btn { width: 100%; justify-content: center; }
  .account-data-grid,
  .account-placeholder-grid { grid-template-columns: 1fr; }
}

/* Rev 1.6.8.3.62 - billing display upgrade */
.account-billing-grid article {
  border-color: rgba(56, 189, 248, 0.28);
}

.account-timeline {
  display: grid;
  gap: 12px;
}

.account-timeline article {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  padding: 14px 16px 14px 42px;
  background: rgba(2, 6, 23, 0.22);
}

.account-timeline article::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 19px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #38bdf8);
  box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.12);
}

.account-timeline strong {
  display: block;
  color: var(--account-text);
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.account-timeline span {
  display: block;
  color: var(--account-muted);
  line-height: 1.5;
}

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

.account-tool-actions button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

html.fb-light-preload .account-timeline article,
body.light-mode .account-timeline article,
body.light-theme .account-timeline article,
html.light .account-timeline article {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(15, 23, 42, 0.14);
}

@media (max-width: 620px) {
  .account-tool-actions { flex-direction: column; }
  .account-tool-actions .outline-btn { width: 100%; justify-content: center; }
}


/* Patch 1.6.8.3.67 account policy links */
.account-legal-card { border-color: rgba(96,165,250,.28); }
.account-legal-actions { justify-content: flex-start; flex-wrap: wrap; }
.account-legal-actions a { text-decoration: none; }


/* Patch 1.6.8.3.68 live billing portal and invoice access */
.primary-billing-btn {
  border-color: rgba(34, 197, 94, 0.42) !important;
  background: linear-gradient(135deg, rgba(34,197,94,.24), rgba(56,189,248,.22)) !important;
}
.account-invoice-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.account-invoice-list article,
.account-invoice-row {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(2, 6, 23, 0.18);
}
.account-invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.account-invoice-row strong { display: block; color: var(--account-text); }
.account-invoice-row span { display: block; color: var(--account-muted); margin-top: 4px; }
.account-invoice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-invoice-actions .outline-btn { padding: 8px 12px; text-decoration: none; }
html.fb-light-preload .account-invoice-list article,
body.light-mode .account-invoice-list article,
body.light-theme .account-invoice-list article,
html.light .account-invoice-list article { background: rgba(248, 250, 252, 0.92); border-color: rgba(15, 23, 42, 0.14); }
@media (max-width: 620px) {
  .account-invoice-row { align-items: stretch; flex-direction: column; }
  .account-invoice-actions .outline-btn { flex: 1; justify-content: center; }
}


/* Patch 1.6.8.3.102 account data controls entry */
.account-data-controls-card { border-color: rgba(248, 113, 113, 0.30); }
.account-data-controls-card .account-kicker { color: #fca5a5; }
.danger-account-link { border-color: rgba(248, 113, 113, 0.45) !important; color: #fecaca !important; }
html.fb-light-preload .danger-account-link, body.light .danger-account-link { color: #991b1b !important; }


/* 1.6.8.3.165 account email verification recovery */
.account-email-verification-card { border-color: rgba(59,130,246,.26); }
.account-inline-status { margin-top: 12px; border-radius: 16px; padding: 12px 14px; border: 1px solid rgba(148,163,184,.28); background: rgba(15,23,42,.62); font-weight: 800; }
.account-inline-status.success { border-color: rgba(34,197,94,.45); color:#bbf7d0; }
.account-inline-status.warn { border-color: rgba(245,158,11,.48); color:#fde68a; }
body.light .account-inline-status, html.fb-light-preload .account-inline-status { background:#fff; color:#0f172a; }
