:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #061b33;
    --navy: #193775;
    --navy-deep: #102754;
    --header-teal: #5aa6b8;
    --green: #167a74;
    --teal: #28a9a2;
    --aqua: #28c5bd;
    --action: #1279d3;
    --action-dark: #0d5fa8;
    --magenta: #d13cf2;
    --canvas: #f5f9fc;
    --surface: #fff;
    --surface-alt: #eef7f8;
    --border: #cfdde8;
    --muted: #5f6d7e;
    --red: #a52b24;
    --shadow: 0 24px 70px rgba(25, 55, 117, .14);
}

.merge-participant-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.merge-participant-tile { display: block; min-width: 0; }
.merge-participant-summary { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .8rem; margin: .55rem 0 0; }
.merge-participant-summary div { min-width: 0; }
.merge-participant-summary dt { color: var(--muted); font-size: .68rem; }
.merge-participant-summary dd { margin: .08rem 0 0; color: var(--navy-deep); font-size: .8rem; font-weight: 750; }
.merge-scope-list, .merge-blocker-list { display: grid; gap: .35rem; margin: .55rem 0 0; padding: 0; list-style: none; }
.merge-scope-list li { display: grid; padding: .45rem .5rem; border-radius: 8px; background: var(--surface-alt); }
.merge-scope-list span, .merge-scope-list small { color: var(--muted); font-size: .7rem; }
.merge-blocker-list li { padding: .4rem .5rem; border-radius: 8px; background: #fff2d7; color: #7b5413; font-size: .74rem; font-weight: 700; }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(40, 197, 189, .11), transparent 28rem),
        radial-gradient(circle at 88% 86%, rgba(209, 60, 242, .07), transparent 26rem),
        linear-gradient(145deg, #f8fbfd 0%, var(--canvas) 58%, #edf6f8 100%);
}

a { color: var(--action); text-underline-offset: .16em; }
button, input { font: inherit; }
button, .button { transition: background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
:focus-visible { outline: 3px solid rgba(40, 197, 189, .5); outline-offset: 2px; }

.skip-link {
    position: fixed;
    z-index: 100;
    top: .5rem;
    left: .5rem;
    padding: .65rem .9rem;
    border-radius: .5rem;
    background: #fff;
    color: var(--navy);
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .7rem max(1.25rem, calc((100vw - 1120px) / 2));
    background: linear-gradient(102deg, var(--navy-deep), var(--navy) 62%, #1b4b78);
    color: white;
    border-bottom: 4px solid var(--teal);
    box-shadow: 0 4px 18px rgba(6, 27, 51, .16);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; color: white; text-decoration: none; }
.brand-mark, .account-monogram {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--teal), var(--green));
    color: white;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: -.04em;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.22);
}
.brand-copy { display: flex; align-items: baseline; gap: .55rem; }
.brand-copy strong { font-size: .95rem; letter-spacing: -.015em; }
.brand-copy small { padding-left: .55rem; border-left: 1px solid rgba(255,255,255,.4); color: #bfe9e7; font-size: .78rem; font-weight: 750; }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: .82rem; }
.topbar form { margin: 0; }
.topbar .quiet { min-height: 34px; padding: .35rem .7rem; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; background: rgba(255,255,255,.06); color: white; }
.topbar .quiet:hover { background: rgba(255,255,255,.14); }

.account-shell { display: grid; place-items: center; min-height: calc(100vh - 72px); padding: clamp(1.5rem, 5vw, 4rem) 1rem; }
.account-card {
    width: min(100%, 470px);
    padding: clamp(1.45rem, 4vw, 2.25rem);
    border: 1px solid rgba(207, 221, 232, .95);
    border-top: 5px solid var(--teal);
    border-radius: 20px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow);
}
.wide-card { width: min(100%, 880px); }

.product-identity {
    position: relative;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -2.25rem -2.25rem 1.8rem;
    padding: 1rem 1.4rem;
    border-radius: 15px 15px 0 0;
    background: linear-gradient(118deg, var(--green), #176f75 48%, var(--navy));
    overflow: hidden;
}
.product-identity::after {
    content: "";
    position: absolute;
    width: 6rem;
    height: 6rem;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    transform: translate(12rem, -2.3rem);
}
.product-identity img { position: relative; z-index: 1; display: block; width: auto; max-width: 210px; height: auto; max-height: 48px; }
.product-identity-account { justify-content: flex-start; gap: .7rem; }
.product-identity-account > span:last-child { position: relative; z-index: 1; display: grid; color: white; }
.product-identity-account strong { font-size: 1rem; }
.product-identity-account small { color: #bfe9e7; font-size: .74rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }

.eyebrow { margin: 0 0 .4rem; color: var(--green); font-size: .72rem; font-weight: 850; letter-spacing: .105em; text-transform: uppercase; }
h1 { margin: 0; color: #071a32; font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin: 0; color: #102754; font-size: 1.12rem; letter-spacing: -.015em; }
.account-intro { margin: .75rem 0 1.5rem; color: var(--muted); line-height: 1.58; }

.account-form { display: grid; gap: .85rem; }
label span { display: block; margin-bottom: .42rem; color: #233d5d; font-size: .8rem; font-weight: 750; }
input { width: 100%; min-height: 44px; padding: .65rem .78rem; border: 1px solid #bfcfdd; border-radius: 9px; background: white; color: #061b33; }
input:hover { border-color: #94b2c8; }
input:focus { outline: 3px solid rgba(40, 169, 162, .2); border-color: var(--teal); }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: .62rem 1rem;
    border: 1px solid #b9cbd9;
    border-radius: 9px;
    background: white;
    color: #173452;
    font-weight: 780;
    text-decoration: none;
}
button:not(:disabled) { cursor: pointer; }
button:not(:disabled):hover, .button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(25,55,117,.11); }
.primary { border-color: var(--action); background: var(--action); color: white; }
.primary:hover { border-color: var(--action-dark); background: var(--action-dark); color: white; }
.check-field { display: flex; align-items: center; gap: .55rem; }
.check-field input { width: auto; min-height: 0; accent-color: var(--green); }
.check-field span { margin: 0; font-weight: 540; }
.forgot-link { justify-self: end; margin-top: -.45rem; font-size: .82rem; }
.validation { color: var(--red); font-size: .84rem; }
.validation:empty { display: none; }
.validation ul { margin: 0; padding-left: 1.25rem; }
.notice { padding: .78rem .9rem; border: 1px solid; border-radius: 9px; font-size: .87rem; line-height: 1.45; }
.notice.error { border-color: #e7aaa6; background: #fff3f2; color: #8d241d; }
.account-footer { margin: 1.5rem 0 0; color: var(--muted); text-align: center; }

.information-shell { align-items: start; }
.information-card section { margin-top: 1.5rem; padding-top: 1.35rem; border-top: 1px solid var(--border); }
.information-card section p, .verification-list { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.verification-list { display: grid; gap: .6rem; margin-bottom: 0; padding-left: 1.25rem; }
.information-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

.setup-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .25rem .7rem;
    margin-top: 1.35rem;
    padding: .9rem;
    border: 1px solid rgba(40,169,162,.38);
    border-radius: 12px;
    background: linear-gradient(135deg, #effbfa, #f7fcfc);
}
.setup-callout-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: white; font-size: .8rem; font-weight: 850; }
.setup-callout strong { display: block; color: #0d4b4c; font-size: .88rem; }
.setup-callout small { display: block; margin-top: .2rem; color: #4c6e70; line-height: 1.4; }
.setup-callout a { grid-column: 2; justify-self: start; margin-top: .35rem; font-size: .8rem; font-weight: 800; }

.provider-divider { display: flex; align-items: center; gap: .75rem; margin: 1.45rem 0 1rem; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; }
.provider-divider::before, .provider-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.provider-buttons { display: grid; gap: .75rem; }
.provider-form { margin: 0; }
.provider-form button { width: 100%; }
.provider-icon { display: grid; place-items: center; width: 24px; height: 24px; margin-right: .5rem; border-radius: 50%; background: var(--green); color: white; font-size: .62rem; font-weight: 900; }

.portal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.portal-heading .account-intro { margin-bottom: 0; }
.return-button { flex: 0 0 auto; border-color: rgba(22,122,116,.35); color: var(--green); }
.application-section, .account-details, .linked-providers { margin-top: 1.7rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 1rem; }
.section-heading > p { max-width: 22rem; margin: 0; color: var(--muted); font-size: .8rem; text-align: right; }
.section-heading.compact { margin-bottom: .8rem; }
.application-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.application-tile {
    display: grid;
    grid-template-columns: 86px 1fr auto;
    align-items: center;
    gap: .9rem;
    min-height: 96px;
    padding: .8rem;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.application-tile:hover { border-color: var(--teal); box-shadow: 0 10px 24px rgba(25,55,117,.1); transform: translateY(-1px); }
.application-logo { height: 64px; display: grid; place-items: center; padding: .55rem; border-radius: 9px; background: linear-gradient(135deg, var(--green), var(--navy)); }
.application-logo img { display: block; max-width: 100%; max-height: 40px; }
.application-copy { display: grid; gap: .28rem; }
.application-copy strong { color: var(--navy); }
.application-copy small { color: var(--muted); line-height: 1.35; }
.application-arrow { color: var(--teal); font-size: 1.35rem; }
.empty-state { margin: 0; padding: 1rem; border: 1px dashed #b9cbd9; border-radius: 10px; background: var(--canvas); color: var(--muted); font-size: .86rem; }

.account-facts { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.account-facts div { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; padding: .82rem 1rem; border-top: 1px solid var(--border); }
.account-facts div:first-child { border-top: 0; }
.account-facts dt { color: var(--muted); font-size: .8rem; }
.account-facts dd { margin: 0; font-weight: 680; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: .15rem .52rem; border-radius: 999px; font-size: .72rem; }
.status-pill.success { background: #e5f6f1; color: #126155; }
.status-pill.warning { background: #fff2d7; color: #7b5413; }
.account-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.linked-providers h2 { font-size: 1rem; }
.linked-providers > p { color: var(--muted); font-size: .84rem; }
.provider-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1rem; padding: .7rem 0; border-top: 1px solid #eaf0f4; }
.provider-row > span:first-child { flex: 1; }
.provider-row form { margin: 0; }
.provider-row .quiet { min-height: 36px; padding: .4rem .75rem; border: 1px solid #b8c8d5; border-radius: 8px; background: white; color: #193775; font-weight: 700; cursor: pointer; }
.provider-row .quiet:hover { background: #f2f6f9; }
.account-help { margin: .25rem 0 0; color: #5d6c78; font-size: .84rem; }
.status { color: var(--muted); font-size: .76rem; font-weight: 780; }

@media (max-width: 720px) {
    .account-card { padding: 1.35rem; }
    .product-identity { margin: -1.35rem -1.35rem 1.4rem; border-radius: 15px 15px 0 0; }
    .portal-heading, .section-heading { display: grid; align-items: start; gap: .8rem; }
    .section-heading > p { text-align: left; }
    .return-button { width: 100%; }
    .application-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .account-shell { place-items: start center; padding: 1rem .75rem 2rem; }
    .account-card { border-radius: 15px; }
    .topbar { min-height: 62px; padding-inline: .9rem; }
    .topbar nav > span { display: none; }
    .brand-copy { display: grid; gap: 0; }
    .brand-copy small { padding: 0; border: 0; }
    .application-tile { grid-template-columns: 74px 1fr auto; }
    .account-facts div { grid-template-columns: 1fr; gap: .25rem; }
    .account-actions .button { width: 100%; }
    .information-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
