/* =========================================================
   FPICONNECT — Design System
   Soft • Smooth • Mobile-first
   ========================================================= */

:root {
    --primary: #0EA5A0;
    --primary-dark: #0B7A76;
    --primary-light: #DFF6F4;
    --accent: #FFD166;
    --accent-light: #FFF6DC;
    --success: #2FAF66;
    --success-light: #E3F8EC;
    --warning: #FFB648;
    --warning-light: #FFF4E2;
    --info: #4CB2FF;
    --info-light: #E7F5FF;
    --ink: #0C3634;
    --ink-soft: #4F7371;
    --muted: #8FA9A7;
    --bg: #F2FBFA;
    --card: #FFFFFF;
    --border: #DCEEEC;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 2px 10px rgba(14, 165, 160, 0.10);
    --shadow: 0 10px 30px rgba(14, 165, 160, 0.15);
    --shadow-lg: 0 20px 45px rgba(12, 54, 52, 0.14);
    --nav-h: 64px;
    --bottom-nav-h: 68px;
    font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: 'Manrope', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--bottom-nav-h) + 12px);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.82rem; }
.center { text-align: center; }

/* ---------- Layout shells ---------- */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px;
}
.page {
    padding-top: 16px;
    animation: fadeUp .35s ease both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Top nav ---------- */
.topnav {
    position: sticky; top: 0; z-index: 40;
    background: rgba(247, 246, 252, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topnav-inner {
    max-width: 640px; margin: 0 auto;
    height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
}
.brand {
    font-weight: 800; font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    display: flex; align-items: center; gap: 6px;
}
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.topnav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--card); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}
.icon-btn:active { transform: scale(0.92); }

/* ---------- Bottom nav (mobile-first primary nav) ---------- */
.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: var(--bottom-nav-h);
    background: rgba(12,54,52,0.97);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; justify-content: space-around; align-items: center;
    max-width: 640px; margin: 0 auto;
    box-shadow: 0 -6px 20px rgba(0,0,0,0.25);
}
.bottomnav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 0.68rem; color: rgba(255,255,255,0.6); font-weight: 600;
    padding: 6px 10px; border-radius: 14px; transition: all .2s ease;
}
.bottomnav a.active { color: var(--accent); background: rgba(255,255,255,0.1); }
.bottomnav .nav-icon { font-size: 1.25rem; line-height: 1; }
.bottomnav .fab {
    margin-top: -30px;
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; box-shadow: 0 10px 24px rgba(14,165,160,0.45);
    border: 3px solid var(--bg);
}

@media (min-width: 720px) {
    .bottomnav { position: sticky; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; cursor: pointer;
    padding: 13px 20px; border-radius: 999px;
    font-weight: 600; font-size: 0.95rem;
    transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: 0 10px 22px rgba(14,165,160,0.35);
}
.btn-accent {
    background: linear-gradient(135deg, var(--accent), #F5A623);
    color: #4A3200; box-shadow: 0 10px 22px rgba(255,209,102,0.45);
}
.btn-soft { background: var(--primary-light); color: var(--primary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--primary-dark); padding: 8px 10px; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 14px;
}
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:active { transform: scale(0.985); }

/* ---------- Hero / quick actions ---------- */
.hero {
    background: linear-gradient(160deg, var(--primary) 0%, #2FC2B4 55%, var(--accent) 130%);
    color: #fff; border-radius: var(--radius-lg);
    padding: 28px 22px; margin-bottom: 18px;
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; right: -40px; top: -40px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
}
.hero h1 { font-size: 1.5rem; margin-bottom: 6px; }
.hero p { opacity: .92; margin-bottom: 16px; font-size: 0.92rem; }
.hero-search {
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px; padding: 12px 16px;
    display: flex; align-items: center; gap: 8px;
}
.hero-search input {
    background: transparent; border: none; outline: none; color: #fff;
    width: 100%; font-size: 0.92rem;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.8); }

.quick-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin: 16px 0 22px;
}
.quick-item {
    background: var(--card); border-radius: var(--radius); padding: 12px 6px;
    text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: transform .15s ease;
}
.quick-item:active { transform: scale(0.94); }
.quick-item .qi-icon {
    width: 42px; height: 42px; border-radius: 14px; margin: 0 auto 6px;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
    background: var(--primary-light);
}
.quick-item span.label { font-size: 0.68rem; font-weight: 600; color: var(--ink-soft); display:block; }

/* ---------- Section headers ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.section-head h2 { font-size: 1.05rem; }
.section-head a { font-size: 0.8rem; color: var(--primary-dark); font-weight: 600; }

/* ---------- Chips / filters ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--border);
    font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
    white-space: nowrap; transition: all .2s ease;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Listing cards ---------- */
.listing-card { display: flex; gap: 12px; }
.listing-thumb {
    width: 86px; height: 86px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
    background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-body { flex: 1; min-width: 0; }
.listing-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.listing-price { font-weight: 700; color: var(--primary-dark); font-size: 0.92rem; }
.tag-featured {
    display: inline-block; font-size: 0.65rem; font-weight: 700; color: #A9600C;
    background: var(--warning-light); padding: 2px 8px; border-radius: 999px; margin-bottom: 4px;
}

/* ---------- Feed post ---------- */
.post-card .post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--primary-light); }
.avatar-40 { width: 40px; height: 40px; }
.avatar-56 { width: 56px; height: 56px; }
.avatar-84 { width: 84px; height: 84px; }
.post-name { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-sub { font-size: 0.75rem; color: var(--muted); }
.post-card img.post-image { border-radius: var(--radius-sm); margin-top: 8px; }
.post-actions { display: flex; gap: 18px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.post-actions button {
    background: none; border: none; color: var(--ink-soft); font-weight: 600;
    font-size: 0.82rem; display: flex; align-items: center; gap: 5px; cursor: pointer;
}
.sponsored-tag { font-size: 0.68rem; background: var(--accent-light); color: #C4426A; padding: 2px 8px; border-radius: 999px; font-weight: 700; }

/* ---------- Badges ---------- */
.badge { font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-student { background: var(--success-light); color: #1D8F5E; }
.badge-vendor { background: var(--info-light); color: #1D74C4; }
.badge-property { background: var(--warning-light); color: #A9600C; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=search], input[type=date], select, textarea {
    width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--card);
    font-size: 0.95rem; color: var(--ink); outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light);
}
textarea { resize: vertical; min-height: 100px; }
.input-row { display: flex; gap: 10px; }
.input-row > * { flex: 1; }
.help-text { font-size: 0.75rem; color: var(--muted); margin-top: 5px; }
.radio-card-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-card {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    background: var(--card); color: var(--ink-soft);
}
.radio-card input { display: none; }
.radio-card.checked { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }

/* ---------- Alerts / flash ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 14px; font-weight: 500; }
.alert-error { background: #FFE9EC; color: #C22C43; }
.alert-success { background: var(--success-light); color: #1D8F5E; }
.alert-info { background: var(--info-light); color: #1D74C4; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .emoji { font-size: 2.4rem; margin-bottom: 10px; }

/* ---------- Pricing ---------- */
.plan-card { position: relative; border: 2px solid var(--border); }
.plan-card.highlight { border-color: var(--primary); }
.plan-card .plan-badge {
    position: absolute; top: -11px; right: 16px; background: var(--primary);
    color: #fff; font-size: 0.65rem; padding: 4px 10px; border-radius: 999px; font-weight: 700;
}
.plan-price { font-size: 1.6rem; font-weight: 800; color: var(--ink); margin: 6px 0; }
.plan-price span { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.perk-list li { display: flex; gap: 8px; font-size: 0.85rem; margin-bottom: 6px; align-items: flex-start; }
.perk-list li::before { content: "✓"; color: var(--success); font-weight: 800; }

/* ---------- Chat ---------- */
.chat-thread { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 90px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 0.88rem; }
.bubble-me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble-them { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble-time { font-size: 0.62rem; opacity: 0.7; margin-top: 3px; display: block; }
.chat-input-bar {
    position: fixed; bottom: var(--bottom-nav-h); left: 0; right: 0;
    max-width: 640px; margin: 0 auto;
    background: rgba(247,246,252,0.95); backdrop-filter: blur(10px);
    padding: 10px 16px; display: flex; gap: 8px; border-top: 1px solid var(--border);
}
.chat-input-bar input { flex: 1; }

/* ---------- Misc utility ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-8{margin-top:8px;} .mt-16{margin-top:16px;} .mb-0{margin-bottom:0;}
.text-center{text-align:center;}
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.skeleton { background: linear-gradient(90deg, var(--border) 25%, #F5F3FC 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.auth-wrap { max-width: 420px; margin: 40px auto; padding: 0 20px; }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .brand { font-size: 1.7rem; justify-content: center; }

.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 16px; }
.stat-box { background: var(--card); border-radius: var(--radius-sm); padding: 14px 8px; text-align: center; border: 1px solid var(--border); }
.stat-box .num { font-size: 1.2rem; font-weight: 800; color: var(--primary-dark); }
.stat-box .lbl { font-size: 0.65rem; color: var(--muted); font-weight: 600; }

/* =========================================================
   DESKTOP LAYOUT
   Mobile-first base above; everything below is additive and
   only activates at wider viewports. No separate templates —
   one codebase, two presentations.
   ========================================================= */

/* ---------- Desktop-only nav pieces (hidden by default on mobile) ---------- */
.topnav-search { display: none; }
.topnav-wallet { display: none; }
.topnav-signup { display: none; }

.app-shell { display: block; }
.sidebar { display: none; }

/* Reusable grid wrapper: stacked list on mobile, tiled grid on desktop. */
.listings-grid { display: block; }

@media (min-width: 900px) {
    body { padding-bottom: 28px; }

    /* ---- Top bar grows a real search field + extra actions ---- */
    .topnav-inner { max-width: 1180px; gap: 20px; }
    .topnav-search {
        display: flex; align-items: center; gap: 8px;
        flex: 1; max-width: 420px;
        background: var(--bg); border: 1.5px solid var(--border); border-radius: 999px;
        padding: 9px 16px;
    }
    .topnav-search input {
        border: none; outline: none; background: transparent; width: 100%;
        font-size: 0.88rem; color: var(--ink); font-family: inherit;
    }
    .topnav-wallet, .topnav-signup { display: inline-flex; }

    /* ---- App shell: fixed sidebar + centered content column ---- */
    .app-shell {
        display: flex; align-items: flex-start; gap: 28px;
        max-width: 1180px; margin: 0 auto; padding: 24px 24px 0;
    }
    .sidebar {
        display: flex; flex-direction: column; gap: 2px;
        width: 232px; flex-shrink: 0;
        position: sticky; top: 88px;
    }
    .sidebar a {
        display: flex; align-items: center; gap: 12px;
        padding: 11px 14px; border-radius: 14px;
        font-weight: 600; font-size: 0.9rem; color: var(--ink-soft);
        transition: background .15s ease, color .15s ease;
    }
    .sidebar a:hover { background: var(--bg); }
    .sidebar a.active { background: var(--primary-light); color: var(--primary-dark); }
    .sidebar .nav-icon { font-size: 1.15rem; width: 22px; text-align: center; }
    .sidebar-cta {
        display: block; text-align: center; margin-bottom: 14px;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        color: #fff !important; font-weight: 700; padding: 13px !important;
        border-radius: 999px; box-shadow: 0 10px 22px rgba(14,165,160,0.35);
    }
    .sidebar-divider { height: 1px; background: var(--border); margin: 10px 6px; }

    .container.page { max-width: 700px; margin: 0; padding: 0; flex: 1; min-width: 0; }

    /* Mobile-only chrome disappears */
    .bottomnav { display: none; }
    body { padding-bottom: 0; }

    /* ---- Denser grids where the page opts in ---- */
    .quick-grid { grid-template-columns: repeat(6, 1fr); }
    .listings-grid {
        display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 14px;
    }
    .listings-grid .card { margin-bottom: 0; }

    .hero { padding: 40px 40px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }

    .auth-wrap { margin: 60px auto; }
}

@media (min-width: 1180px) {
    .app-shell { padding-left: 0; padding-right: 0; }
}
