/* Powder Finder discovery and signed-out conversion enhancements.
 * Deliberately additive so the underlying pages remain usable without JS. */

.pf-discovery-shell {
    position: relative;
    z-index: 12;
}

.pf-discovery-shell > input {
    position: relative;
    z-index: 2;
}

.pf-discovery-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 80;
    display: none;
    max-height: min(430px, 58vh);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(126, 178, 216, 0.28);
    border-radius: 18px;
    color: #0c1a26;
    background: rgba(248, 252, 255, 0.98);
    box-shadow: 0 24px 70px rgba(2, 16, 28, 0.28);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.pf-discovery-results.is-open {
    display: block;
}

.pf-discovery-section-label {
    display: block;
    padding: 8px 11px 5px;
    color: #547084;
    font: 700 0.68rem/1.2 var(--font-sans, system-ui, sans-serif);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pf-discovery-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 62px;
    padding: 8px 9px 8px 12px;
    border-radius: 12px;
    outline: none;
}

.pf-discovery-option + .pf-discovery-option {
    border-top: 1px solid rgba(24, 64, 91, 0.08);
}

.pf-discovery-option.is-active,
.pf-discovery-option:hover {
    background: #eaf4fb;
}

.pf-discovery-primary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 0;
    border: 0;
    color: inherit;
    text-align: left;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
}

.pf-discovery-primary:focus-visible,
.pf-discovery-action:focus-visible,
.pf-local-dock button:focus-visible,
.pf-auth-modal a:focus-visible,
.pf-auth-modal button:focus-visible {
    outline: 3px solid rgba(41, 132, 190, 0.45);
    outline-offset: 2px;
}

.pf-discovery-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(35, 99, 139, 0.15);
    border-radius: 10px;
    color: #276f9f;
    background: #f4f9fc;
    font-size: 0.9rem;
}

.pf-discovery-copy {
    min-width: 0;
}

.pf-discovery-name,
.pf-discovery-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-discovery-name {
    color: #0b2233;
    font: 700 0.93rem/1.3 var(--font-sans, system-ui, sans-serif);
}

.pf-discovery-meta {
    margin-top: 2px;
    color: #637d8f;
    font: 500 0.73rem/1.35 var(--font-sans, system-ui, sans-serif);
}

.pf-discovery-actions,
.pf-card-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pf-discovery-action,
.pf-card-action {
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid rgba(35, 99, 139, 0.2);
    border-radius: 999px;
    color: #315b74;
    background: rgba(255, 255, 255, 0.82);
    font: 700 0.68rem/1 var(--font-sans, system-ui, sans-serif);
    cursor: pointer;
}

.pf-discovery-action:hover,
.pf-discovery-action.is-selected,
.pf-card-action:hover,
.pf-card-action.is-selected {
    color: #fff;
    border-color: #195f8f;
    background: #195f8f;
}

.pf-discovery-message {
    display: grid;
    gap: 5px;
    padding: 18px 16px;
    color: #35556a;
    text-align: left;
}

.pf-discovery-message strong {
    color: #0b2233;
    font-size: 0.9rem;
}

.pf-discovery-message span {
    font-size: 0.78rem;
    line-height: 1.5;
}

.pf-discovery-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Results page search sits inside a compact icon wrapper. */
.page-resorts .browse-search-wrap.pf-discovery-shell .pf-discovery-results {
    top: calc(100% + 8px);
    min-width: min(620px, calc(100vw - 32px));
}

.page-resorts:has(.pf-discovery-results.is-open) #browse-empty {
    display: none;
}

.page-resorts #sign-in-button.nav-link {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

/* Decorative atlas snow: intentionally scoped to the browse hero and kept
 * behind every control so it never reads as live-weather telemetry. */
.page-resorts .browse-hero {
    isolation: isolate;
}

.pf-atlas-snow {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.page-resorts .browse-hero > :not(.pf-atlas-snow) {
    position: relative;
    z-index: 1;
}

.pf-atlas-snow span {
    --snow-size: 4px;
    --snow-left: 5%;
    --snow-duration: 12s;
    --snow-delay: -2s;
    position: absolute;
    top: -12%;
    left: var(--snow-left);
    width: var(--snow-size);
    height: var(--snow-size);
    border-radius: 50%;
    opacity: 0;
    background: rgba(236, 249, 255, 0.82);
    box-shadow: 0 0 9px rgba(215, 242, 255, 0.5);
    animation: pf-atlas-snowfall var(--snow-duration) linear var(--snow-delay) infinite;
}

.pf-atlas-snow span:nth-child(2) { --snow-left: 12%; --snow-size: 2px; --snow-duration: 15s; --snow-delay: -9s; }
.pf-atlas-snow span:nth-child(3) { --snow-left: 19%; --snow-size: 5px; --snow-duration: 13s; --snow-delay: -5s; }
.pf-atlas-snow span:nth-child(4) { --snow-left: 27%; --snow-size: 3px; --snow-duration: 17s; --snow-delay: -12s; }
.pf-atlas-snow span:nth-child(5) { --snow-left: 34%; --snow-size: 2px; --snow-duration: 12s; --snow-delay: -7s; }
.pf-atlas-snow span:nth-child(6) { --snow-left: 42%; --snow-size: 4px; --snow-duration: 16s; --snow-delay: -3s; }
.pf-atlas-snow span:nth-child(7) { --snow-left: 49%; --snow-size: 3px; --snow-duration: 14s; --snow-delay: -11s; }
.pf-atlas-snow span:nth-child(8) { --snow-left: 56%; --snow-size: 5px; --snow-duration: 18s; --snow-delay: -8s; }
.pf-atlas-snow span:nth-child(9) { --snow-left: 63%; --snow-size: 2px; --snow-duration: 13s; --snow-delay: -1s; }
.pf-atlas-snow span:nth-child(10) { --snow-left: 70%; --snow-size: 4px; --snow-duration: 16s; --snow-delay: -13s; }
.pf-atlas-snow span:nth-child(11) { --snow-left: 77%; --snow-size: 3px; --snow-duration: 12s; --snow-delay: -6s; }
.pf-atlas-snow span:nth-child(12) { --snow-left: 83%; --snow-size: 2px; --snow-duration: 17s; --snow-delay: -10s; }
.pf-atlas-snow span:nth-child(13) { --snow-left: 89%; --snow-size: 5px; --snow-duration: 14s; --snow-delay: -4s; }
.pf-atlas-snow span:nth-child(14) { --snow-left: 94%; --snow-size: 3px; --snow-duration: 19s; --snow-delay: -15s; }
.pf-atlas-snow span:nth-child(15) { --snow-left: 58%; --snow-size: 2px; --snow-duration: 11s; --snow-delay: -8s; }

@keyframes pf-atlas-snowfall {
    0% { opacity: 0; transform: translate3d(0, -8%, 0); }
    12% { opacity: 0.68; }
    75% { opacity: 0.4; }
    100% { opacity: 0; transform: translate3d(34px, 780%, 0); }
}

/* Signed-out actions are local-only and never replace canonical card clicks. */
.spotlight-card.pf-discovery-enhanced {
    position: relative;
    padding-bottom: 58px;
}

.spotlight-card .pf-card-actions {
    position: absolute;
    right: 18px;
    bottom: 16px;
    left: 18px;
    justify-content: flex-end;
    z-index: 3;
}

.spotlight-card .pf-card-action {
    color: rgba(229, 244, 252, 0.86);
    border-color: rgba(214, 238, 251, 0.2);
    background: rgba(5, 26, 42, 0.42);
    backdrop-filter: blur(10px);
}

.pf-local-dock {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2200;
    display: none;
    width: min(390px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid rgba(157, 204, 232, 0.25);
    border-radius: 18px;
    color: #eaf7ff;
    background: rgba(5, 23, 36, 0.94);
    box-shadow: 0 20px 60px rgba(0, 8, 16, 0.4);
    backdrop-filter: blur(22px);
}

.pf-local-dock.is-visible {
    display: block;
}

.pf-local-dock-head,
.pf-local-dock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pf-local-dock-title {
    display: grid;
    gap: 2px;
}

.pf-local-dock-title strong {
    font-size: 0.82rem;
}

.pf-local-dock-title span {
    color: rgba(215, 237, 249, 0.58);
    font-size: 0.68rem;
}

.pf-local-dock-close,
.pf-local-dock-remove {
    border: 0;
    color: rgba(228, 244, 252, 0.72);
    background: transparent;
    cursor: pointer;
}

.pf-local-dock-list {
    display: grid;
    gap: 7px;
    margin: 11px 0;
}

.pf-local-dock-item {
    padding: 9px 10px;
    border: 1px solid rgba(189, 224, 243, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.76rem;
}

.pf-local-dock-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(189, 224, 243, 0.1);
    color: rgba(215, 237, 249, 0.6);
    font-size: 0.68rem;
}

.pf-local-dock-footer button {
    padding: 8px 12px;
    border: 1px solid rgba(184, 222, 243, 0.24);
    border-radius: 999px;
    color: #effaff;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
    cursor: pointer;
}

.pf-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 10020;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    border: 1px solid rgba(170, 218, 243, 0.22);
    border-radius: 999px;
    color: #effaff;
    background: rgba(4, 21, 34, 0.96);
    box-shadow: 0 16px 45px rgba(0, 8, 16, 0.36);
    transform: translate(-50%, 130%);
    transition: transform 180ms ease;
    font: 600 0.76rem/1.25 var(--font-sans, system-ui, sans-serif);
}

.pf-toast.is-visible {
    transform: translate(-50%, 0);
}

.pf-toast button {
    padding: 7px 10px;
    border: 0;
    border-radius: 999px;
    color: #082033;
    background: #dff3ff;
    font-weight: 800;
    cursor: pointer;
}

/* Modal overrides intentionally remove the header/backdrop containing block issue. */
.pf-auth-modal.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
}

.pf-auth-modal .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(1, 12, 21, 0.76);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pf-auth-modal .modal-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(290px, 1.1fr);
    width: min(820px, 100%);
    max-width: 820px;
    max-height: calc(100dvh - 36px);
    margin: auto;
    overflow: auto;
    border: 1px solid rgba(157, 208, 237, 0.24);
    border-radius: 24px;
    color: #eaf7ff;
    background: #071d2d;
    box-shadow: 0 32px 100px rgba(0, 6, 12, 0.55);
}

.pf-auth-modal .pf-auth-benefits {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 480px;
    padding: 34px;
    background:
        linear-gradient(180deg, rgba(2, 20, 33, 0.08), rgba(2, 20, 33, 0.88)),
        url('/static/images/heroes/bc-whistler.jpg') center/cover,
        linear-gradient(145deg, #174d70, #071d2d);
}

.pf-auth-eyebrow {
    color: #9ed8f5;
    font: 800 0.68rem/1.2 var(--font-sans, system-ui, sans-serif);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pf-auth-benefits h2 {
    margin: 12px 0 10px;
    color: #fff;
    font: 600 clamp(1.85rem, 4vw, 2.8rem)/0.98 var(--font-display, Georgia, serif);
}

.pf-auth-benefits p {
    margin: 0;
    color: rgba(231, 246, 254, 0.75);
    font-size: 0.82rem;
    line-height: 1.55;
}

.pf-auth-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 32px 32px 0;
    border: 0;
}

.pf-auth-modal .modal-title {
    margin: 0;
    color: #f2faff;
    font: 600 1.4rem/1.15 var(--font-display, Georgia, serif);
}

.pf-auth-modal .modal-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(184, 222, 243, 0.15);
    border-radius: 50%;
    color: #c9e4f2;
    background: rgba(255, 255, 255, 0.05);
}

.pf-auth-modal .modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.pf-auth-modal .modal-body {
    padding: 18px 32px 32px;
}

.pf-auth-modal .modal-description {
    margin: 0 0 20px;
    color: rgba(218, 238, 249, 0.67);
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.5;
}

.pf-auth-modal .auth-buttons {
    display: grid;
    gap: 10px;
}

.pf-auth-modal .auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    font: 700 0.84rem/1 var(--font-sans, system-ui, sans-serif);
    transform: none;
}

.pf-auth-modal .auth-button-google {
    color: #102333;
    border-color: rgba(202, 227, 240, 0.22);
    background: #f5fbfe;
}

.pf-auth-modal .auth-button-google:hover {
    color: #071d2d;
    border-color: #fff;
    background: #fff;
}

.pf-auth-modal .auth-button-github {
    color: #eef9ff;
    border-color: rgba(202, 227, 240, 0.18);
    background: rgba(255, 255, 255, 0.07);
}

.pf-auth-modal .auth-button-github:hover {
    color: #fff;
    border-color: rgba(202, 227, 240, 0.34);
    background: rgba(255, 255, 255, 0.12);
}

.pf-auth-modal .auth-icon {
    display: grid;
    flex: 0 0 22px;
    place-items: center;
    width: 22px;
    height: 22px;
}

.pf-auth-modal .pf-auth-list {
    display: grid;
    gap: 10px;
    margin: 22px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid rgba(184, 222, 243, 0.12);
    list-style: none;
}

.pf-auth-modal .pf-auth-list li {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 10px;
    align-items: center;
    color: rgba(226, 242, 250, 0.76);
    font-size: 0.76rem;
}

.pf-auth-modal .pf-auth-list span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: #b9e7ff;
    background: rgba(122, 199, 238, 0.1);
}

.pf-auth-fine-print {
    margin: 18px 0 0;
    color: rgba(202, 227, 240, 0.48);
    font-size: 0.66rem;
    line-height: 1.5;
}

.public-mobile-dock {
    display: none;
}

@media (max-width: 700px) {
    body.page-home {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .public-mobile-dock {
        position: fixed;
        z-index: 980;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        padding: 6px;
        background: rgba(7, 17, 26, 0.94);
        border: 1px solid rgba(184, 222, 243, 0.18);
        border-radius: 16px;
        box-shadow: 0 18px 54px rgba(3, 11, 18, 0.35);
        backdrop-filter: blur(18px);
    }

    .public-mobile-dock a,
    .public-mobile-dock button {
        display: inline-flex;
        min-height: 46px;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        background: transparent;
        border: 0;
        border-radius: 11px;
        color: rgba(237, 247, 252, 0.74);
        font: 750 0.72rem/1 var(--font-sans, system-ui, sans-serif);
        text-decoration: none;
    }

    .public-mobile-dock a:nth-child(2) {
        background: rgba(99, 201, 244, 0.12);
        color: #8bd7f6;
    }

    .public-mobile-dock button {
        cursor: pointer;
    }

    .public-mobile-dock a:focus-visible,
    .public-mobile-dock button:focus-visible {
        outline: 3px solid rgba(99, 201, 244, 0.55);
        outline-offset: 1px;
    }

    .pf-discovery-results {
        position: fixed;
        top: auto !important;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        max-height: min(520px, 66dvh);
        min-width: 0 !important;
        border-radius: 20px;
    }

    body.page-home .pf-discovery-results,
    body.page-home .pf-local-dock {
        bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .pf-discovery-option {
        grid-template-columns: minmax(0, 1fr);
    }

    .pf-discovery-actions {
        padding-left: 44px;
    }

    .pf-auth-modal.modal {
        align-items: flex-end;
        padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    }

    .pf-auth-modal .modal-content {
        grid-template-columns: 1fr;
        max-height: calc(100dvh - 20px);
        border-radius: 22px;
    }

    .pf-auth-modal .pf-auth-benefits {
        min-height: 180px;
        padding: 24px;
    }

    .pf-auth-benefits h2 {
        max-width: 310px;
        font-size: 2rem;
    }

    .pf-auth-modal .modal-header {
        padding: 24px 22px 0;
    }

    .pf-auth-modal .modal-body {
        padding: 14px 22px 24px;
    }

    .pf-local-dock {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pf-toast {
        transition: none;
    }

    .pf-atlas-snow {
        display: none;
    }
}
