/* ==========================================================
   Public design system + homepage redesign
   Scope: body.home-route only. Backend contracts, routes and JS hooks stay intact.
   ========================================================== */

:root {
    --pp-ink: #111827;
    --pp-ink-soft: #344054;
    --pp-muted: #667085;
    --pp-subtle: #98a2b3;
    --pp-surface: #ffffff;
    --pp-surface-warm: #fbfcf8;
    --pp-paper: #f4f7fb;
    --pp-line: #dfe7f0;
    --pp-blue: #132e75;
    --pp-blue-2: #1f5fa8;
    --pp-green: #38bb5b;
    --pp-teal: #0f9f8f;
    --pp-coral: #e86f51;
    --pp-gold: #e6a629;
    --pp-lilac: #7857d5;
    --pp-radius-xs: 10px;
    --pp-radius-sm: 14px;
    --pp-radius-md: 20px;
    --pp-radius-lg: 28px;
    --pp-space-1: 4px;
    --pp-space-2: 8px;
    --pp-space-3: 12px;
    --pp-space-4: 16px;
    --pp-space-5: 24px;
    --pp-space-6: 32px;
    --pp-space-7: 44px;
    --pp-shadow-sm: 0 10px 24px rgba(16, 24, 40, .06);
    --pp-shadow-md: 0 20px 48px rgba(16, 24, 40, .10);
    --pp-shadow-lg: 0 34px 80px rgba(19, 46, 117, .18);
    --pp-ease-out: cubic-bezier(.23, 1, .32, 1);
    --pp-ease-in-out: cubic-bezier(.77, 0, .175, 1);
}

body.home-route {
    background:
        linear-gradient(180deg, #eef4fb 0, #f7faf5 48%, #f4f7fb 100%);
    color: var(--pp-ink);
}

body.home-route .app-shell {
    width: min(1160px, calc(100% - 40px));
}

/* Navigation */
body.home-route .app-topbar {
    background: rgba(246, 249, 250, .78);
    border-bottom: 1px solid rgba(223, 231, 240, .72);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .82) inset;
    backdrop-filter: blur(22px) saturate(160%);
}

body.home-route .app-brand img {
    width: 38px;
    height: 38px;
    max-width: 38px !important;
    padding: 7px;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--pp-blue), var(--pp-green));
    box-shadow: 0 12px 22px rgba(19, 46, 117, .22);
}

body.home-route .app-brand strong {
    font-size: 15px;
    letter-spacing: 0;
}

body.home-route .app-nav {
    background: rgba(255, 255, 255, .74);
    border-color: rgba(223, 231, 240, .9);
    box-shadow: var(--pp-shadow-sm);
}

body.home-route .app-nav a {
    color: var(--pp-ink-soft);
    transition: background-color 180ms var(--pp-ease-out), color 180ms var(--pp-ease-out), transform 140ms var(--pp-ease-out);
}

body.home-route .app-nav a:hover {
    background: rgba(19, 46, 117, .08);
    color: var(--pp-blue);
}

body.home-route .app-nav a:active,
body.home-route .app-user-chip:active,
body.home-route .home-search button:active,
body.home-route .svc-card:active {
    transform: scale(.97);
}

body.home-route .app-user-chip {
    background: linear-gradient(145deg, var(--pp-blue), #0f245f);
    box-shadow: 0 14px 28px rgba(19, 46, 117, .24);
    transition: transform 140ms var(--pp-ease-out), filter 180ms var(--pp-ease-out);
}

body.home-route .app-user-chip:hover {
    filter: brightness(1.08);
}

/* Page rhythm */
body.home-route .dash-page {
    padding: 42px 0 72px;
}

/* Hero */
body.home-route .home-banner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(20px, 5vw, 54px);
    align-items: center;
    min-height: 390px;
    padding: clamp(28px, 5vw, 56px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .64);
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(16, 42, 105, .96) 0%, rgba(24, 82, 133, .92) 48%, rgba(38, 130, 116, .88) 100%) !important;
    box-shadow: var(--pp-shadow-lg) !important;
    isolation: isolate;
}

body.home-route .home-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}

body.home-route .home-banner::after {
    content: "";
    position: absolute;
    inset: auto -10% -38% -10%;
    height: 58%;
    z-index: -1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0));
    transform: skewY(-5deg);
}

body.home-route .dash-banner-text {
    max-width: 760px;
}

body.home-route .home-banner .dash-banner-badge {
    width: fit-content;
    margin-bottom: var(--pp-space-4);
    color: #e8fff0;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .20);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}

body.home-route .home-banner h1 {
    max-width: 760px;
    margin: 0 0 var(--pp-space-3) !important;
    color: #fff;
    font-size: clamp(30px, 5.5vw, 56px) !important;
    font-weight: 800;
    line-height: 1.32 !important;
    letter-spacing: 0;
    text-wrap: balance;
}

body.home-route .home-banner p {
    max-width: 680px;
    margin-bottom: var(--pp-space-5) !important;
    color: rgba(255, 255, 255, .82);
    font-size: clamp(14px, 2.2vw, 17px) !important;
    line-height: 2 !important;
}

body.home-route .home-search {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 58px;
    gap: 8px;
    width: min(720px, 100%);
    max-width: none !important;
    padding: 8px !important;
    border: 1px solid rgba(255, 255, 255, .62) !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: 0 22px 54px rgba(2, 14, 38, .24) !important;
    backdrop-filter: blur(18px) saturate(160%);
}

body.home-route .home-search input {
    min-width: 0;
    height: 58px;
    padding: 0 18px !important;
    color: var(--pp-ink);
    font-size: 15px !important;
}

body.home-route .home-search input::placeholder {
    color: #8a95a6;
}

body.home-route .home-search button {
    width: 58px !important;
    height: 58px !important;
    border-radius: 17px !important;
    background: linear-gradient(145deg, var(--pp-green), #23a866) !important;
    box-shadow: 0 16px 30px rgba(56, 187, 91, .32);
    transition: transform 140ms var(--pp-ease-out), box-shadow 180ms var(--pp-ease-out), filter 180ms var(--pp-ease-out);
}

body.home-route .home-search button:hover {
    filter: brightness(1.05);
    box-shadow: 0 18px 36px rgba(56, 187, 91, .38);
}

body.home-route .home-trust {
    gap: 10px;
    margin-top: var(--pp-space-4);
}

body.home-route .home-trust-chip {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .90);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}

body.home-route .home-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: min(640px, 100%);
    margin-top: var(--pp-space-5);
}

body.home-route .home-hero-stats span {
    display: grid;
    gap: 3px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 18px;
    background: rgba(255, 255, 255, .10);
    color: #fff;
}

body.home-route .home-hero-stats strong {
    font-size: 21px;
    font-weight: 800;
}

body.home-route .home-hero-stats small {
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
}

body.home-route .dash-banner-art {
    display: grid;
    place-items: center;
    min-width: 0;
    transform: none;
}

body.home-route .dash-banner-art svg {
    width: min(280px, 100%);
    height: auto;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 34px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06));
    box-shadow: 0 26px 60px rgba(0, 0, 0, .18);
    backdrop-filter: blur(14px);
}

/* Sections */
body.home-route .dash-section {
    margin-top: var(--pp-space-7);
}

body.home-route .dash-section-head {
    margin-bottom: var(--pp-space-5);
}

body.home-route .dash-section-head h2 {
    color: var(--pp-ink);
    font-size: clamp(21px, 3vw, 28px);
    letter-spacing: 0;
}

body.home-route .dash-section-head h2::before {
    width: 5px;
    height: 24px;
    background: linear-gradient(180deg, var(--pp-green), var(--pp-teal));
}

body.home-route .dash-section-head a {
    color: var(--pp-blue);
    background: rgba(19, 46, 117, .08);
    border: 1px solid rgba(19, 46, 117, .08);
    transition: background-color 180ms var(--pp-ease-out), transform 140ms var(--pp-ease-out);
}

body.home-route .dash-section-head a:active {
    transform: scale(.97);
}

body.home-route .svc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

body.home-route .svc-card {
    position: relative;
    min-height: 156px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(223, 231, 240, .92);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(249, 252, 250, .94));
    box-shadow: var(--pp-shadow-sm);
    transition: transform 200ms var(--pp-ease-out), box-shadow 200ms var(--pp-ease-out), border-color 200ms var(--pp-ease-out);
}

body.home-route .svc-card::after {
    content: "";
    position: absolute;
    inset-inline: 18px;
    bottom: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--pp-green), var(--pp-blue-2), var(--pp-gold));
    opacity: .72;
}

body.home-route .svc-card strong {
    display: block;
    margin-top: 14px;
    color: var(--pp-ink);
    font-size: 15px;
    line-height: 1.65;
}

body.home-route .svc-card small {
    display: block;
    margin-top: 5px;
    color: var(--pp-blue);
    font-weight: 800;
}

body.home-route .svc-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    box-shadow: 0 14px 28px rgba(16, 24, 40, .12);
}

body.home-route .svc-card-icon svg {
    width: 24px;
    height: 24px;
}

body.home-route .home-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: var(--pp-space-7);
}

body.home-route .home-feature {
    min-width: 0;
    align-items: flex-start;
    padding: 18px;
    border-color: rgba(223, 231, 240, .9);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(251, 252, 248, .92));
    box-shadow: var(--pp-shadow-sm);
}

body.home-route .home-feature strong {
    color: var(--pp-ink);
    font-size: 15px;
}

body.home-route .home-feature small {
    color: var(--pp-muted);
    line-height: 1.8;
}

/* Motion */
body.home-route .home-banner,
body.home-route .dash-section,
body.home-route .home-feature {
    animation: pp-rise 520ms var(--pp-ease-out) both;
}

body.home-route .dash-section:nth-of-type(2) {
    animation-delay: 60ms;
}

body.home-route .dash-section:nth-of-type(3) {
    animation-delay: 110ms;
}

@keyframes pp-rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: hover) and (pointer: fine) {
    body.home-route .svc-card:hover {
        transform: translateY(-5px);
        border-color: rgba(19, 46, 117, .20);
        box-shadow: var(--pp-shadow-md);
    }

    body.home-route .svc-card:hover .svc-card-icon {
        filter: brightness(1.06) saturate(1.05);
    }
}

@media (max-width: 1080px) {
    body.home-route .home-banner {
        grid-template-columns: 1fr 220px;
    }

    body.home-route .svc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    body.home-route .dash-page {
        padding-top: 24px;
    }

    body.home-route .home-banner {
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 30px;
    }

    body.home-route .dash-banner-art {
        display: none;
    }

    body.home-route .home-hero-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.home-route .svc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.home-route .home-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body.home-route .app-shell {
        width: min(100% - 24px, 480px);
    }

    body.home-route .dash-page {
        padding: 14px 0 96px;
    }

    body.home-route .home-banner {
        padding: 24px 18px;
        border-radius: 26px;
    }

    body.home-route .home-banner h1 {
        font-size: 27px !important;
        line-height: 1.45 !important;
    }

    body.home-route .home-banner p {
        font-size: 13px !important;
    }

    body.home-route .home-search {
        grid-template-columns: 1fr 52px;
        border-radius: 19px !important;
    }

    body.home-route .home-search input {
        height: 52px;
        padding: 0 12px !important;
        font-size: 13px !important;
    }

    body.home-route .home-search button {
        width: 52px !important;
        height: 52px !important;
    }

    body.home-route .home-trust {
        display: grid;
        grid-template-columns: 1fr;
    }

    body.home-route .home-trust-chip {
        justify-content: center;
    }

    body.home-route .home-hero-stats {
        grid-template-columns: 1fr;
    }

    body.home-route .home-hero-stats span {
        grid-template-columns: auto 1fr;
        align-items: baseline;
        gap: 10px;
    }

    body.home-route .dash-section {
        margin-top: 34px;
    }

    body.home-route .dash-section-head {
        align-items: center;
        gap: 12px;
    }

    body.home-route .dash-section-head h2 {
        font-size: 21px;
    }

    body.home-route .svc-grid {
        gap: 10px;
    }

    body.home-route .svc-card {
        min-height: 142px;
        padding: 14px;
        border-radius: 18px;
    }

    body.home-route .svc-card strong {
        font-size: 13px;
    }

    body.home-route .svc-card small {
        font-size: 12px;
    }

    body.home-route .svc-card-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    body.home-route .mobile-tabbar {
        right: 10px;
        left: 10px;
        bottom: 10px;
        border-radius: 22px;
        box-shadow: 0 18px 44px rgba(16, 24, 40, .16);
    }

    body.home-route .support-fab {
        right: auto;
        left: 18px;
        top: 18px;
        bottom: auto;
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 999px;
        justify-content: center;
    }

    body.home-route .support-fab-text {
        display: none;
    }
}

@media (max-width: 360px) {
    body.home-route .svc-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.home-route .home-banner,
    body.home-route .dash-section,
    body.home-route .home-feature {
        animation: none;
    }

    body.home-route .app-nav a,
    body.home-route .app-user-chip,
    body.home-route .home-search button,
    body.home-route .svc-card,
    body.home-route .dash-section-head a {
        transition-duration: 1ms;
    }
}
