:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --primary: #6558d3;
    --primary-dark: #4c41b6;
    --secondary: #edf0f7;
    --success: #15803d;
    --warning: #b45309;
    --danger: #b42318;
    --border: #e4e7ec;
    --shadow: 0 14px 40px rgba(31, 42, 68, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }

h1, h2, p { margin-top: 0; }

button, input, select, textarea { font: inherit; }

input, select, textarea {
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(101, 88, 211, 0.15);
    border-color: var(--primary);
}

label {
    display: block;
    font-weight: 700;
    color: #344054;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 17px;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: var(--text); }
.btn-large { min-height: 52px; padding: 14px 20px; }

.welcome-page, .auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(101,88,211,.20), transparent 34%),
        radial-gradient(circle at bottom right, rgba(43,181,169,.17), transparent 32%),
        var(--bg);
}

.welcome-card, .auth-card {
    width: min(100%, 520px);
    padding: 38px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.welcome-card { text-align: center; }

.brand-mark {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 22px;
    background: var(--primary);
    color: #fff;
    font-size: 25px;
    font-weight: 900;
}

.lead { color: var(--muted); font-size: 18px; line-height: 1.6; }

.welcome-actions {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--muted);
    font-weight: 700;
}

.stack { display: grid; gap: 18px; margin-top: 26px; }

.alert {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 700;
}
.alert-error { background: #fee4e2; color: var(--danger); }
.alert-success { background: #dcfae6; color: var(--success); }

.topbar {
    min-height: 70px;
    padding: 0 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar .brand {
    font-size: 21px;
    font-weight: 900;
    color: var(--primary);
}

.topbar nav { display: flex; gap: 20px; font-weight: 700; }

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0 70px;
}

.container.narrow { width: min(780px, calc(100% - 32px)); }

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 28px;
}

.page-heading p { color: var(--muted); }

.eyebrow {
    margin-bottom: 7px;
    color: var(--primary) !important;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    font-weight: 900;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card, .empty-card, .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card { padding: 22px; }

.avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #f0efff;
    font-size: 25px;
}

.progress-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    color: var(--muted);
}

.progress-row strong { color: var(--text); font-size: 23px; }

.progress-track {
    height: 9px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #eceef4;
}

.progress-fill { height: 100%; border-radius: inherit; background: var(--primary); }

.empty-card { padding: 30px; }

.panel { padding: 24px; }

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.panel-heading > span { color: var(--muted); }

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

table { width: 100%; border-collapse: collapse; }

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

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

td small { display: block; margin-top: 5px; color: var(--muted); }

.status {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-completed { background: #dcfae6; color: var(--success); }
.status-available { background: #e0e7ff; color: #3730a3; }
.status-upcoming { background: #fef0c7; color: var(--warning); }
.status-expired { background: #f2f4f7; color: #667085; }

.empty-row { padding: 32px; text-align: center; color: var(--muted); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width { grid-column: 1 / -1; }

.window-note {
    grid-column: 1 / -1;
    padding: 15px;
    border-radius: 12px;
    background: #f4f3ff;
    color: #42389d;
    line-height: 1.6;
}

.actions { display: flex; gap: 12px; }

/* Child portal */
.child-dashboard {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 214, 102, .25), transparent 28%),
        radial-gradient(circle at 90% 25%, rgba(101, 88, 211, .18), transparent 30%),
        #f8f7ff;
}

.child-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 28px max(24px, 6vw);
}

.child-topbar h1 { margin: 0; font-size: clamp(27px, 5vw, 43px); }

.child-container {
    width: min(980px, calc(100% - 28px));
    margin: 0 auto;
    padding-bottom: 70px;
}

.child-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.child-summary article {
    padding: 20px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.child-summary strong {
    display: block;
    font-size: clamp(23px, 4vw, 34px);
}

.child-summary span { color: var(--muted); font-weight: 700; }

.routine-list { display: grid; gap: 16px; }

.routine-card {
    display: grid;
    grid-template-columns: 105px 1fr 145px;
    align-items: center;
    gap: 20px;
    padding: 22px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.routine-available { border-color: #8175e8; }
.routine-completed { background: #f0fdf4; }
.routine-expired { opacity: .72; }

.routine-time {
    text-align: center;
    padding: 14px 8px;
    border-radius: 16px;
    background: #f4f3ff;
}

.routine-time span { display: block; font-size: 27px; font-weight: 900; }
.routine-time small { color: var(--primary); font-weight: 900; }

.routine-content h2 { margin-bottom: 8px; font-size: 23px; }
.routine-content p { margin-bottom: 12px; color: var(--muted); line-height: 1.5; }

.task-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.task-meta span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #f2f4f7;
    font-size: 12px;
    font-weight: 900;
}

.routine-action { text-align: center; }

.check-button {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
}

.check-button:disabled {
    cursor: not-allowed;
    background: #d0d5dd;
    color: #667085;
}

.countdown, .routine-action > small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.done-badge {
    padding: 15px 10px;
    border-radius: 16px;
    background: #dcfae6;
    color: var(--success);
    font-size: 17px;
    font-weight: 900;
}

.celebration {
    margin-bottom: 20px;
    padding: 18px;
    text-align: center;
    border-radius: 18px;
    background: #fff3c4;
    color: #7a2e0e;
    font-size: 18px;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.child-empty {
    padding: 50px 24px;
    text-align: center;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.big-emoji { font-size: 55px; }

@media (max-width: 760px) {
    .topbar, .page-heading, .panel-heading { align-items: flex-start; }
    .topbar { padding: 18px; }
    .topbar nav { gap: 11px; font-size: 14px; }
    .page-heading { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .full-width, .window-note { grid-column: auto; }
    .routine-card { grid-template-columns: 78px 1fr; }
    .routine-action { grid-column: 1 / -1; }
    .child-summary { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .welcome-card, .auth-card { padding: 26px 20px; }
    .child-topbar { padding: 22px 16px; }
    .routine-card { grid-template-columns: 1fr; text-align: center; }
    .routine-time { width: 120px; margin: 0 auto; }
    .task-meta { justify-content: center; }
    .routine-action { grid-column: auto; }
}


/* Phase 2 parent management */
.parent-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
}

.parent-nav a {
    position: relative;
    padding: 25px 2px;
}

.parent-nav a.active {
    color: var(--primary);
}

.parent-nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.mobile-menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.quick-action-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    min-height: 120px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(101, 88, 211, .45);
}

.quick-action-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 17px;
}

.quick-action-card small {
    color: var(--muted);
    line-height: 1.45;
}

.quick-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #f0efff;
    font-size: 24px;
}

.quick-arrow {
    color: var(--primary);
    font-size: 24px;
    font-weight: 900;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.overview-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.overview-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.overview-card strong {
    display: block;
    margin-top: 7px;
    font-size: 32px;
}

.card-title-row,
.heading-actions,
.row-actions,
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title-row {
    justify-content: space-between;
}

.heading-actions {
    justify-content: flex-end;
}

.card-footer-link {
    display: block;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.small-link,
.inline-link {
    color: var(--primary);
    font-weight: 800;
}

.inline-link {
    margin-left: 5px;
}

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

.child-admin-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.archived-card {
    opacity: .72;
}

.child-admin-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.large-avatar {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: #f0efff;
    font-size: 31px;
}

.muted-text {
    color: var(--muted);
}

.detail-list {
    margin: 20px 0;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

.support-note {
    padding: 14px;
    border-radius: 12px;
    background: #f8f7ff;
}

.support-note p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.card-actions {
    flex-wrap: wrap;
    margin-top: 20px;
}

.card-actions form,
.row-actions form {
    margin: 0;
}

.text-button {
    border: 0;
    padding: 8px 4px;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

.danger-text {
    color: var(--danger);
}

.filter-bar {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 22px;
}

.filter-button {
    min-height: 48px;
}

.row-actions {
    align-items: baseline;
}

@media (max-width: 900px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .filter-button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .mobile-menu-button {
        display: block;
    }

    .parent-nav {
        display: none !important;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0 !important;
        padding: 10px 18px 20px;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .parent-nav.open {
        display: flex !important;
    }

    .parent-nav a {
        padding: 13px 4px;
    }

    .parent-nav a.active::after {
        display: none;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .heading-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Phase 3 SaaS */
.admin-entry-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.superadmin-topbar .brand {
    color: #7c3aed;
}

.admin-auth-page {
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, .18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, .12), transparent 32%),
        var(--bg);
}

.admin-overview-grid {
    grid-template-columns: repeat(4, 1fr);
}

.admin-filter-bar {
    grid-template-columns: 2fr 1fr auto;
}

.split-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    gap: 10px;
    align-items: center;
    align-self: end;
    min-height: 48px;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

.smaller-stat {
    font-size: 22px !important;
}

.tenant-name {
    margin-top: -10px;
    font-size: 14px;
}

@media (max-width: 900px) {
    .admin-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .split-grid {
        grid-template-columns: 1fr;
    }

    .admin-filter-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .admin-overview-grid {
        grid-template-columns: 1fr;
    }
}


/* Phase 4 recurring schedules and remembered devices */
.weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.weekday-picker legend {
    padding: 0 8px;
    font-weight: 800;
    color: #344054;
}

.weekday-picker label {
    cursor: pointer;
}

.weekday-picker input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.weekday-picker span {
    display: inline-grid;
    place-items: center;
    min-width: 52px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.weekday-picker input:checked + span {
    border-color: var(--primary);
    background: #f0efff;
    color: var(--primary);
}

.schedule-preview {
    padding: 16px;
    border-radius: 14px;
    background: #f8f7ff;
    color: #42389d;
    line-height: 1.55;
    font-weight: 700;
}

.remembered-family-banner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin: 18px 0;
    padding: 15px;
    border: 1px solid #c7d7fe;
    border-radius: 14px;
    background: #eef4ff;
}

.remembered-family-banner strong,
.remembered-family-banner span {
    display: block;
}

.remembered-family-banner span {
    margin-top: 3px;
    color: var(--muted);
}

.remembered-family-banner a {
    color: var(--primary);
    font-weight: 800;
}

.remember-device-option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fafafa;
    cursor: pointer;
}

.remember-device-option input {
    width: auto;
    margin-top: 4px;
}

.remember-device-option strong,
.remember-device-option small {
    display: block;
}

.remember-device-option small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 500;
}

.mini-select {
    width: auto;
    min-width: 118px;
    margin: 0;
    padding: 7px 9px;
    font-size: 12px;
}


/* Extended child profiles */
.profile-form-container {
    width: min(1050px, calc(100% - 32px));
}

.profile-form {
    display: grid;
    gap: 20px;
}

.profile-section {
    padding: 26px;
}

.profile-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.profile-section-heading h2 {
    margin-bottom: 0;
}

.profile-avatar-preview {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #f0efff;
    font-size: 30px;
}

.field-help {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-weight: 600;
}

.privacy-note {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #fedf89;
    border-radius: 12px;
    background: #fffaeb;
    color: #7a2e0e;
    line-height: 1.5;
    font-size: 14px;
    font-weight: 650;
}

.profile-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-bottom: 50px;
}

.child-title-block {
    margin: 12px 0 4px;
}

.child-title-block h2 {
    margin-bottom: 4px;
}

.child-demographics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.child-demographics span {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
}

.profile-alert-note {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #fecdca;
    border-radius: 12px;
    background: #fef3f2;
    color: #912018;
}

.profile-alert-note p {
    margin: 6px 0 0;
    line-height: 1.5;
}

.detail-list dd small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-weight: 600;
}

@media (max-width: 760px) {
    .profile-section {
        padding: 20px;
    }

    .profile-section-heading {
        align-items: flex-start;
    }

    .profile-form-actions {
        flex-direction: column;
    }

    .profile-form-actions .btn {
        width: 100%;
    }
}
/* Illustrated RoutinaCare landing page */
.welcome-page-illustrated {
    position: relative;
    min-height: 100vh;
    display: block;
    overflow-x: hidden;
    padding: 0;
    background:
        linear-gradient(115deg, rgba(229,216,255,.30), rgba(255,250,239,.24) 48%, rgba(214,249,243,.28)),
        url("../images/routinacare-welcome-background.png") center center / cover no-repeat fixed;
}
.welcome-page-illustrated::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,.06), rgba(255,255,255,.20));
}
.welcome-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(46px, 8vh, 110px) 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.welcome-card-enhanced {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 36px 42px 30px;
    border: 1px solid rgba(255,255,255,.88);
    border-radius: 30px;
    background: rgba(255,255,255,.91);
    box-shadow: 0 28px 80px rgba(80,63,150,.15), 0 8px 30px rgba(31,42,68,.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.welcome-card-enhanced .brand-mark {
    width: 78px;
    height: 78px;
    margin-bottom: 20px;
    border-radius: 24px;
    background: linear-gradient(145deg, #735be7, #5746cc);
    box-shadow: 0 14px 28px rgba(101,88,211,.28);
}
.welcome-card-enhanced h1 {
    margin-bottom: 14px;
    font-size: clamp(34px, 5vw, 46px);
    letter-spacing: -.035em;
}
.welcome-card-enhanced .lead {
    max-width: 410px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.65;
}
.welcome-card-enhanced .welcome-actions { gap: 14px; margin-top: 27px; }
.welcome-button {
    width: 100%;
    min-height: 62px;
    position: relative;
    font-size: 18px;
    border-radius: 14px;
}
.welcome-button-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    font-size: 23px;
    line-height: 1;
}
.welcome-card-enhanced .btn-primary {
    background: linear-gradient(135deg, #7258e2, #6049d3);
    box-shadow: 0 10px 22px rgba(101,88,211,.22);
}
.welcome-card-enhanced .btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #654dd5, #523dbf);
}
.welcome-card-enhanced .btn-secondary {
    border: 1px solid #e4e5f1;
    background: rgba(243,244,252,.95);
}
.welcome-admin-divider {
    height: 1px;
    margin: 28px 0 18px;
    background: linear-gradient(90deg, transparent, rgba(102,112,133,.22), transparent);
}
.admin-entry-link-enhanced {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 0;
    color: #6248d5;
    font-size: 14px;
    font-weight: 900;
}
.welcome-benefits {
    width: min(960px, 100%);
    margin-top: auto;
    padding: 44px 0 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.welcome-benefits article {
    min-width: 0;
    padding: 0 26px;
    text-align: center;
    border-right: 1px solid rgba(102,112,133,.16);
}
.welcome-benefits article:last-child { border-right: 0; }
.benefit-icon {
    width: 49px;
    height: 49px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    font-size: 38px;
    line-height: 1;
}
.benefit-purple { color: #6650d7; }
.benefit-teal { color: #45a99f; }
.benefit-orange { color: #f59a23; }
.benefit-pink { color: #eb4e83; }
.welcome-benefits strong { display: block; margin-bottom: 7px; font-size: 16px; }
.welcome-benefits p { margin: 0; color: #667085; font-size: 14px; line-height: 1.55; }
.welcome-tagline {
    margin: 18px 0 12px;
    color: #6750d7;
    font-family: "Segoe Print", "Bradley Hand", cursive;
    font-size: clamp(25px, 3.5vw, 38px);
    font-weight: 700;
    text-align: center;
}
.welcome-footer { color: #8790aa; font-size: 13px; font-weight: 650; text-align: center; }
@media (max-width: 900px) {
    .welcome-page-illustrated { background-attachment: scroll; }
    .welcome-shell { padding-top: 44px; }
    .welcome-benefits { grid-template-columns: repeat(2, 1fr); gap: 24px 0; padding-top: 38px; }
    .welcome-benefits article:nth-child(2) { border-right: 0; }
}
@media (max-width: 600px) {
    .welcome-page-illustrated {
        background:
            linear-gradient(150deg, rgba(226,215,255,.84), rgba(255,251,242,.88) 52%, rgba(216,249,242,.86)),
            url("../images/routinacare-welcome-background.png") center top / auto 100% no-repeat;
    }
    .welcome-shell { width: min(100% - 22px, 520px); padding: 26px 0 22px; }
    .welcome-card-enhanced { padding: 28px 21px 24px; border-radius: 24px; }
    .welcome-card-enhanced .brand-mark { width: 66px; height: 66px; border-radius: 20px; }
    .welcome-button { min-height: 56px; font-size: 16px; }
    .welcome-benefits { grid-template-columns: 1fr 1fr; padding-top: 30px; }
    .welcome-benefits article { padding: 0 12px; border-right: 0; }
    .welcome-benefits p { display: none; }
    .benefit-icon { margin-bottom: 7px; }
    .welcome-tagline { margin-top: 22px; font-size: 25px; }
}