:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --ink: #0b1f3a;
  --ink-soft: #3a4a63;
  --muted: #6b7888;
  --line: #dfe4ec;
  --brand: #00a0df;          /* Schwab cyan */
  --brand-dark: #0077b5;
  --brand-navy: #003057;     /* Schwab navy */
  --accent: #00a0df;
  --up: #007a3d;
  --down: #c1272d;
  --warning-bg: #fff8e1;
  --warning-border: #e8c75a;
  --warning-ink: #5a4410;
  --shadow: 0 1px 3px rgba(11, 31, 58, 0.06);
  --shadow-md: 0 6px 20px rgba(11, 31, 58, 0.10);
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Charter", "Georgia", "Times New Roman", Times, serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea,
.topnav, .topnav a, .user-greeting, .account-type-tag,
.summary-label, .pill, .btn-primary, .btn-ghost,
.footer-links, .bottombar, .footer-note, .disclaimer,
.account-meta, .muted, .error, .migration-banner {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.screen { display: none; }
.screen.is-active { display: block; }
#login-screen.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 68px);
}

.login-body { background: var(--bg); }

.top-banner {
  background: var(--brand-navy);
  color: #fff;
  border-bottom: 3px solid var(--brand);
  padding: 12px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}
.top-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.top-banner-icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin-top: 1px;
}
.top-banner strong { font-weight: 700; }

/* ---------- Modal (Forgot password) ---------- */
.modal {
  border: 0;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(11, 31, 58, 0.25);
  max-width: 440px;
  width: calc(100% - 32px);
  color: var(--ink);
  background: var(--surface);
}
.modal::backdrop {
  background: rgba(11, 31, 58, 0.45);
}
.modal[open] {
  animation: modalIn 0.15s ease-out;
}
@keyframes modalIn {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-inner {
  position: relative;
  padding: 28px 28px 24px;
}
.modal-inner h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--ink);
}
.modal-inner .subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.modal-inner label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 4px 0 6px;
}
.modal-inner input[type="email"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcfe;
  margin-bottom: 16px;
}
.modal-inner input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 160, 223, 0.18);
  background: #fff;
}
.modal-inner .btn-primary { width: 100%; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}
.modal-close:hover { background: #f0f3f8; color: var(--ink); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  font-family: "Charter", "Georgia", serif;
  font-style: italic;
}
.brand-mark span { color: #fff; }
.brand-name {
  font-weight: 400;
  font-size: 22px;
  color: var(--brand-navy);
  letter-spacing: -0.3px;
  font-family: "Charter", "Georgia", serif;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}
.brand-stack { display: flex; flex-direction: column; }
.brand.small .brand-mark { width: 32px; height: 32px; font-size: 15px; }
.brand.small .brand-name { font-size: 18px; }
.brand.small .brand-sub { font-size: 9px; letter-spacing: 0.8px; }

/* ---------- Login ---------- */
#login-screen {
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 85, 139, 0.10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0, 168, 143, 0.10), transparent 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 12px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}

.login-card .brand { margin-bottom: 24px; }

.login-card h1 {
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}

.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14px;
}

form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 14px 0 6px;
}

form input[type="text"],
form input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcfe;
  transition: border-color 0.15s, box-shadow 0.15s;
}
form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 85, 139, 0.15);
  background: #fff;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 20px;
  font-size: 13px;
}
.checkbox {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 400; color: var(--ink-soft);
  margin: 0;
}
.link { font-size: 13px; }

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  border: 0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #8fb8d0; cursor: wait; }
.btn-primary.sm { width: auto; padding: 8px 14px; font-size: 14px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}
.btn-ghost:hover { background: #f0f3f8; color: var(--ink); }

.error {
  color: var(--down);
  font-size: 13px;
  margin: 12px 0 0;
  background: rgba(198, 40, 40, 0.06);
  border: 1px solid rgba(198, 40, 40, 0.18);
  padding: 8px 10px;
  border-radius: 6px;
}

.footer-note {
  text-align: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}
.lock { margin-right: 4px; }

/* ---------- Topbar ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.topnav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.topnav a {
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
.topnav a:hover { background: #f0f3f8; text-decoration: none; }
.topnav a.active { color: var(--brand-navy); background: rgba(0, 160, 223, 0.10); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 2px; }

.user-menu { display: flex; align-items: center; gap: 14px; }
.user-greeting { font-size: 14px; color: var(--ink-soft); }

/* ---------- Dashboard ---------- */
.dashboard { padding: 28px 24px 60px; }
.container { max-width: 1160px; margin: 0 auto; }

.page-head { margin-bottom: 20px; }
.page-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: -0.3px;
}
.muted { color: var(--muted); font-size: 13px; margin: 0; }

.summary-card {
  background: var(--brand-navy);
  color: #fff;
  padding: 28px 32px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  border-left: 4px solid var(--brand);
}
.summary-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: 0.85;
  margin-bottom: 8px;
}
.summary-value {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.8px;
}
.summary-meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.summary-meta .muted { color: rgba(255, 255, 255, 0.8); }
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
}
.pill.up { color: #b5f5d8; }
.pill.down { color: #ffb3b3; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; font-size: 18px; color: var(--ink); }
.section-actions { display: flex; gap: 8px; }

.account-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.account-item {
  border-bottom: 1px solid var(--line);
}
.account-item:last-child { border-bottom: 0; }

.account-header {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.15s;
}
.account-header:hover { background: #fafbfd; }
.account-header:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.account-chevron {
  display: inline-block;
  margin-left: 10px;
  color: var(--muted);
  transition: transform 0.2s;
  font-size: 14px;
}
.account-item.is-expanded .account-chevron { transform: rotate(180deg); }

.account-details {
  display: none;
  padding: 8px 22px 22px 76px;
  background: #fafbfd;
  border-top: 1px solid var(--line);
}
.account-item.is-expanded .account-details { display: block; }

.transfer-section { margin-top: 18px; }
.transfer-section:first-child { margin-top: 8px; }
.transfer-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.transfer-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 0;
}
.transfer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}
.transfer-row {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.transfer-row:last-child { border-bottom: 0; }
.transfer-row-main {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
}
.transfer-row.is-expandable .transfer-row-main {
  grid-template-columns: 1fr 1fr auto auto;
  cursor: pointer;
  transition: background 0.15s;
}
.transfer-row.is-expandable .transfer-row-main:hover { background: #fafbfd; }
.transfer-row.is-expandable .transfer-row-main:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.transfer-date { color: var(--ink); font-weight: 500; }
.transfer-to { color: var(--muted); font-size: 12px; }
.transfer-amount {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.transfer-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s;
}
.transfer-row.is-expanded .transfer-chevron { transform: rotate(180deg); }

.transfer-breakdown {
  display: none;
  padding: 10px 14px 14px;
  background: #fafbfd;
  border-top: 1px dashed var(--line);
}
.transfer-row.is-expanded .transfer-breakdown { display: block; }
.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-size: 13px;
}
.breakdown-label { color: var(--ink-soft); }
.breakdown-value {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .account-details { padding: 8px 16px 18px; }
  .transfer-row { grid-template-columns: 1fr auto; }
  .transfer-row .transfer-to { grid-column: 1 / -1; order: 3; margin-top: -4px; }
}

.account-left { display: flex; align-items: center; gap: 14px; }
.account-icon {
  width: 40px; height: 40px;
  border-radius: 2px;
  background: var(--brand-navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.account-info .account-type-row {
  margin-bottom: 6px;
}
.account-info .account-name-row,
.account-info .account-nickname-row,
.account-info .account-holder-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.account-info .account-name-row,
.account-info .account-holder-row { margin-bottom: 2px; }
.account-info .account-holder {
  color: var(--ink);
  font-weight: 500;
}
.account-info .account-field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.account-info .account-number {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.account-info .account-nickname {
  color: var(--ink);
  font-weight: 600;
}

.btn-tiny {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--brand-dark);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  cursor: pointer;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}
.btn-tiny:hover { background: rgba(0, 160, 223, 0.08); border-color: var(--brand); }
.btn-tiny:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.account-type-tag {
  background: #f0f3f8;
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-right { text-align: right; }
.account-balance {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.account-change {
  font-size: 12px;
  margin-top: 2px;
}
.account-change.up { color: var(--up); }
.account-change.down { color: var(--down); }

.disclaimer {
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 4px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.info-card p { margin: 0; }
.info-card a { font-weight: 600; }

.migration-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-left: 4px solid #d4a017;
  color: var(--warning-ink);
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.5;
}
.migration-banner .mb-icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  background: #d4a017;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.migration-banner .mb-title {
  font-weight: 600;
  margin-bottom: 2px;
  color: #4a3708;
}
.migration-banner a {
  color: var(--brand-dark);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.bottombar {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  font-size: 12px;
  color: var(--muted);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
  .dashboard { padding: 20px 16px 40px; }
  .summary-value { font-size: 32px; }
  .account-item { padding: 14px 16px; }
  .account-balance { font-size: 16px; }
  .user-greeting { display: none; }
}
