/* =========================================================
   VisuoSight Step 5.1 — Visual Refinement
   Desktop + Mobile
   Loaded AFTER site.css so this file intentionally overrides it.
========================================================= */

:root {
    --v51-bg: #f3f7fc;
    --v51-card: #ffffff;
    --v51-text: #14233c;
    --v51-muted: #64748b;
    --v51-line: #dce6f2;
    --v51-blue: #3169e7;
    --v51-blue-dark: #143a78;
    --v51-teal: #10907c;
    --v51-shadow-sm: 0 12px 34px rgba(24, 49, 91, .06);
    --v51-shadow-md: 0 22px 58px rgba(24, 49, 91, .10);
    --v51-shadow-lg: 0 36px 86px rgba(16, 43, 84, .16);
}

/* ---------- Base polish ---------- */

html {
    scroll-padding-top: 90px;
}

body {
    background:
        linear-gradient(180deg, #f8fbff 0, #f3f7fc 36%, #eef4fb 100%);
    color: var(--v51-text);
}

::selection {
    background: rgba(49, 105, 231, .18);
}

.shell {
    width: min(1240px, calc(100% - 48px));
}

.eyebrow {
    font-size: 10px;
    letter-spacing: .16em;
}

.button {
    min-height: 46px;
    padding-inline: 18px;
    border-radius: 12px;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.button.primary:hover {
    box-shadow: 0 14px 30px rgba(53, 105, 223, .26);
}

.button:focus-visible,
.site-nav a:focus-visible,
.header-signin:focus-visible,
.mobile-menu-button:focus-visible,
.faq-list summary:focus-visible {
    outline: 3px solid rgba(49, 105, 231, .22);
    outline-offset: 3px;
}


/* ---------- Header ---------- */

.site-header {
    border-bottom-color: rgba(207, 220, 237, .78);
    background: rgba(248, 251, 255, .92);
}

.site-header.scrolled {
    box-shadow: 0 10px 30px rgba(18, 43, 80, .08);
}

.site-header-inner {
    min-height: 78px;
}

.brand-mark {
    width: 45px;
    height: 45px;
    border-radius: 14px;
}

.brand-copy strong {
    font-size: 16px;
}

.brand-copy small {
    font-size: 8px;
}

.site-nav {
    gap: 2px;
}

.site-nav a {
    position: relative;
    min-height: 42px;
    padding-inline: 12px;
    border-radius: 10px;
    font-size: 10px;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: var(--v51-blue);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .18s ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
    transform: scaleX(1);
}

.site-nav a.is-active {
    color: var(--v51-blue);
    background: #eef4ff;
}

.header-signin {
    min-height: 40px;
    padding-inline: 14px;
    border-color: #d3deec;
}

.header-actions .button.small {
    min-height: 40px;
    padding-inline: 15px;
}


/* ---------- Hero ---------- */

.hero {
    padding: 92px 0 86px;
    background:
        radial-gradient(circle at 85% 16%, rgba(65, 119, 236, .13), transparent 27%),
        radial-gradient(circle at 9% 86%, rgba(16, 144, 124, .08), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #eef4fb 100%);
}

.hero-grid {
    grid-template-columns: minmax(0, .92fr) minmax(540px, 1.08fr);
    gap: 66px;
}

.hero-copy h1 {
    margin-top: 18px;
    margin-bottom: 20px;
    font-size: clamp(46px, 5.2vw, 72px);
    line-height: .96;
    letter-spacing: -.058em;
}

.hero-lead {
    max-width: 620px;
    font-size: 16px;
    line-height: 1.75;
}

.hero-actions {
    margin-top: 30px;
}

.hero-proof {
    margin-top: 27px;
    gap: 14px 20px;
    font-size: 10px;
}

.hero-proof i {
    width: 20px;
    height: 20px;
}

.hero-window {
    border-radius: 27px;
    box-shadow: var(--v51-shadow-lg);
    transform: none;
    isolation: isolate;
}

.hero-window::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #173b77, #3975ec 60%, #15a093);
}

.window-topbar {
    min-height: 68px;
    padding: 14px 17px;
}

.window-brand strong {
    font-size: 11px;
}

.window-brand small {
    font-size: 7.5px;
}

.status-chip {
    padding: 6px 9px;
    font-size: 7.5px;
}

.window-body {
    grid-template-columns: 122px 1fr;
    min-height: 420px;
}

.preview-sidebar {
    padding: 18px 10px;
}

.preview-side-item {
    min-height: 39px;
    font-size: 7.5px;
}

.preview-main {
    padding: 15px;
}

.patient-strip {
    padding: 13px 14px;
    border-radius: 13px;
}

.patient-strip strong {
    font-size: 11px;
}

.patient-tabs span {
    min-height: 33px;
    padding-inline: 9px;
}

.metric-row {
    gap: 8px;
    margin-top: 10px;
}

.metric-card {
    min-height: 82px;
    padding: 11px;
}

.metric-card strong {
    font-size: 9.5px;
}

.preview-panels {
    gap: 9px;
    margin-top: 9px;
}

.preview-panel {
    min-height: 150px;
}


/* ---------- Trust strip ---------- */

.trust-strip {
    background: rgba(255,255,255,.92);
}

.trust-grid {
    min-height: 78px;
}

.trust-grid span {
    position: relative;
    color: #617189;
    font-size: 9.5px;
}

.trust-grid span:not(:first-child)::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 50%;
    width: 4px;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #bdc8d8;
}


/* ---------- Shared section rhythm ---------- */

.section {
    padding: 96px 0;
}

.section-heading.centered {
    margin-bottom: 40px;
}

.section-heading h2,
.section-copy h2 {
    margin-top: 11px;
    margin-bottom: 13px;
    font-size: clamp(34px, 3.6vw, 48px);
}

.section-heading p,
.section-copy > p {
    font-size: 14px;
    line-height: 1.75;
}


/* ---------- Workflow ---------- */

.workflow-grid {
    position: relative;
    gap: 16px;
}

.workflow-card {
    min-height: 240px;
    padding: 23px;
    border-radius: 19px;
    box-shadow: var(--v51-shadow-sm);
    transition:
        transform .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.workflow-card:hover {
    transform: translateY(-5px);
    border-color: #c5d6ef;
    box-shadow: var(--v51-shadow-md);
}

.workflow-card h3 {
    margin-top: 18px;
    font-size: 18px;
}

.workflow-card p {
    font-size: 11px;
    line-height: 1.68;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
}

.step-number {
    top: 18px;
    right: 19px;
}


/* ---------- Diagnostics ---------- */

.soft-section {
    background:
        radial-gradient(circle at 88% 18%, rgba(60, 118, 237, .05), transparent 30%),
        #f8fbff;
}

.two-column {
    grid-template-columns: minmax(0, .88fr) minmax(520px, 1.12fr);
    gap: 68px;
}

.check-grid {
    gap: 11px 16px;
    margin: 26px 0;
}

.check-grid span {
    font-size: 10.5px;
}

.check-grid span::before {
    width: 21px;
    height: 21px;
}

.diagnostic-visual,
.therapy-visual {
    border-radius: 24px;
    box-shadow: var(--v51-shadow-md);
}

.visual-topbar,
.therapy-header {
    min-height: 76px;
    padding: 16px 19px;
}

.visual-topbar strong,
.therapy-header strong {
    font-size: 13px;
}

.diagnostic-grid {
    gap: 10px;
    padding: 19px;
}

.diagnostic-card {
    min-height: 104px;
    padding: 16px;
    border-radius: 14px;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.diagnostic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(22, 49, 92, .07);
}

.diagnostic-dot {
    width: 11px;
    height: 11px;
}

.diagnostic-card strong {
    font-size: 10.5px;
}

.diagnostic-card small {
    margin-top: 4px;
    font-size: 7.5px;
}


/* ---------- Quick Office ---------- */

.therapy-visual {
    border-color: #17233a;
}

.therapy-stage {
    min-height: 330px;
    background:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
        radial-gradient(circle at center, rgba(57,94,161,.20), transparent 32%),
        #080f1c;
    background-size:
        24px 24px,
        24px 24px,
        auto,
        auto;
}

.therapy-target {
    width: 104px;
    height: 104px;
    border-width: 4px;
    font-size: 36px;
}

.therapy-controls span {
    min-height: 48px;
    font-size: 7.5px;
}

.feature-points {
    gap: 10px;
    margin-top: 27px;
}

.feature-points > div {
    padding: 13px 15px;
    border-left-width: 4px;
    border-radius: 0 11px 11px 0;
    background: #f7faff;
}

.feature-points strong {
    font-size: 11.5px;
}

.feature-points span {
    font-size: 9.5px;
}


/* ---------- Hardware ---------- */

.hardware-section {
    position: relative;
    overflow: hidden;
    padding: 100px 0;
    background:
        radial-gradient(circle at 92% 12%, rgba(26, 196, 190, .28), transparent 31%),
        radial-gradient(circle at 8% 100%, rgba(60, 113, 229, .20), transparent 28%),
        linear-gradient(130deg, #12376f, #2259aa 60%, #15838c);
}

.hardware-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(255,255,255,.025), transparent 38%);
}

.hardware-panel {
    position: relative;
    gap: 70px;
}

.hardware-copy p {
    font-size: 14px;
    line-height: 1.75;
}

.hardware-points {
    gap: 11px 20px;
    margin: 27px 0;
}

.hardware-points span {
    font-size: 9.5px;
}

.hardware-device {
    min-height: 450px;
}

.device-frame {
    width: min(455px, 92%);
}


/* ---------- Pricing ---------- */

.pricing-section {
    background:
        linear-gradient(180deg, #f8fbff, #f3f7fc);
}

.pricing-grid {
    gap: 18px;
}

.pricing-card {
    min-height: 470px;
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--v51-shadow-sm);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--v51-shadow-md);
}

.pricing-card.featured {
    transform: translateY(-7px);
    border-color: #8fb0f5;
    box-shadow: 0 24px 52px rgba(49,105,231,.14);
}

.pricing-card.featured:hover {
    transform: translateY(-10px);
}

.plan-badge {
    min-height: 27px;
    padding-inline: 9px;
}

.plan-code {
    margin-top: 15px;
}

.pricing-card h3 {
    margin-top: 6px;
    font-size: 21px;
}

.plan-desc {
    min-height: 54px;
    font-size: 10.5px;
}

.plan-price {
    margin: 22px 0 17px;
}

.plan-price-current {
    font-size: 30px;
}

.plan-features {
    gap: 9px;
    padding: 15px;
    border: 1px solid #e8eef6;
}

.plan-feature {
    font-size: 9.5px;
}

.plan-cta {
    min-height: 45px;
}


/* ---------- Access control ---------- */

.security-section {
    background: #fff;
}

.security-grid {
    gap: 56px;
}

.security-cards {
    gap: 12px;
}

.security-cards article {
    min-height: 190px;
    padding: 19px;
    border-radius: 16px;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.security-cards article:hover {
    transform: translateY(-3px);
    box-shadow: var(--v51-shadow-sm);
}

.security-cards strong {
    margin-top: 25px;
    font-size: 11.5px;
}

.security-cards p {
    font-size: 9.5px;
}


/* ---------- FAQ ---------- */

.faq-list {
    gap: 10px;
}

.faq-list details {
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(23, 48, 86, .025);
}

.faq-list summary {
    padding: 18px 48px 18px 19px;
    font-size: 11.5px;
}

.faq-list details > div {
    padding: 0 19px 18px;
    font-size: 10.5px;
}


/* ---------- Final CTA + footer ---------- */

.final-cta {
    padding: 64px 0;
}

.final-cta h2 {
    font-size: 37px;
}

.site-footer {
    padding-top: 54px;
}

.footer-brand p,
.footer-links a,
.footer-links button {
    font-size: 9.5px;
}


/* ---------- Demo modal ---------- */

.demo-modal {
    border-radius: 22px;
    box-shadow: 0 32px 90px rgba(4,16,36,.32);
}

.demo-modal h2 {
    font-size: 28px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    min-height: 44px;
    border-radius: 11px;
    font-size: 10.5px;
}


/* ---------- Reveal animation ---------- */

.v51-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity .55s ease,
        transform .55s cubic-bezier(.2,.8,.2,1);
}

.v51-reveal.v51-visible {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================================
   Tablet
========================================================= */

@media (max-width: 1080px) {

    .shell {
        width: min(100% - 36px, 1120px);
    }

    .site-header-inner {
        min-height: 72px;
    }

    .hero {
        padding-top: 72px;
    }

    .hero-grid {
        gap: 48px;
    }

    .hero-window {
        max-width: 820px;
    }

    .two-column {
        gap: 42px;
    }

    .section {
        padding: 82px 0;
    }

    .pricing-card.featured,
    .pricing-card.featured:hover {
        transform: none;
    }

    .mobile-menu-button {
        order: 2;
        margin-left: auto;
    }

    .header-actions {
        order: 3;
    }

    .site-nav.open {
        top: 72px;
        padding: 12px;
        border-radius: 15px;
        box-shadow: var(--v51-shadow-md);
    }

    .site-nav.open a {
        min-height: 44px;
        padding-inline: 12px;
    }

    .site-nav.open a::after {
        display: none;
    }

    .site-nav .v51-mobile-nav-action {
        display: none;
    }
}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 650px) {

    html {
        scroll-padding-top: 74px;
    }

    .shell {
        width: min(100% - 24px, 1180px);
    }

    .site-header-inner {
        min-height: 66px;
        gap: 9px;
    }

    .brand-mark {
        width: 39px;
        height: 39px;
        border-radius: 12px;
    }

    .brand-mark svg {
        width: 23px;
        height: 23px;
    }

    .brand-copy strong {
        font-size: 14px;
    }

    .mobile-menu-button {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }

    .site-nav.open {
        top: 66px;
        left: 12px;
        right: 12px;
        max-height: calc(100vh - 82px);
        overflow: auto;
    }

    .site-nav.open .v51-mobile-nav-action {
        display: flex;
        justify-content: center;
        margin-top: 4px;
        border-radius: 10px;
        text-align: center;
    }

    .site-nav.open .v51-mobile-nav-action.signin {
        border: 1px solid #d7e1ee;
        color: #22395f;
        background: #fff;
    }

    .site-nav.open .v51-mobile-nav-action.demo {
        color: #fff;
        background: linear-gradient(135deg, #3169e7, #467bec);
    }


    /* Hero mobile: stronger hierarchy, less dead space */

    .hero {
        padding: 46px 0 50px;
    }

    .hero-grid {
        gap: 34px;
    }

    .hero-copy {
        text-align: left;
    }

    .hero-copy h1 {
        margin-top: 13px;
        font-size: clamp(38px, 12vw, 48px);
        line-height: .98;
        letter-spacing: -.052em;
    }

    .hero-lead {
        font-size: 14px;
        line-height: 1.68;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 23px;
    }

    .hero-actions .button {
        width: 100%;
        min-height: 46px;
        padding-inline: 12px;
    }

    .hero-proof {
        width: 100% !important;
        display: grid;
        gap: 8px;
        margin: 20px 0 0 !important;
        font-size: 9.5px;
    }

    .hero-window {
        border-radius: 18px;
        box-shadow: 0 22px 52px rgba(16, 43, 84, .15);
    }

    .window-topbar {
        min-height: 58px;
        padding: 11px 12px;
    }

    .mini-logo {
        width: 30px;
        height: 30px;
    }

    .window-brand strong {
        font-size: 9.5px;
    }

    .status-chip {
        display: none;
    }

    .window-body {
        min-height: 0;
    }

    .preview-main {
        padding: 10px;
    }

    .patient-strip {
        padding: 11px;
    }

    .patient-tabs {
        gap: 4px;
        scrollbar-width: none;
    }

    .patient-tabs::-webkit-scrollbar {
        display: none;
    }

    .patient-tabs span {
        flex: 0 0 auto;
        min-height: 30px;
        padding-inline: 8px;
    }

    .metric-row {
        gap: 6px;
    }

    .metric-card {
        min-height: 74px;
        padding: 9px;
    }

    .preview-panels {
        gap: 6px;
    }

    .preview-panel {
        min-height: 118px;
    }


    /* Trust strip becomes horizontal scroll chips */

    .trust-grid {
        min-height: auto;
        display: flex;
        gap: 8px;
        padding: 13px 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .trust-grid::-webkit-scrollbar {
        display: none;
    }

    .trust-grid span {
        flex: 0 0 auto;
        padding: 7px 10px;
        border: 1px solid #e1e9f3;
        border-radius: 999px;
        background: #f9fbfe;
        font-size: 8.5px;
        white-space: nowrap;
    }

    .trust-grid span::before {
        display: none !important;
    }


    /* Sections */

    .section {
        padding: 62px 0;
    }

    .section-heading.centered {
        margin-bottom: 27px;
        text-align: left;
    }

    .section-heading h2,
    .section-copy h2 {
        font-size: 31px;
        line-height: 1.06;
    }

    .section-heading p,
    .section-copy > p {
        font-size: 13px;
        line-height: 1.68;
    }

    .workflow-grid {
        gap: 10px;
    }

    .workflow-card {
        min-height: auto;
        padding: 18px;
    }

    .workflow-card:hover,
    .diagnostic-card:hover,
    .security-cards article:hover,
    .pricing-card:hover {
        transform: none;
    }

    .feature-icon {
        width: 41px;
        height: 41px;
    }

    .two-column {
        gap: 30px;
    }

    .check-grid {
        gap: 8px;
    }

    .diagnostic-visual,
    .therapy-visual {
        border-radius: 18px;
    }

    .visual-topbar,
    .therapy-header {
        min-height: 64px;
        padding: 13px;
    }

    .diagnostic-grid {
        gap: 7px;
        padding: 11px;
    }

    .diagnostic-card {
        min-height: 84px;
        padding: 12px;
    }

    .therapy-stage {
        min-height: 240px;
        gap: 24px;
        background-size:
            20px 20px,
            20px 20px,
            auto,
            auto;
    }

    .therapy-target {
        width: 72px;
        height: 72px;
        border-width: 3px;
        font-size: 25px;
    }

    .feature-points {
        margin-top: 20px;
    }

    .hardware-section {
        padding: 68px 0;
    }

    .hardware-copy h2 {
        font-size: 33px;
    }

    .hardware-device {
        min-height: 290px;
    }

    .device-frame {
        width: min(360px, 96%);
    }

    .device-stand {
        height: 55px;
    }

    .device-base {
        width: 150px;
    }


    /* Pricing */

    .pricing-grid {
        gap: 12px;
    }

    .pricing-card {
        min-height: 0;
        padding: 19px;
        border-radius: 17px;
    }

    .pricing-card.featured {
        border-width: 2px;
    }

    .pricing-card h3 {
        font-size: 19px;
    }

    .plan-price-current {
        font-size: 28px;
    }

    .plan-features {
        padding: 13px;
    }


    /* Access control */

    .security-grid {
        gap: 28px;
    }

    .section-copy.compact h2 {
        font-size: 31px;
    }

    .security-cards {
        gap: 8px;
    }

    .security-cards article {
        min-height: auto;
        padding: 16px;
    }

    .security-cards strong {
        margin-top: 14px;
    }


    /* FAQ */

    .faq-list summary {
        padding: 16px 44px 16px 15px;
        font-size: 10.5px;
        line-height: 1.4;
    }

    .faq-list details > div {
        padding: 0 15px 16px;
        font-size: 10px;
    }


    /* Final CTA */

    .final-cta {
        padding: 50px 0;
    }

    .final-cta h2 {
        font-size: 31px;
    }

    .final-cta-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .final-cta-actions .button {
        width: 100%;
    }


    /* Footer */

    .site-footer {
        padding-top: 42px;
    }

    .footer-grid {
        gap: 32px;
    }

    .footer-links {
        width: 100%;
        justify-content: space-between;
        gap: 26px;
    }


    /* Demo modal becomes comfortable mobile sheet */

    .demo-modal-backdrop {
        place-items: end center;
        padding: 10px;
    }

    .demo-modal {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 21px 16px 16px;
        border-radius: 20px 20px 14px 14px;
    }

    .demo-modal h2 {
        padding-right: 36px;
        font-size: 24px;
    }

    .demo-close {
        top: 11px;
        right: 11px;
    }
}


/* ---------- Very small phones ---------- */

@media (max-width: 390px) {
    .hero-actions,
    .final-cta-actions {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        font-size: 36px;
    }

    .metric-row {
        grid-template-columns: 1fr;
    }

    .therapy-target {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }
}


/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .v51-reveal {
        opacity: 1;
        transform: none;
    }
}
