/* ─── Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100dvh;
    background: #faf8f5;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dark body,
html.dark body {
    background: #112117;
}

/* Ensure #app inherits the warm off-white so no white bleed-through in light mode */
#app {
    background: #faf8f5;
}

html.dark #app {
    background: #112117;
}

/* Fix: checkout/cart pages have their own full-page backgrounds.
   The #app-content-wrapper is a transparent flex wrapper — the checkout-container
   inside it must cover 100% height, and #app must not show its own dark bg behind it. */
#checkout-container {
    background: #faf8f5;
    min-height: 100vh;
    width: 100%;
    flex: 1;
}

html.dark #checkout-container {
    background: #0F0F10;
}

#checkout-container > main {
    background: #faf8f5;
    flex: 1;
    width: 100%;
}

html.dark #checkout-container > main {
    background: #0F0F10;
}

/* When #app-content-wrapper contains the checkout page, neutralize #app's bg */
#app:has(#checkout-container) {
    background: #faf8f5 !important;
}

html.dark #app:has(#checkout-container) {
    background: #0F0F10 !important;
}

/* ─── Theme Transition ─────────────────────────────────── */
/* Smooth transition for theme switching on key elements */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* ─── Material Symbols ──────────────────────────────────── */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.fill-1 {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ─── Scrollbar Hiding ──────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ─── Page Transitions ──────────────────────────────────── */
#app>* {
    animation: fadeSlideIn 0.22s ease-out both;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Select Arrow ──────────────────────────────────────── */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2319e665' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* ─── Chat Bubble ───────────────────────────────────────── */
.chat-bubble-in {
    background: #f1f5f9;
    border-radius: 0 1rem 1rem 1rem;
}

.dark .chat-bubble-in {
    background: #1e1e1e;
}

.chat-bubble-out {
    background: #dcfce7;
    border-radius: 1rem 0 1rem 1rem;
}

.dark .chat-bubble-out {
    background: #005c4b;
}

/* ─── Progress bar animation ─────────────────────────────── */
.progress-bar-fill {
    transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}

/* ─── Active scale ──────────────────────────────────────── */
.tap {
    transition: transform 0.1s;
}

.tap:active {
    transform: scale(0.95);
}

/* ─── Map Pattern ───────────────────────────────────────── */
.map-pattern {
    background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
    background-size: 30px 30px;
}

.dark .map-pattern {
    background-image: radial-gradient(circle, #334155 1px, transparent 1px);
}

@keyframes pulse-ring {
    0% {
        transform: scale(.33);
    }

    80%,
    100% {
        opacity: 0;
    }
}

.pulse-ring::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    border-radius: 50%;
    background-color: #3b82f6;
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
    left: -100%;
    top: -100%;
}

/* ─── Admin Dashboard Cards ────────────────────────────────── */
.admin-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dark .admin-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
}

/* ─── Admin Toggle Switch ──────────────────────────────── */
.toggle-checkbox:checked {
    right: 0 !important;
    border-color: #00ff73;
    background-color: #00ff73;
}

.toggle-checkbox:checked+.toggle-label {
    background-color: rgba(0, 255, 115, 0.2);
}

/* ══════════════════════════════════════════════════════════
   DESKTOP LAYOUT (lg ≥ 1024px)
   ─ Only additive rules — mobile stays untouched
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {

    /* Hide mobile bottom nav on desktop */
    #app nav[class*="border-t"] {
        display: none !important;
    }

    /* Let the #app column scroll independently */
    #app {
        overflow-y: auto;
        height: 100vh;
    }

    /* Fixed bottom bars in chat pages: scope to #app column  */
    #app .fixed {
        position: absolute;
    }

    /* Desktop card hover lift effect */
    #app .bg-dark-card,
    #app .dark\:bg-dark-card {
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    #app .bg-dark-card:hover,
    #app .dark\:bg-dark-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.3);
    }

    /* Wider content area: relax max-widths inside the app */
    #app>div {
        max-width: 100%;
    }

    /* Sidebar nav link hover glow */
    #desktop-sidebar a:hover {
        transition: all 0.2s ease;
    }

    /* Remove the outer shadow on desktop since sidebar provides the edge */
    #app {
        box-shadow: none;
    }

    /* Desktop scrollbar styling — Light mode */
    #app::-webkit-scrollbar {
        width: 6px;
    }

    #app::-webkit-scrollbar-track {
        background: #f8fafc;
    }

    #app::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }

    #app::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    /* Desktop scrollbar styling — Dark mode */
    .dark #app::-webkit-scrollbar-track {
        background: #0f172a;
    }

    .dark #app::-webkit-scrollbar-thumb {
        background: #334155;
    }

    .dark #app::-webkit-scrollbar-thumb:hover {
        background: #475569;
    }
}

/* ═══════════════════════════════════════════════════════════
   SOCIAL FEED STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── Comment nesting connector lines ─────────────────────── */
.sf-comment-connector {
    position: relative;
    padding-left: 0;
}

.sf-comment-connector::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, #e2e8f0, transparent);
    border-radius: 1px;
}

.dark .sf-comment-connector::before {
    background: linear-gradient(to bottom, #334155, transparent);
}

/* ── Heart pop animation ─────────────────────────────────── */
@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.sf-heart-pop {
    animation: heartPop 0.3s ease-out;
}

/* ── Toast notification ──────────────────────────────────── */
.sf-toast {
    transition: opacity 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

/* ── Create modal slide-up ───────────────────────────────── */
#sf-create-modal .sf-modal-content {
    animation: modalSlideUp 0.25s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ── Embed responsive ────────────────────────────────────── */
.sf-embed {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
}

.sf-embed-fallback {
    display: flex;
    text-decoration: none;
}

/* ── Post card hover on desktop ──────────────────────────── */
@media (min-width: 1024px) {
    .sf-post {
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .sf-post:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px -5px rgba(0, 0, 0, 0.4);
    }
}

/* ── Search bar ─────────────────────────────────────────── */
.sf-search-input:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.sf-search-wrap {
    transition: transform 0.15s ease;
}

.sf-search-wrap:focus-within {
    transform: scale(1.01);
}

/* ── Search result count animation ──────────────────────── */
#sf-search-result-count {
    animation: fadeSlideIn 0.2s ease-out;
}

/* ── Skeleton content shimmer ───────────────────────────── */
@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.sf-content-skeleton>div {
    background: linear-gradient(90deg,
            rgba(226, 232, 240, 0.3) 25%,
            rgba(226, 232, 240, 0.5) 50%,
            rgba(226, 232, 240, 0.3) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

.dark .sf-content-skeleton>div {
    background: linear-gradient(90deg,
            rgba(51, 65, 85, 0.3) 25%,
            rgba(51, 65, 85, 0.5) 50%,
            rgba(51, 65, 85, 0.3) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

/* ── Search card entry animation ────────────────────────── */
.sf-search-card {
    animation: fadeSlideIn 0.2s ease-out both;
}

.sf-search-card:nth-child(1) {
    animation-delay: 0.02s;
}

.sf-search-card:nth-child(2) {
    animation-delay: 0.04s;
}

.sf-search-card:nth-child(3) {
    animation-delay: 0.06s;
}

.sf-search-card:nth-child(4) {
    animation-delay: 0.08s;
}

.sf-search-card:nth-child(5) {
    animation-delay: 0.10s;
}

.sf-search-card:nth-child(n+6) {
    animation-delay: 0.12s;
}

/* ── Error card pulse ───────────────────────────────────── */
.sf-post[data-post-id] .text-red-400 {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ═══════════════════════════════════════════════════════════
   STORIES STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── Unseen story glow pulse ─────────────────────────────── */
@keyframes storyGlow {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 14px rgba(34, 197, 94, 0.7);
    }
}

.sf-story-glow {
    animation: storyGlow 2s ease-in-out infinite;
}

/* ── Story progress bar fill (5s duration matches JS) ────── */
@keyframes storyProgressFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.sf-story-progress-fill {
    animation: storyProgressFill 5s linear forwards;
}

/* ── Story viewer fade-in ────────────────────────────────── */
#sf-story-viewer {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out both;
}

/* ── Viewers panel slide-up ──────────────────────────────── */
#sf-story-viewers-panel {
    animation: modalSlideUp 0.25s ease-out;
}

/* ═══════════════════════════════════════════════════════════
   THREAD / COMMENT MODAL ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

/* ── Modal slide-up entrance ────────────────────────────── */
@keyframes threadSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#sf-thread-modal>div>div>div,
#sf-reply-modal>div>div>div {
    animation: threadSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Backdrop fade-in ───────────────────────────────────── */
.sf-thread-backdrop,
.sf-reply-backdrop {
    animation: fadeIn 0.2s ease-out;
}

/* ── Thread content slide transitions ───────────────────── */
@keyframes threadSlideLeft {
    from {
        transform: translateX(60px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes threadSlideRight {
    from {
        transform: translateX(-60px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sf-thread-enter {
    animation: threadSlideRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sf-thread-back-enter {
    animation: threadSlideLeft 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Original comment quote scale-in ────────────────────── */
@keyframes quoteScaleIn {
    from {
        transform: scaleY(0.9) translateY(-5px);
        opacity: 0;
    }

    to {
        transform: scaleY(1) translateY(0);
        opacity: 1;
    }
}

#sf-thread-modal .border-l-2 {
    animation: quoteScaleIn 0.2s ease-out;
    transform-origin: top;
}

/* ── New reply highlight ────────────────────────────────── */
@keyframes replyHighlight {
    0% {
        background: rgba(34, 197, 94, 0.15);
    }

    100% {
        background: transparent;
    }
}

.sf-reply-new {
    animation: replyHighlight 1.5s ease-out;
    border-radius: 8px;
}

/* ── Reply item stagger fade-in ─────────────────────────── */
@keyframes replyFadeIn {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#sf-thread-replies>div {
    animation: replyFadeIn 0.25s ease-out both;
}

#sf-thread-replies>div:nth-child(1) {
    animation-delay: 0.03s;
}

#sf-thread-replies>div:nth-child(2) {
    animation-delay: 0.06s;
}

#sf-thread-replies>div:nth-child(3) {
    animation-delay: 0.09s;
}

#sf-thread-replies>div:nth-child(4) {
    animation-delay: 0.12s;
}

#sf-thread-replies>div:nth-child(5) {
    animation-delay: 0.15s;
}

#sf-thread-replies>div:nth-child(n+6) {
    animation-delay: 0.18s;
}

/* ═══════════════════════════════════════════════════════════
   MAPS PAGE UI STYLES
   ═══════════════════════════════════════════════════════════ */

/* Location permission modal — glassmorphism */
.map-permission-modal {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Custom Leaflet marker — circular image with ring */
.map-marker-custom {
    background: none;
    border: none;
}

.map-marker-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #ffffff;
}

.dark .map-marker-ring {
    background: #112117;
}

.map-marker-ring:hover {
    transform: scale(1.15);
    z-index: 9999 !important;
}

.map-marker-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-marker-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* MarkerCluster custom icon override */
.marker-cluster-custom {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.marker-cluster-custom:hover {
    transform: scale(1.1);
}

/* Fixed horizontal carousel container — always dark */
.map-bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #0d1a12;
    border-top: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    max-height: 260px;
}

/* Filter pill buttons */
.map-filter-btn {
    background: rgba(255,255,255,0.04);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.map-filter-btn.active {
    background: linear-gradient(135deg, #1fcb53, #159b3f);
    color: #fff;
    border-color: #1fcb53;
    box-shadow: 0 4px 12px rgba(31, 203, 83, 0.3);
}
.map-filter-btn:hover:not(.active) {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
}

/* Modern popup override */
.map-popup-modern .leaflet-popup-content-wrapper {
    background: #1a2531 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6) !important;
    border-radius: 14px !important;
    padding: 12px !important;
    color: #fff !important;
}
.map-popup-modern .leaflet-popup-tip {
    background: #1a2531 !important;
}
.map-popup-modern .leaflet-popup-content {
    margin: 0 !important;
}


/* Leaflet popup overrides — Light mode */
.leaflet-popup-content-wrapper {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    padding: 0 !important;
}

.dark .leaflet-popup-content-wrapper {
    background: #1e1e1e !important;
    color: #f5f5f5 !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-content {
    margin: 12px !important;
}

.leaflet-popup-tip {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    border-left: 1px solid #e2e8f0 !important;
}

.dark .leaflet-popup-tip {
    background: #1e1e1e !important;
    border-top: 1px solid #334155 !important;
    border-left: 1px solid #334155 !important;
}

.leaflet-popup-close-button {
    color: #64748b !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

.leaflet-popup-close-button:hover {
    color: #1e293b !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.dark .leaflet-popup-close-button {
    color: #94a3b8 !important;
}

.dark .leaflet-popup-close-button:hover {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Leaflet zoom control — Light mode */
.leaflet-control-zoom a {
    background-color: #ffffff !important;
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f1f5f9 !important;
}

.dark .leaflet-control-zoom a {
    background-color: #1e1e1e !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

.dark .leaflet-control-zoom a:hover {
    background-color: #334155 !important;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN ANALYTICS DASHBOARD
   ═══════════════════════════════════════════════════════════ */

@keyframes analyticsFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analytics-kpi {
    animation: analyticsFadeUp 0.4s ease-out both;
}

.analytics-kpi:nth-child(1) {
    animation-delay: 0.05s;
}

.analytics-kpi:nth-child(2) {
    animation-delay: 0.10s;
}

.analytics-kpi:nth-child(3) {
    animation-delay: 0.15s;
}

.analytics-kpi:nth-child(4) {
    animation-delay: 0.20s;
}

@media (min-width: 1024px) {
    .analytics-kpi {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .analytics-kpi:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.4);
    }
}

/* ═══════════════════════════════════════════════════════════
   CHECKOUT — OLA MAPS PLACE PICKER
   ═══════════════════════════════════════════════════════════ */

/* Mini map container */
#checkout-map-container {
    transition: opacity 0.5s ease, height 0.4s ease;
}

/* Pin marker reset */
.checkout-pin-marker {
    background: none !important;
    border: none !important;
}

/* Autocomplete suggestions */
#ola-suggestions {
    animation: fadeSlideIn 0.15s ease-out;
}

#ola-suggestions::-webkit-scrollbar {
    width: 4px;
}

#ola-suggestions::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.dark #ola-suggestions::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Suggestion item hover state */
.ola-sug-item {
    transition: background-color 0.15s ease;
}

/* Selected badge entrance */
#ola-selected-badge {
    animation: fadeSlideIn 0.2s ease-out;
}

/* ═══════════════════════════════════════════════════════════
   SHOP LIST — Filter Pill Tabs
   ═══════════════════════════════════════════════════════════ */

/* Filter pills container — dynamic sticky top based on actual header height */
#shop-filter-pills {
    /* Fallback top value — JS overrides this dynamically */
    top: 103px;
}

/* Pill base style */
.shop-filter-pill {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH BAR ROTATING BORDER
   ═══════════════════════════════════════════════════════════ */

@keyframes search-border-spin {
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.search-animated-border {
    position: relative;
    border-radius: 1rem; /* 16px */
    padding: 2px;
    overflow: hidden;
    background: transparent;
}

/* Base border fallback */
.search-animated-border::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 1rem;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}
.dark .search-animated-border::after {
    border-color: rgba(255, 255, 255, 0.06);
}
.search-animated-border:focus-within::after {
    opacity: 0;
}

.search-animated-border::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250%;
    height: 250%;
    background: conic-gradient(from 0deg, transparent 60%, rgba(16, 185, 129, 0.3) 80%, #00ff73 100%);
    transform: translate(-50%, -50%) rotate(0deg);
    animation: search-border-spin 4s linear infinite;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.search-animated-border:focus-within::before {
    opacity: 1;
    animation: search-border-spin 2s linear infinite;
}

.search-animated-border-inner {
    position: relative;
    border-radius: calc(1rem - 2px);
    z-index: 1;
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   VILLAGE SETTINGS PAGE — Shared form utilities
   ═══════════════════════════════════════════════════════════ */
.vs-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}
html.dark .vs-label {
    color: rgba(255, 255, 255, 0.7);
}
.vs-input {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}
html.dark .vs-input {
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
html.dark .vs-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.vs-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
html.dark .vs-input:focus {
    border-color: #00ff73;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 255, 115, 0.2);
}

/* ═══════════════════════════════════════════════════════════
   ONBOARDING PAYMENT PAGE
   ═══════════════════════════════════════════════════════════ */
.payment-root {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f172a 0%, #060b13 55%, #020d1a 100%);
    color: #fff;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}


/* Ambient glows — pure CSS, no arbitrary Tailwind */
.payment-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(120px);
}
.payment-glow-top {
    top: -15%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: rgba(25, 230, 101, 0.10);
}
.payment-glow-bottom {
    bottom: -10%;
    left: -5%;
    width: 700px;
    height: 700px;
    background: rgba(59, 130, 246, 0.08);
}

/* Header */
.payment-header-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem 0;
}
@media (min-width: 1024px) {
    .payment-header-wrap { padding: 2rem 2rem 0; }
}
.payment-progress-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.payment-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.payment-back-btn:hover { background: rgba(255,255,255,0.12); }
.payment-progress-bar {
    flex: 1;
    display: flex;
    gap: 0.375rem;
}
.payment-step {
    flex: 1;
    height: 6px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.10);
    transition: background 0.3s;
}
.payment-step.done    { background: #19e665; }
.payment-step.active  { box-shadow: 0 0 12px rgba(25, 230, 101, 0.5); }
.payment-step-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
    flex-shrink: 0;
}
.payment-hero {
    text-align: center;
    margin-bottom: 3rem;
}
.payment-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}
@media (min-width: 1024px) { .payment-hero h1 { font-size: 3rem; } }
.payment-hero p {
    font-size: 1rem;
    color: rgba(255,255,255,0.55);
    max-width: 600px;
    margin: 0 auto;
}

.payment-grid-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
}
@media (min-width: 1024px) { .payment-grid-wrap { padding: 0 2rem 2rem; } }

.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}
@media (min-width: 768px) {
    .plans-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.plans-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 0;
    color: rgba(255,255,255,0.45);
}

/* Error state */
.plans-error {
    text-align: center;
    padding: 3rem 0;
    color: rgba(255,255,255,0.5);
}
.plans-error .material-symbols-outlined { font-size: 2.5rem; color: #f87171; display: block; margin-bottom: 0.75rem; }
.plans-error button {
    margin-top: 1rem;
    padding: 0.625rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 700;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s;
}
.plans-error button:hover { background: rgba(255,255,255,0.08); }

.payment-secure-note {
    margin-top: 1.5rem;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.28);
}
.payment-secure-note .material-symbols-outlined { font-size: 1.25rem; }

/* ── Plan Cards ─────────────────────────────────────────── */
.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1c2438, #101524);
    border-radius: 2rem;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.plan-card:hover { transform: translateY(-4px); }

/* Color themes */
.plan-card.plan-green.plan-highlighted {
    border-color: rgba(25, 230, 101, 0.5);
    box-shadow: 0 0 40px rgba(25, 230, 101, 0.18);
}
.plan-card.plan-blue.plan-highlighted {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 40px rgba(96, 165, 250, 0.15);
}
.plan-card.plan-purple.plan-highlighted {
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 0 40px rgba(192, 132, 252, 0.15);
}
@media (min-width: 768px) {
    .plan-card.plan-highlighted { transform: translateY(-1rem); position: relative; z-index: 10; }
    .plan-card.plan-highlighted:hover { transform: translateY(-1.3rem); }
}

.plan-badge {
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #19e665;
    color: #000;
    font-size: 0.6875rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.35rem 1.25rem;
    border-radius: 9999px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(25, 230, 101, 0.4);
}
.plan-card.plan-blue  .plan-badge { background: #60a5fa; box-shadow: 0 4px 12px rgba(96,165,250,0.4); }
.plan-card.plan-purple .plan-badge { background: #c084fc; box-shadow: 0 4px 12px rgba(192,132,252,0.4); }

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.25rem;
}
.plan-tagline {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.45);
    margin: 0 0 1.5rem;
}
.plan-price-row {
    margin-bottom: 2rem;
}
.plan-price {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
}
.plan-cycle {
    font-size: 1rem;
    color: rgba(255,255,255,0.45);
    margin-left: 0.25rem;
}

/* CTA Button */
.plan-cta-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 1rem;
    font-size: 1.125rem;
    font-weight: 800;
    border: 2px solid #19e665;
    color: #19e665;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.plan-cta-btn:hover { background: #19e665; color: #000; }
.plan-cta-btn:active { transform: scale(0.97); }

/* Highlighted card gets filled button */
.plan-card.plan-highlighted .plan-cta-btn {
    background: #19e665;
    color: #000;
    box-shadow: 0 6px 20px rgba(25, 230, 101, 0.4);
}
.plan-card.plan-highlighted .plan-cta-btn:hover { background: #15c556; }
.plan-card.plan-blue .plan-cta-btn { border-color: #60a5fa; color: #60a5fa; }
.plan-card.plan-blue .plan-cta-btn:hover { background: #60a5fa; color: #000; }
.plan-card.plan-blue.plan-highlighted .plan-cta-btn { background: #60a5fa; color: #000; }
.plan-card.plan-purple .plan-cta-btn { border-color: #c084fc; color: #c084fc; }
.plan-card.plan-purple .plan-cta-btn:hover { background: #c084fc; color: #000; }

/* Features list */
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.plan-feature {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
}
.plan-feature.included { color: rgba(255,255,255,0.80); }
.plan-feature.excluded { color: rgba(255,255,255,0.28); text-decoration: line-through; }
.plan-feature .material-symbols-outlined { font-size: 1.125rem; flex-shrink: 0; }
.plan-feature.included .material-symbols-outlined { color: #19e665; }
.plan-card.plan-blue .plan-feature.included .material-symbols-outlined { color: #60a5fa; }
.plan-card.plan-purple .plan-feature.included .material-symbols-outlined { color: #c084fc; }
.plan-feature.excluded .material-symbols-outlined { color: rgba(255,255,255,0.20); }

/* Skeleton */
.plan-skeleton {
    background: linear-gradient(135deg, #1c2438, #101524);
    border-radius: 2rem;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
    animation: pulse 1.5s ease-in-out infinite;
}
.plan-skel-title  { height: 1.25rem; width: 60%; background: rgba(255,255,255,0.08); border-radius: 0.5rem; margin-bottom: 0.75rem; }
.plan-skel-sub    { height: 0.75rem; width: 45%; background: rgba(255,255,255,0.05); border-radius: 0.5rem; margin-bottom: 2rem; }
.plan-skel-price  { height: 3rem;   width: 50%; background: rgba(255,255,255,0.08); border-radius: 0.5rem; margin-bottom: 1.5rem; }
.plan-skel-btn    { height: 2.75rem; width: 100%; background: rgba(255,255,255,0.06); border-radius: 1rem; margin-bottom: 2rem; }
.plan-skel-feat   { height: 0.75rem; width: 100%; background: rgba(255,255,255,0.05); border-radius: 0.5rem; margin-bottom: 0.75rem; }

/* Payment overlay */
.payment-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 13, 26, 0.92);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
.payment-overlay.hidden { display: none; }
.payment-overlay-icon-wrap {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(25,230,101,0.15);
    border: 1px solid rgba(25,230,101,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.payment-overlay-icon-wrap .material-symbols-outlined {
    color: #19e665;
    font-size: 2rem;
    animation: spin 1s linear infinite;
}
.payment-success-icon { color: #19e665; font-size: 2rem; animation: none !important; }
.payment-overlay-msg  { color: #fff; font-weight: 700; font-size: 1.125rem; }
.payment-overlay-sub  { color: rgba(255,255,255,0.45); font-size: 0.875rem; }
@keyframes spin { to { transform: rotate(360deg); } }