/**
 * Patient portal launch: top bar, header button, homepage promo, footer legal.
 */

/* Top announcement bar — site-wide, replaces Elementor tagline strip (#2288C9) */
:root {
    --rf-patient-portal-top-bar-height: 52px;
    --rf-patient-portal-top-bar-bg: var(--color-primary, #2288c9);
    --rf-tagline-strip-height: 34px;
    --rf-riverside-header-height: 72px;
    --rf-header-cream: #f3f3ee;
}

/* Logged-in patients: pin Utah tagline strip (always visible, not dismissible) */
body.rf-patient-tagline-pinned .riverside_header .elementor-element-cac7bff,
body.rf-patient-tagline-pinned .riverside_header .elementor-element-cac7bff.elementor-hidden-mobile,
body.rf-patient-tagline-pinned .riverside_header .elementor-element-cac7bff.elementor-hidden-tablet {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    z-index: 1000002 !important;
    display: flex !important;
    visibility: visible !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

body.rf-patient-tagline-pinned .riverside_header {
    top: var(--rf-tagline-strip-height, 34px) !important;
    margin-top: 0 !important;
    background-color: var(--rf-header-cream) !important;
}

body.rf-patient-tagline-pinned .riverside_header .elementor-element-f4ec31a {
    border-bottom: none !important;
}

body.home.rf-patient-tagline-pinned .elementor-element-08f153a {
    padding-top: calc(var(--rf-tagline-strip-height, 34px) + var(--rf-riverside-header-height, 72px)) !important;
}

body.rf-patient-tagline-pinned .e-con.e-parent:first-of-type,
body.rf-patient-tagline-pinned .elementor-location-header + .elementor-location-single .e-con:first-child,
body.rf-patient-tagline-pinned #content > .e-con:first-child {
    scroll-margin-top: calc(var(--rf-tagline-strip-height, 34px) + var(--rf-riverside-header-height, 72px));
}

body.has-rf-patient-portal-top-bar {
    --rf-patient-portal-top-bar-height: 52px;
}

/* Hide Utah strip only while the patient portal promo bar is visible */
body.has-rf-patient-portal-top-bar:not(.rf-patient-portal-top-bar-hidden) .riverside_header .elementor-element-cac7bff,
body.has-rf-patient-portal-top-bar:not(.rf-patient-portal-top-bar-hidden) .riverside_header .hfe-site-tagline-wrapper {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

/* Match logo row cream so no white sliver shows under the header */
body.has-rf-patient-portal-top-bar .riverside_header {
    background-color: var(--rf-header-cream) !important;
}

body.has-rf-patient-portal-top-bar .riverside_header .elementor-element-f4ec31a {
    border-bottom: none !important;
}

.rf-patient-portal-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000001;
    margin: 0;
    box-sizing: border-box;
    background: var(--rf-patient-portal-top-bar-bg);
    color: var(--color-text-inverse, #fff);
    padding: 0.5rem var(--space-lg, 1.5rem);
    box-shadow: none;
}

.rf-patient-portal-top-bar__close {
    display: none;
}

/* Push fixed header below the announcement bar (height synced via JS) */
body.has-rf-patient-portal-top-bar:not(.rf-patient-portal-top-bar-hidden) .riverside_header {
    top: var(--rf-patient-portal-top-bar-height, 52px) !important;
    margin-top: 0 !important;
}

body.rf-patient-portal-top-bar-hidden .rf-patient-portal-top-bar {
    display: none !important;
}

body.rf-patient-portal-top-bar-hidden {
    --rf-patient-portal-top-bar-height: 0px;
}

/* Dismissed portal bar: Utah strip uses .rf-patient-tagline-pinned header offset */

/* Elementor pages: header is fixed/overlaid — do not add theme entry padding */
body.has-rf-patient-portal-top-bar.elementor-page .entry-content {
    padding-top: 0;
}

/* Homepage hero: align top padding with patient bar + logo row (prevents cream/white gap) */
body.home.has-rf-patient-portal-top-bar:not(.rf-patient-portal-top-bar-hidden) .elementor-element-08f153a {
    padding-top: calc(var(--rf-patient-portal-top-bar-height, 52px) + var(--rf-riverside-header-height, 72px)) !important;
}

body.has-rf-patient-portal-top-bar .e-con.e-parent:first-of-type,
body.has-rf-patient-portal-top-bar .elementor-location-header + .elementor-location-single .e-con:first-child,
body.has-rf-patient-portal-top-bar #content > .e-con:first-child {
    scroll-margin-top: calc(var(--rf-patient-portal-top-bar-height, 52px) + var(--rf-riverside-header-height, 72px));
}

.rf-patient-portal-top-bar__inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    max-width: var(--container-wide, 1400px);
    margin: 0 auto;
}

.rf-patient-portal-top-bar__copy {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
}

.rf-patient-portal-top-bar__badge {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: var(--fw-bold, 700);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.22);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
}

.rf-patient-portal-top-bar__text {
    flex: 0 1 auto;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
}

.rf-patient-portal-top-bar__text strong {
    font-weight: var(--fw-semibold, 600);
}

.rf-patient-portal-top-bar__actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm, 0.5rem);
}

.rf-patient-portal-top-bar__btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: var(--fw-semibold, 600);
    border-radius: 5px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.rf-patient-portal-top-bar__btn--primary {
    background: #fff;
    color: var(--color-primary-dark, #105a88);
}

.rf-patient-portal-top-bar__btn--primary:hover,
.rf-patient-portal-top-bar__btn--primary:focus {
    background: var(--color-bg-cream, #fdfcf9);
    color: var(--color-primary-dark, #105a88);
    text-decoration: none;
}

.rf-patient-portal-top-bar__btn--ghost {
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: #fff;
}

.rf-patient-portal-top-bar__btn--ghost:hover,
.rf-patient-portal-top-bar__btn--ghost:focus {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
}

.rf-patient-portal-top-bar__learn {
    font-size: 0.8125rem;
    font-weight: var(--fw-medium, 500);
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rf-patient-portal-top-bar__learn:hover,
.rf-patient-portal-top-bar__learn:focus {
    color: rgba(255, 255, 255, 0.9);
}

/* Footer legal bar */
.rf-footer-legal-bar {
    margin: 0;
    font-size: var(--fs-sm, 0.875rem);
    color: inherit;
    text-align: center;
}

.rf-footer-legal-bar__sep {
    margin: 0 0.35rem;
    opacity: 0.7;
}

.rf-legal-policies-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rf-legal-policies-link:hover,
.rf-legal-policies-link:focus {
    opacity: 0.85;
}

.elementor-widget-text-editor .rf-legal-policies-link,
.elementor-widget-heading .rf-legal-policies-link {
    color: inherit;
}

.rf-mobile-patient-login {
    font-weight: var(--fw-semibold, 600);
    color: var(--color-primary, #2288c9);
}

.rf-patient-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    color: var(--color-text-inverse);
    background: var(--color-primary);
    border-radius: var(--radius-md, 6px);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-fast), opacity var(--transition-fast);
}

.rf-patient-login-btn:hover,
.rf-patient-login-btn:focus {
    background: var(--color-primary-dark);
    color: var(--color-text-inverse);
    text-decoration: none;
    opacity: 0.95;
}

.rf-patient-portal-promo {
    background: linear-gradient(
        135deg,
        rgba(34, 136, 201, 0.08) 0%,
        var(--color-bg-cream) 50%,
        rgba(22, 103, 52, 0.06) 100%
    );
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: var(--space-3xl) var(--space-lg);
}

.rf-patient-portal-promo__inner {
    max-width: var(--container-max);
    margin: 0 auto;
}

.rf-patient-portal-promo__content {
    max-width: 40rem;
    margin: 0 auto;
    text-align: center;
}

.rf-patient-portal-promo__eyebrow {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin: 0 0 var(--space-md);
}

.rf-patient-portal-promo__title {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    color: var(--color-text-heading);
    margin: 0 0 var(--space-md);
    line-height: var(--lh-tight);
}

.rf-patient-portal-promo__text {
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    color: var(--color-text-body);
    margin: 0 0 var(--space-xl);
}

.rf-patient-portal-promo__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.rf-patient-portal-promo__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-md, 6px);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.rf-patient-portal-promo__btn--primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border: 2px solid var(--color-primary);
}

.rf-patient-portal-promo__btn--primary:hover,
.rf-patient-portal-promo__btn--primary:focus {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-text-inverse);
    text-decoration: none;
}

.rf-patient-portal-promo__btn--outline {
    background: transparent;
    color: var(--color-primary-dark);
    border: 2px solid var(--color-primary);
}

.rf-patient-portal-promo__btn--outline:hover,
.rf-patient-portal-promo__btn--outline:focus {
    background: rgba(34, 136, 201, 0.08);
    text-decoration: none;
}

.rf-patient-portal-promo__link {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-primary-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rf-patient-portal-promo__link:hover,
.rf-patient-portal-promo__link:focus {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .rf-patient-portal-top-bar {
        padding: 0.4rem 2.25rem 0.4rem 0.75rem;
    }

    .rf-patient-portal-top-bar__close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 0.35rem;
        right: 0.35rem;
        z-index: 2;
        width: 1.75rem;
        height: 1.75rem;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
        font-size: 1.25rem;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .rf-patient-portal-top-bar__close:hover,
    .rf-patient-portal-top-bar__close:focus {
        background: rgba(255, 255, 255, 0.32);
        color: #fff;
        outline: 2px solid rgba(255, 255, 255, 0.85);
        outline-offset: 1px;
    }

    .rf-patient-portal-top-bar__inner {
        flex-wrap: wrap;
        gap: 0.3rem 0.45rem;
        align-items: flex-start;
    }

    .rf-patient-portal-top-bar__copy {
        flex: 1 1 calc(100% - 2rem);
        max-width: calc(100% - 2rem);
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .rf-patient-portal-top-bar__copy::-webkit-scrollbar {
        display: none;
    }

    .rf-patient-portal-top-bar__text {
        font-size: 0.75rem;
        line-height: 1.25;
    }

    .rf-patient-portal-top-bar__actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .rf-patient-portal-top-bar__btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
    }

    .rf-patient-portal-top-bar__learn {
        margin-left: auto;
        font-size: 0.75rem;
    }

    body.home.has-rf-patient-portal-top-bar:not(.rf-patient-portal-top-bar-hidden) .elementor-element-08f153a {
        padding-top: calc(var(--rf-patient-portal-top-bar-height, 52px) + var(--rf-riverside-header-height, 72px)) !important;
    }

    body.rf-patient-portal-top-bar-hidden.home.has-rf-patient-portal-top-bar.rf-patient-tagline-pinned .elementor-element-08f153a {
        padding-top: calc(var(--rf-tagline-strip-height, 34px) + var(--rf-riverside-header-height, 72px)) !important;
    }
}
