:root {
  --navy: #0f2a44;
  --gold: #c8a45c;
  --ink: #172033;
  --muted: #64748b;
  --line: #d9e1ea;
  --surface: #fff;
  --bg: #f6f8fb;
  --ok: #23714d;
  --bad: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--navy); }

.customer-flow-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.customer-site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.site-header-inner {
  align-items: center;
  display: flex;
  gap: 1.25rem;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0.85rem 1.25rem;
}

.site-brand {
  align-items: center;
  color: var(--navy);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  gap: 0.55rem;
  text-decoration: none;
}

.site-brand-mark {
  align-items: center;
  background: var(--navy);
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 1.75rem;
  justify-content: center;
  width: 1.75rem;
}

.site-nav {
  align-items: center;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.15rem;
  justify-content: center;
}

.site-nav a,
.site-account-link {
  border-radius: 6px;
  color: #4b5563;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  background: #f3f4f6;
  color: var(--navy);
}

.site-account-link {
  background: var(--navy);
  color: #fff;
  flex: 0 0 auto;
}

.site-account-link:hover { background: #1a3d61; }

.customer-flow-main {
  flex: 1;
  width: 100%;
}

.customer-site-footer {
  background: var(--navy);
  color: #cbd5e1;
  margin-top: 3rem;
}

.site-footer-inner {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  margin: 0 auto;
  max-width: 1200px;
  padding: 2.5rem 1.25rem;
}

.site-footer-inner strong { color: #fff; font-size: 1.05rem; }
.site-footer-inner p { margin: 0.55rem 0; }
.site-footer-inner a { color: #e2e8f0; text-decoration: none; }
.site-footer-inner a:hover { color: #fff; text-decoration: underline; }
.site-footer-inner nav { display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; align-content: start; }

.site-footer-copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #94a3b8;
  font-size: 0.82rem;
  margin: 0;
  padding: 1rem 1.25rem;
  text-align: center;
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem;
}

.portal-topbar,
.app-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.portal-brand,
.app-brand {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.portal-nav,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.portal-nav a,
.portal-link-button,
.tab-button,
.button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
}

.portal-nav a.active,
.tab-button.active,
.button.primary {
  background: var(--navy);
  color: #fff;
}

.button.secondary {
  background: #eef3f8;
}

.button.danger {
  color: var(--bad);
}

.hero,
.panel,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.hero {
  margin-bottom: 1rem;
}

h1, h2, h3 {
  color: var(--navy);
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  margin: 0 0 0.45rem;
}

h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
h3 { margin: 1rem 0 0.5rem; font-size: 1rem; }

.muted { color: var(--muted); }
.required-note { color: var(--muted); font-size: 0.9rem; margin: -0.2rem 0 0; }
.required-note span,
.field-required { color: var(--bad); font-weight: 800; }
.ok { color: var(--ok); font-weight: 700; }
.error { color: var(--bad); font-weight: 700; }
.empty { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.stack { display: grid; gap: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; }
.hidden { display: none !important; }

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 650;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 2.55rem;
  padding: 0.55rem 0.65rem;
  width: 100%;
}

textarea { min-height: 5rem; }

label.checkbox,
label.radio {
  align-items: start;
  display: flex;
  font-weight: 500;
  gap: 0.55rem;
}

label.checkbox input,
label.radio input {
  min-height: auto;
  width: auto;
  margin-top: 0.25rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.metric {
  color: var(--navy);
  font-size: 1.4rem;
  font-weight: 800;
}

.list {
  display: grid;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.table-wrap { overflow-x: auto; }

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.payment-element {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
}

.mandate-copy {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0.75rem 0 0;
}

@media (max-width: 720px) {
  .portal-topbar,
  .app-topbar {
    grid-template-columns: 1fr;
  }
  .tabs,
  .portal-nav {
    justify-content: flex-start;
  }
  .site-header-inner { align-items: flex-start; flex-wrap: wrap; }
  .site-nav { justify-content: flex-start; order: 3; width: 100%; }
  .site-account-link { margin-left: auto; }
  .site-footer-inner { grid-template-columns: 1fr; }
}
