:root {
  color-scheme: light;
  --ink: #151918;
  --muted: #68747b;
  --brand: #062b3d;
  --footer: #f5f9fc;
  --border: #e8ecef;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #e5e7e9;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #388ddd; outline-offset: 4px; }
[hidden] { display: none !important; }

.connection-panel {
  position: relative;
  width: min(540px, 100%);
  min-height: min(760px, calc(100dvh - 64px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px #00000012;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.back-button { position: absolute; top: 14px; left: 18px; width: 32px; height: 32px; padding: 5px; border: 0; border-radius: 5px; background: transparent; }
.back-button svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.back-button:hover { background: #f1f5f7; }
.connection-panel.provider-mode { height: min(760px, calc(100dvh - 64px)); min-height: 0; }
.provider-mode .progress-track span { width: 33%; }
.provider-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.provider-heading { padding: 30px 32px 20px; }
.provider-heading h1 { text-align: left; font-size: 30px; letter-spacing: -.5px; margin: 0 0 20px; }
.provider-heading h1:focus { outline: none; }
.bank-search { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 0 20px; border: 1px solid #e5e7e9; border-radius: 17px; }
.bank-search:focus-within { border-color: #388ddd; box-shadow: 0 0 0 2px #388ddd22; }
.bank-search svg { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: #242b2e; stroke-width: 1.8; stroke-linecap: round; }
.bank-search input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 20px; padding: 20px 0; }
.bank-search input::placeholder { color: #737b80; opacity: 1; }
.bank-results { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 32px 32px; scrollbar-width: thin; scrollbar-color: #dce2e6 transparent; }
.bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 1px 0 4px; }
.bank-card { min-width: 0; height: 92px; display: grid; place-items: center; padding: 16px; background: #fff; border: 1px solid #e5e7e9; border-radius: 20px; box-shadow: 0 3px 6px #102b4210; transition: border-color .15s, background .15s; }
.bank-card:hover { border-color: #8ba6b3; background: #f8fbfd; }
.bank-card:focus-visible { outline-offset: -4px; }
.bank-card img { display: block; max-width: 100%; width: 140px; height: 60px; object-fit: contain; }
.bank-wells-fargo img, .bank-td-bank img { width: 56px; height: 56px; }
.bank-usaa img { width: 65px; }
.bank-selection-footer { flex-shrink: 0; padding: 20px 32px 28px; background: var(--footer); border-top: 1px solid #edf0f3; }
.custom-bank-summary { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.custom-bank-name { color: var(--brand); font-weight: 600; }
.bank-selection-footer .continue-button { margin-top: 12px; }
.custom-bank-card { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 92px; padding: 18px; background: #fff; color: var(--brand); border: 1px solid #e5e7e9; border-radius: 20px; box-shadow: 0 3px 6px #102b4210; text-align: left; }
.custom-bank-card:hover { border-color: #8ba6b3; background: #f8fbfd; }
.custom-bank-icon { display: grid; place-items: center; flex: 0 0 52px; height: 52px; border-radius: 14px; background: var(--footer); }
.custom-bank-icon svg { width: 32px; height: 32px; }
.custom-bank-card svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.custom-bank-card-name { flex: 1; min-width: 0; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.custom-bank-chevron { flex: 0 0 20px; height: 20px; }
.panel-header { height: 58px; flex: 0 0 58px; display: flex; align-items: center; justify-content: center; position: relative; }
.company-logo { object-fit: contain; }
.close-button { position: absolute; right: 18px; top: 14px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; padding: 5px; border-radius: 5px; }
.close-button svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
.close-button:hover { background: #f1f5f7; }
.progress-track { height: 1px; background: #f0f1f2; }
.progress-track span { display: block; width: 50%; height: 100%; background: linear-gradient(90deg, #59a0a5 0%, #78a3ad 55%, #a49abb 100%); }
.welcome-content { padding: 44px 48px 40px; flex: 1; }
.connection-icons { display: flex; align-items: center; margin-bottom: 18px; }
.icon-tile { width: 60px; height: 60px; border-radius: 15px; display: grid; place-items: center; }
.icon-tile svg { width: 32px; height: 32px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bank-tile { position: relative; z-index: 1; background: #f6f4ff; border: 1px solid #e2e0e9; }
.bank-tile svg { stroke: #4e99c1; }
.company-tile { background: var(--brand); border: 1px solid #dae3e9; margin-left: -7px; }
.company-tile svg { stroke: #fff; }
h1 { font-size: 32px; line-height: 1.22; font-weight: 500; letter-spacing: -.6px; text-align: center; margin: 0; }
.connection-note { display: flex; align-items: flex-start; gap: 12px; margin: 34px 18px 0; }
.connection-note p, .legal-copy { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.bolt-icon { flex: 0 0 27px; width: 27px; height: 27px; margin-top: 4px; border-radius: 9px; display: grid; place-items: center; background: #f7f7fc; box-shadow: 0 1px 3px #122b4410; }
.bolt-icon svg { width: 20px; height: 20px; fill: #528bdd; }
.text-link { display: inline; border: 0; padding: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.text-link:hover { color: var(--brand); }
.panel-footer { padding: 26px 48px 36px; background: var(--footer); border-top: 1px solid #edf0f3; }
.continue-button { width: 100%; min-height: 70px; margin-top: 18px; border: 0; border-radius: 20px; background: var(--brand); color: #fff; font-size: 24px; font-weight: 600; transition: background .15s, transform .15s; }
.continue-button:hover { background: #104358; }
.continue-button:active { transform: translateY(1px); }
.next-step-status { margin: 28px 18px 0; font-size: 16px; line-height: 1.5; text-align: center; color: var(--brand); }
.closed-state { text-align: center; padding: 30px; border-radius: 10px; background: #fff; }
.reopen-button, .dialog-done { border: 0; background: var(--brand); color: #fff; border-radius: 10px; padding: 13px 20px; }
.information-dialog { width: min(390px, calc(100% - 40px)); padding: 28px; border: 1px solid var(--border); border-radius: 16px; color: var(--ink); }
.information-dialog::backdrop { background: #17232c66; }
.information-dialog h2 { margin: 0 0 14px; font-size: 22px; }
.information-dialog p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.information-dialog form { margin-top: 22px; text-align: right; }

.login-mode .progress-track span { width: 50%; }
.verification-mode .progress-track span { width: 66%; }
.completion-mode .progress-track span { width: 100%; }
.completion-screen { display: flex; flex-direction: column; flex: 1; }
.login-icon.completion-icon { background: #edf8f3; }
.completion-icon svg { stroke: #2a815e; stroke-width: 2.5; }
.completion-description { overflow-wrap: anywhere; }
.completion-done { margin-top: 0; }
.login-form { display: flex; flex: 1; flex-direction: column; margin: 0; }
.login-content { flex: 1; padding: 32px 48px 42px; }
.login-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #f8f8fc; margin-bottom: 24px; }
.login-icon .bank-tile { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 4px 12px #24315114; }
.login-icon svg { width: 30px; height: 30px; }
.login-content h1 { text-align: left; font-size: 30px; line-height: 1.15; letter-spacing: -.5px; margin: 0 0 12px; overflow-wrap: anywhere; }
.login-content h1:focus { outline: none; }
.login-description { margin: 0 0 20px; color: #737b80; font-size: 20px; line-height: 1.5; }
.login-fields { display: grid; gap: 20px; }
.login-field { display: flex; align-items: center; min-height: 70px; border: 1px solid #e5e7e9; border-radius: 16px; background: #fff; }
.login-field:focus-within { border-color: #388ddd; box-shadow: 0 0 0 2px #388ddd22; }
.login-field input { width: 100%; min-width: 0; padding: 22px 20px; border: 0; outline: none; border-radius: inherit; background: transparent; color: var(--ink); font: inherit; font-size: 20px; }
.login-field input::placeholder { color: #737b80; opacity: 1; }
.password-field input { padding-right: 8px; }
.password-toggle { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; margin-right: 18px; padding: 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); }
.password-toggle:hover { background: #f1f5f7; }
.password-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-footer { padding-top: 20px; padding-bottom: 14px; }
.submit-button { margin-top: 16px; }
.submit-button:disabled { background: #eaf0f4; color: #fff; cursor: default; transform: none; }
.login-status { margin: 22px 0 0; font-size: 16px; line-height: 1.5; text-align: center; color: var(--brand); }
.verification-description { margin-bottom: 24px; overflow-wrap: anywhere; }
.verification-footer .legal-copy { text-align: center; }
.verification-code-field input { font-size: 24px; letter-spacing: 4px; text-align: center; }
.verification-code-field input::placeholder { font-size: 20px; letter-spacing: 0; }
.verification-code-hint { font-size: 14px; font-weight: 600; color: var(--muted); margin: 10px 0 24px; text-align: center; }
.resend-code { color: var(--brand); font-size: 14px; font-weight: 600; display: block; margin: 0 auto; }
.verification-footer .legal-copy { font-weight: 500; }

@media (max-width: 600px) {
  :root { background: #fff; }
  body { padding: 0; }
  .connection-panel { width: 100%; min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .welcome-content { padding: 40px 30px 36px; }
  h1 { font-size: 30px; margin: 0 -20px; }
  .panel-footer { padding: 22px 30px max(32px, env(safe-area-inset-bottom)); }
  .connection-panel.provider-mode { height: 100dvh; }
  .bank-results { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .bank-selection-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .login-content { padding: 30px 22px 42px; }
  .login-footer { padding: 20px 22px max(14px, env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .welcome-content { padding-left: 24px; padding-right: 24px; }
  h1 { font-size: 27px; margin-left: -15px; margin-right: -15px; }
  .connection-note { margin-left: 0; margin-right: 0; }
  .panel-footer { padding-left: 24px; padding-right: 24px; }
  .provider-heading { padding-left: 24px; padding-right: 24px; }
  .provider-heading h1 { font-size: 27px; }
  .bank-results, .bank-selection-footer { padding-left: 24px; padding-right: 24px; }
  .bank-grid { gap: 16px; }
  .bank-card { padding: 12px; }
  .login-content h1 { font-size: 27px; }
}

.loading-mode .progress-track span { width: 50%; }
.loading-screen { display: flex; flex: 1; flex-direction: column; }
.loading-content { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: center; padding-top: 60px; padding-bottom: 60px; }
.loading-content h1, .loading-content .login-description { text-align: center; }
.loading-content .login-description { max-width: 330px; margin: 8px 0 0; }
.loading-icon { background: var(--footer); display: flex; align-items: center; justify-content: center; }
.loading-spinner {
  display: block;
  width: 50px;
  height: 50px;
  border: 5px solid #e8ecef;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: loading-spin 0.6s linear infinite;
  -webkit-animation: loading-spin 0.6s linear infinite;
}
.loading-note { text-align: center; }
@keyframes loading-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@-webkit-keyframes loading-spin {
  0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation-duration: 2.4s; -webkit-animation-duration: 2.4s; } }

.partner-company {
  min-width: 1ch;
}
