/* =========================================================
   Mobile & responsive — all public marketing pages
   Load last. Breakpoints: 991, 767, 575, 480
   IMPORTANT: Layout changes MUST stay inside @media queries.
   Desktop uses landing.min.css defaults — do not override globally.
   ========================================================= */

:root {
    --mobile-nav-offset: 70px;
}

/* ── Top promo bar (homepage) ───────────────────────────── */
@media (max-width: 767px) {
    /* Shimmer ::after animates to left:200% and causes horizontal scroll on mobile */
    html {
        overflow-x: hidden;
    }

    body.landing-page {
        overflow-x: hidden;
    }

    .landing-bg {
        overflow: hidden !important;
    }

    .top-gradient-bar {
        overflow: hidden !important;
        font-size: 0.78rem;
        line-height: 1.45;
        padding: 0.5rem 0.75rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        white-space: normal;
    }

    .top-gradient-bar::after {
        display: none !important;
    }

    .top-gradient-bar a {
        margin-left: 0 !important;
        font-size: 0.78rem;
    }

    .landing-page .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* ── Navbar ─────────────────────────────────────────────── */
@media (max-width: 991px) {
    .navbar .navbar-brand img {
        width: 100px !important;
        max-width: 100px;
        height: auto;
    }

    .navbar-collapse {
        top: var(--mobile-nav-offset, 70px) !important;
        min-height: calc(100vh - var(--mobile-nav-offset, 70px)) !important;
        padding-bottom: 2rem !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .navbar .d-flex.align-items-center.gap-3 {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }

    .navbar .d-flex.align-items-center.gap-3 .btn {
        width: 100%;
        max-width: none;
        justify-content: center;
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
        margin: 0 !important;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 575px) {
    .navbar .navbar-brand img {
        width: 90px !important;
        max-width: 90px;
    }

    .navbar-nav .nav-link {
        font-size: 1rem !important;
        padding: 0.65rem 0 !important;
    }
}

/* ── Homepage hero (mobile only) ────────────────────────── */
@media (max-width: 767px) {
    /* Fixed rotate slot — prevents layout shift on word change (mobile only) */
    .hero-rotate-wrap {
        display: block;
        height: 2.75rem;
        min-height: 2.75rem;
        max-height: 2.75rem;
        overflow: hidden;
        margin: 0.2em auto 0.35em;
        position: relative;
        text-align: center;
    }

    .hero-rotate-word {
        opacity: 1;
        transition: opacity 0.4s ease;
        display: block;
        white-space: nowrap;
        font-size: 1em !important;
        line-height: 1.2;
        font-weight: 800;
        will-change: auto;
        background: none !important;
        -webkit-background-clip: unset !important;
        background-clip: unset !important;
        -webkit-text-fill-color: #204B7B !important;
        color: #204B7B !important;
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        transform: translateY(-50%) !important;
        text-align: center;
        width: 100%;
    }

    .hero-rotate-word.is-exiting,
    .hero-rotate-word.is-entering {
        transform: translateY(-50%) !important;
    }
}

@media (max-width: 767px) {
    .hero-section {
        min-height: auto !important;
        padding: 1.75rem 0 2rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-badge {
        font-size: 0.72rem;
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(1.85rem, 8vw, 2.35rem) !important;
        line-height: 1.18;
        text-align: center;
        margin-bottom: 0.75rem;
    }

    .hero-title-line {
        font-size: 0.72em;
        font-weight: 700;
        color: #1A3C6B;
        margin-bottom: 0.2rem;
        letter-spacing: -0.01em;
    }

    /* Force stacked title lines on small screens */
    .hero-title > .hero-title-line,
    .hero-title > .hero-rotate-wrap {
        display: block !important;
        width: 100%;
    }

    .hero-title > .accent-line {
        display: block !important;
        width: 100%;
    }

    .hero-title .accent-line {
        display: block;
        font-size: 0.88em;
        margin-top: 0.1rem;
    }

    .hero-title .accent-line::after {
        display: none;
    }

    .hero-subtitle {
        font-size: 0.92rem;
        line-height: 1.55;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.25rem;
        padding: 0 0.25rem;
    }

    .hero-cta {
        display: flex !important;
        flex-direction: column;
        align-items: center !important;
        justify-content: center;
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .hero-cta .btn,
    .hero-cta .btn-lg {
        width: 100%;
        max-width: 300px;
        flex: 0 0 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
        justify-content: center;
        box-sizing: border-box;
    }

    .hero-pricing {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem 0.5rem;
        width: 100%;
        max-width: 320px;
        margin: 0.75rem auto 0;
        justify-items: center;
        text-align: center;
    }

    .hero-pricing-item {
        font-size: 0.78rem;
        color: var(--text-secondary, #64748b);
        width: 100%;
    }

    .hero-pricing-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .hero-visual-col {
        margin-top: 1.25rem;
        max-width: 100%;
        overflow: hidden;
    }

    .hero-visual-wrap {
        max-width: 100%;
        overflow: hidden;
    }

    .hero-3d-scene {
        transform: scale(0.94);
        transform-origin: top center;
        max-width: 100%;
    }

    .hero-orbit-chip--top,
    .hero-orbit-chip--side {
        display: none;
    }

    .hero-3d-card {
        min-height: auto !important;
    }

    .dashboard-chrome .chrome-url {
        font-size: 0.65rem;
    }

    .dashboard-chrome .chrome-badge {
        display: none;
    }

    /* Reduce background orb motion repaint on small screens */
    .landing-bg .bg-orb {
        animation: none !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.65rem, 7.5vw, 2rem) !important;
    }

    .hero-rotate-wrap {
        height: 2.75rem;
        min-height: 2.75rem;
        max-height: 2.75rem;
    }

    .dash-stats-row {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ── Public subpages (pricing, blog, tools, contact) ─── */
@media (max-width: 767px) {
    .public-page-hero {
        padding: 2rem 0 1.25rem;
    }

    .public-section {
        padding: 2rem 0;
    }

    .public-page-hero .lead,
    .seo-hero-desc {
        font-size: 0.95rem;
        padding: 0 0.25rem;
    }

    .section-eyebrow {
        font-size: 0.72rem;
    }

    .public-breadcrumb {
        padding: 0.75rem 0 0;
    }

    .public-breadcrumb .breadcrumb {
        font-size: 0.78rem !important;
        flex-wrap: wrap;
    }

    .public-breadcrumb .breadcrumb-item.active {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 575px) {
    .public-page-hero {
        padding: 1.5rem 0 1rem;
    }

    .public-section .section-title {
        font-size: 1.35rem;
    }
}

/* ── Pricing ────────────────────────────────────────────── */
@media (max-width: 767px) {
    .pricing-card {
        padding: 1.35rem 1.15rem;
    }

    .price-amount {
        font-size: 2.25rem !important;
    }

    .price-currency {
        font-size: 1.2rem !important;
    }

    .plan-name {
        font-size: 1.25rem;
    }

    .plan-features li {
        font-size: 0.88rem;
    }

    .pricing-toggle {
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem !important;
    }

    .pricing-toggle .toggle-label {
        font-size: 0.88rem;
    }

    .pricing-toggle .form-check-input {
        width: 2.5rem;
        height: 1.35rem;
    }

    .popular-badge {
        font-size: 0.72rem;
        padding: 3px 14px;
    }

    .pricing-compare-table {
        font-size: 0.82rem;
    }

    .pricing-compare-table td,
    .pricing-compare-table th {
        padding: 0.55rem 0.5rem !important;
        white-space: nowrap;
    }

    .pricing-compare-table td:first-child,
    .pricing-compare-table th:first-child {
        white-space: normal;
        min-width: 120px;
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 1;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
    }

    .pricing-compare-table thead th:first-child {
        background: rgba(32, 75, 123, 0.04);
    }
}

/* ── CTA bands ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .public-cta-band {
        padding: 2.25rem 0;
    }

    .public-cta-band p {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    .all-in-one-section .cta-section {
        padding: 2rem 1.25rem !important;
        margin-top: 2rem;
        border-radius: 1rem !important;
    }

    .all-in-one-section .cta-section p {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .all-in-one-section .cta-buttons .btn,
    .public-cta-actions .btn {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        justify-content: center;
    }

    .public-cta-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.65rem !important;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        justify-items: stretch;
    }
}

/* ── Contact ────────────────────────────────────────────── */
@media (max-width: 767px) {
    .contact-info-card,
    .contact-form-wrapper {
        padding: 1.25rem !important;
    }

    .contact-map-placeholder {
        height: 200px;
    }

    .contact-form .btn-primary {
        width: 100%;
    }
}

/* ── Blog ───────────────────────────────────────────────── */
@media (max-width: 767px) {
    .blog-card {
        padding: 1.15rem;
    }

    .blog-card-title {
        font-size: 1rem;
    }

    .blog-post-hero {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .blog-post-title {
        font-size: 1.35rem;
    }

    .blog-post-hero-text {
        font-size: 0.95rem;
    }

    .blog-post-body {
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
    }

    .blog-post-cta {
        padding: 1.25rem !important;
    }

    .blog-categories {
        gap: 0.4rem !important;
    }

    .blog-categories .badge {
        font-size: 0.75rem !important;
        padding: 5px 10px !important;
    }
}

/* Blog CMS content overflow */
.blog-content img,
.blog-content video,
.blog-content iframe {
    max-width: 100%;
    height: auto;
}

.blog-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.88rem;
}

.blog-content pre,
.blog-content code {
    max-width: 100%;
    overflow-x: auto;
    font-size: 0.85rem;
}

.blog-content h2 {
    font-size: 1.2rem;
}

/* ── Tools ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .tools-hub-page .tools-trust-row {
        gap: 0.45rem 0.65rem;
    }

    .tools-trust-pill {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }

    .tool-page-hero .seo-hero-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .tool-panel-header h2 {
        font-size: 1.15rem;
    }

    .inv-doc-table {
        font-size: 0.75rem;
    }
}

@media (max-width: 575px) {
    .tool-segment .btn {
        font-size: 0.82rem;
        padding: 0.5rem 0.65rem;
    }
}

/* ── Auth pages ─────────────────────────────────────────── */
@media (max-width: 767px) {
    .auth-main {
        padding: 1.25rem 0 2.5rem;
    }

    .auth-card {
        padding: 1.35rem 1.15rem;
    }

    .auth-card-header h1 {
        font-size: 1.3rem;
    }

    .auth-step {
        font-size: 0.65rem;
        padding: 0.35rem 0.15rem;
    }
}

/* ── Features (homepage) ────────────────────────────────── */
@media (max-width: 767px) {
    .feature-card .feature-keywords span {
        white-space: normal;
        text-align: center;
        font-size: 0.7rem;
    }

    .features-menu .menu-item {
        font-size: 0.88rem;
        padding: 0.65rem 0.85rem;
    }

    /* Trust strip — 2 per row */
    .trust-strip {
        padding: 0.85rem 0;
    }

    .trust-strip-inner {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem 0.75rem;
        justify-items: center;
        padding: 0 0.5rem;
    }

    .trust-item {
        font-size: 0.75rem;
        white-space: normal;
        text-align: center;
        justify-content: center;
        flex-direction: column;
        gap: 0.25rem;
    }

    .trust-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Growth & pricing stats — 2 per row */
    .growth-stats,
    .pricing-stats {
        padding: 1.25rem 0.75rem !important;
        margin: 1.5rem 0 !important;
    }

    .growth-stats .row > [class*="col-"],
    .pricing-stats .row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .growth-stats .row,
    .pricing-stats .row {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    .stat-card,
    .stat-item {
        padding: 0.85rem 0.5rem !important;
    }

    .stat-card .stat-icon,
    .stat-item .stat-icon {
        width: 2.25rem;
        height: 2.25rem;
        margin-bottom: 0.5rem;
    }

    .stat-card .stat-icon i,
    .stat-item .stat-icon i {
        font-size: 1rem;
    }

    .stat-number {
        font-size: 1.35rem !important;
    }

    .stat-label {
        font-size: 0.72rem !important;
        line-height: 1.3;
    }

    .stat-description {
        display: none;
    }

    /* All-in-one tabs — 2×2 equal grid */
    .allinone-tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 1fr;
        gap: 0.5rem !important;
        justify-content: stretch !important;
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .allinone-tab-btn {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0.65rem 0.4rem !important;
        font-size: 0.76rem !important;
        white-space: normal;
        line-height: 1.25;
        min-height: 48px;
        height: 100%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.3rem;
        box-sizing: border-box;
    }

    .allinone-tab-btn i {
        flex-shrink: 0;
    }

    /* CTA button pairs — equal width stack */
    .cta-buttons {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.65rem !important;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        justify-items: stretch;
    }

    .cta-buttons .btn {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        justify-content: center;
        box-sizing: border-box;
    }
}

/* ── SEO grids (industry pages etc.) ────────────────────── */
@media (max-width: 575px) {
    .seo-card {
        padding: 1.15rem;
    }

    .seo-prose {
        font-size: 0.95rem;
    }
}

/* ── Tables sitewide ────────────────────────────────────── */
@media (max-width: 767px) {
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0;
    }
}

/* ── Touch targets ──────────────────────────────────────── */
@media (max-width: 991px) {
    .navbar-toggler {
        padding: 0.4rem 0.55rem;
    }

    .navbar-collapse .d-flex.align-items-center.gap-3 {
        width: 100%;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(32, 75, 123, 0.08);
    }

    .hero-cta .btn,
    .cta-buttons .btn,
    .navbar-collapse .btn,
    .public-cta-actions .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
