:root {
    --family-ink: #14231d;
    --family-paper: #f5f4ed;
    --family-white: #fffef8;
    --family-lime: #d8f65a;
    --family-green: #425a49;
    --family-muted: #68756b;
    --family-line: rgba(20, 35, 29, .16);
}

.family-portal-page {
    min-height: 100vh;
    background: var(--family-paper);
    color: var(--family-ink);
    font-family: "DM Sans", sans-serif;
}

.family-portal-page a { color: inherit; }
.family-portal-page a:focus-visible,
.family-portal-page button:focus-visible,
.family-portal-page input:focus-visible {
    outline: 3px solid #a1bc32;
    outline-offset: 3px;
}

.family-skip-link {
    position: fixed;
    z-index: 30;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    background: var(--family-lime);
    color: var(--family-ink);
    transform: translateY(-150%);
}
.family-skip-link:focus { transform: translateY(0); }

.family-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(20, 35, 29, .1);
    background: rgba(245, 244, 237, .94);
    backdrop-filter: blur(16px);
}
.family-header__inner {
    width: min(1280px, calc(100% - 48px));
    min-height: 76px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.family-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.family-brand__mark { width: 29px; height: 29px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-9deg); }
.family-brand__mark i { border: 2px solid var(--family-ink); border-radius: 4px 9px 4px 9px; }
.family-brand__mark i:nth-child(2), .family-brand__mark i:nth-child(3) { background: var(--family-lime); }
.family-brand strong, .family-brand small { display: block; font-family: Manrope, sans-serif; }
.family-brand strong { font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.family-brand small { margin-top: 2px; color: var(--family-muted); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.family-nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 30px); color: #425048; font-size: 12px; font-weight: 600; }
.family-nav a { text-decoration: none; }
.family-nav a:hover { color: var(--family-ink); }
.family-nav a span { color: #91a52d; }
.family-nav__email { color: var(--family-muted); font-size: 11px; }
.family-nav__button, .family-nav__login {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid var(--family-ink);
    background: transparent;
    color: var(--family-ink);
    font: 700 11px "DM Sans", sans-serif;
    cursor: pointer;
}
.family-nav__button:hover, .family-nav__login:hover { background: var(--family-ink); color: var(--family-white); }

.family-main { width: min(1160px, calc(100% - 48px)); min-height: calc(100vh - 145px); margin: auto; padding: 48px 0 70px; }
.family-footer { border-top: 1px solid var(--family-line); color: var(--family-muted); }
.family-footer > div { width: min(1280px, calc(100% - 48px)); min-height: 58px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.family-footer span:first-child { color: var(--family-green); }

/* Keep the existing dashboard views coherent while using the public palette. */
.family-portal-page .card { border: 1px solid var(--family-line) !important; border-radius: 4px !important; background: var(--family-white); box-shadow: 0 12px 32px rgba(20, 35, 29, .055) !important; }
.family-portal-page .text-primary-600, .family-portal-page .text-primary-light { color: var(--family-green) !important; }
.family-portal-page .bg-primary-50 { background: #e9efdc !important; }
.family-portal-page .text-primary-700 { color: #364d3d !important; }
.family-portal-page .bg-success-focus { background: #e4edcf !important; }
.family-portal-page .text-success-main { color: #3f5d39 !important; }
.family-portal-page .bg-warning-focus { background: #f5ebc9 !important; }
.family-portal-page .text-warning-main { color: #766322 !important; }
.family-portal-page .btn-primary { border-color: var(--family-ink); background: var(--family-ink); color: var(--family-white); }
.family-portal-page .btn-primary:hover { border-color: #2b4938; background: #2b4938; }
.family-portal-page .btn-outline-primary { border-color: var(--family-green); color: var(--family-green); }
.family-portal-page .btn-outline-primary:hover { border-color: var(--family-ink); background: var(--family-ink); color: var(--family-white); }
.family-portal-page .form-control:focus { border-color: #81974a; box-shadow: 0 0 0 .2rem rgba(216, 246, 90, .25); }

.family-access-shell { min-height: min(690px, calc(100vh - 220px)); display: grid; place-items: center; }
.family-access-card {
    width: min(930px, 100%);
    min-height: 490px;
    display: grid;
    grid-template-columns: .82fr 1fr;
    overflow: hidden;
    border: 1px solid rgba(20, 35, 29, .18);
    background: var(--family-white);
    box-shadow: 0 24px 70px rgba(20, 35, 29, .13);
    animation: family-card-rise .65s cubic-bezier(.2, .7, .25, 1) both;
}
.family-access-art {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 38px 35px;
    background: var(--family-ink);
    color: var(--family-white);
}
.family-access-art::before, .family-access-art::after { position: absolute; content: ""; pointer-events: none; }
.family-access-art::before { width: 360px; height: 360px; top: 18%; right: -37%; border: 1px solid rgba(216, 246, 90, .28); border-radius: 50%; box-shadow: 0 0 0 32px rgba(216, 246, 90, .035), 0 0 0 74px rgba(216, 246, 90, .025); }
.family-access-art::after { inset: 30% -18% 20% 18%; border: 1px solid rgba(245, 244, 237, .22); transform: rotate(-31deg); }
.family-access-art__kicker, .family-access-art__copy, .family-access-art__ball, .family-access-art__index { position: relative; z-index: 1; }
.family-access-art__kicker { color: #c4d0c7; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.family-access-art__copy { margin: auto 0; }
.family-access-art__copy h2 { max-width: 340px; margin: 0; color: var(--family-white); font: 800 clamp(30px, 4vw, 46px)/1.02 Manrope, sans-serif; letter-spacing: -.065em; }
.family-access-art__copy h2 em { color: var(--family-lime); font-style: normal; }
.family-access-art__copy p { max-width: 290px; margin: 19px 0 0; color: #bdc9c1; font-size: 12px; line-height: 1.75; }
.family-access-art__ball { position: absolute; right: 15%; bottom: 26%; width: 44px; aspect-ratio: 1; border-radius: 50%; background: var(--family-lime); box-shadow: 0 0 40px rgba(216, 246, 90, .2); }
.family-access-art__ball::after { position: absolute; inset: 5px 13px; border: 1px solid rgba(20, 35, 29, .32); border-radius: 50%; content: ""; transform: rotate(32deg); }
.family-access-art__index { color: #a6b2a9; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.family-access-content { align-self: center; padding: clamp(30px, 5vw, 62px); }
.family-access-content__eyebrow { margin-bottom: 12px; color: #6d8035; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.family-access-content h1 { margin: 0; color: var(--family-ink); font: 800 clamp(27px, 3.6vw, 38px)/1.08 Manrope, sans-serif; letter-spacing: -.06em; }
.family-access-content__intro { margin: 13px 0 28px; color: #68756b; font-size: 13px; line-height: 1.7; }
.family-access-form { display: grid; gap: 17px; }
.family-access-field label { display: block; margin-bottom: 7px; color: var(--family-ink); font-size: 11px; font-weight: 700; }
.family-access-field input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid rgba(20, 35, 29, .2); border-radius: 2px; background: #fff; color: var(--family-ink); font: 500 14px "DM Sans", sans-serif; }
.family-access-field input:focus { border-color: #83963c; outline: 0; box-shadow: 0 0 0 3px rgba(216, 246, 90, .3); }
.family-access-submit { min-height: 50px; margin-top: 3px; display: inline-flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 17px; border: 1px solid var(--family-ink); background: var(--family-ink); color: var(--family-white); font: 700 11px "DM Sans", sans-serif; cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.family-access-submit span { color: var(--family-lime); font-size: 17px; }
.family-access-submit:hover { transform: translateY(-2px); background: var(--family-lime); color: var(--family-ink); }
.family-access-submit:hover span { color: var(--family-ink); }
.family-access-content__note { margin: 18px 0 0; color: #748076; font-size: 10px; line-height: 1.6; }
.family-access-content__note a { color: #425a49; font-weight: 700; text-underline-offset: 3px; }
.family-access-error { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid #b5724c; background: #f5e9df; color: #653f2c; font-size: 12px; line-height: 1.55; }
.family-access-hint { margin: 12px 0 0; color: #6b776d; font-size: 10px; line-height: 1.6; }

@keyframes family-card-rise { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 700px) {
    .family-header__inner { width: min(100% - 30px, 1280px); min-height: 66px; }
    .family-nav { gap: 10px; font-size: 10px; }
    .family-nav > a:first-child { display: none; }
    .family-nav__email { display: none; }
    .family-nav__button, .family-nav__login { min-height: 35px; padding: 0 10px; font-size: 10px; }
    .family-main { width: min(100% - 30px, 1160px); padding: 25px 0 42px; }
    .family-footer > div { width: min(100% - 30px, 1280px); min-height: 52px; font-size: 8px; }
    .family-access-shell { min-height: auto; padding: 5px 0 20px; }
    .family-access-card { grid-template-columns: 1fr; min-height: 0; }
    .family-access-art { min-height: 205px; padding: 22px 23px; }
    .family-access-art::before { top: -40%; right: -16%; width: 290px; height: 290px; }
    .family-access-art::after { inset: 8% -13% -12% 35%; }
    .family-access-art__copy { margin: 26px 0 11px; }
    .family-access-art__copy h2 { max-width: 300px; font-size: 30px; }
    .family-access-art__copy p { max-width: 280px; margin-top: 8px; font-size: 11px; }
    .family-access-art__ball { right: 12%; bottom: 28%; width: 32px; }
    .family-access-art__index { font-size: 7px; }
    .family-access-content { padding: 27px 23px 30px; }
    .family-access-content__intro { margin-bottom: 21px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
