:root {
    /* 60% — clean white background, maximum photo clarity */
    --bg: #ffffff;
    --bg-soft: #f1f5f9; /* secondary surface — table headers, hover states, etc. */
    --card: #ffffff;
    /* 30% — deep navy structure: navigation, footers, text hierarchy, trust/authority */
    --ink: #1e293b;
    --slate: #475569;
    --muted: #6b7280;
    --border: #e5e7eb;
    /* 10% — vibrant orange accent, reserved exclusively for high-conversion
       buy/sell/pay CTAs + active badges */
    --accent: #ff6b00;
    --accent-dark: #cc5600;
    /* functional status colors — not part of the brand accent budget */
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    line-height: 1.1;
    white-space: nowrap;
}
.brand-mark { font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.brand-mark span { color: var(--slate); }
/* Cameroon flag colors, used only for the "237" digits in the logo */
.brand-mark .digit-2 { color: #007a33; }
.brand-mark .digit-3 { color: #ce1126; }
.brand-mark .digit-7 { color: #fcd116; }
.brand:hover { text-decoration: none; }
.brand-slogan {
    font-size: 0.7rem;
    font-weight: 600;
    font-style: italic;
    color: var(--slate);
    white-space: nowrap;
}
.footer-slogan { font-weight: 700; margin-bottom: 4px; }
.footer-legal { color: var(--muted); font-size: 0.8rem; margin-top: 8px; }

.header-search {
    display: flex;
    flex: 1 1 240px;
    min-width: 160px;
}
.header-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 0.95rem;
}
.header-search button {
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    padding: 0 14px;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1.2rem;
    padding: 4px 10px;
    cursor: pointer;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}
.site-nav a { color: var(--slate); font-weight: 500; }
.site-nav a:hover { color: var(--ink); }

.inline-form { display: inline; margin: 0; }
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--slate);
    cursor: pointer;
    text-decoration: none;
}
.link-button:hover { text-decoration: underline; }

.category-bar {
    background: var(--ink);
    overflow-x: auto;
}
.category-bar-inner {
    display: flex;
    gap: 18px;
    padding: 8px 16px;
    white-space: nowrap;
}
.category-bar-inner a {
    color: #cbd5e1;
    font-size: 0.85rem;
}
.category-bar-inner a:hover { color: #fff; }

/* Buttons — .btn is the neutral/structure button; .btn-accent is reserved
   exclusively for buy/sell/pay actions (place bid, mark as sold, pay
   commission) and never used for navigation, auth or generic saves. */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn:hover { background: #0f172a; text-decoration: none; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-outline:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-google {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}
.btn-google:hover { background: var(--bg-soft); text-decoration: none; }
.google-icon { width: 18px; height: 18px; flex-shrink: 0; }

.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin: 16px 0;
}
.or-divider::before, .or-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.or-divider span { padding: 0 10px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 16px 0; }
.message {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.message-success { background: #e3f8ea; color: #0b6b35; }
.message-error { background: #fdeaec; color: var(--danger); }
.message-warning { background: #fff6e0; color: #8a6400; }
.message-info { background: #eaf2ff; color: #24518c; }

.page { padding: 24px 16px 48px; min-height: 60vh; }

/* Cards / grid */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin: 20px 0;
}

.listing-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.listing-card:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.listing-card .thumb {
    aspect-ratio: 4 / 3;
    background: #eef1ee center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.8rem;
}
.listing-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-card .body { padding: 12px; color: var(--ink); }
.listing-card .title { font-weight: 600; margin: 0 0 4px; }
.listing-card .price { color: var(--ink); font-weight: 700; }
.listing-card .meta { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

/* .badge (base) is the "active/live" style — reserved accent color.
   Type/status chips (auction, sold) are neutral structure colors. */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--ink);
}
.badge-auction { background: var(--bg-soft); color: var(--slate); }
.badge-sold { background: var(--border); color: var(--muted); }

/* Forms */
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 560px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.form-control, input[type=text], input[type=number], input[type=password], input[type=email], textarea, select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}
.form-control:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
}
.form-check-input { width: auto; }
.help-text { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.field-errors { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.filter-bar select { width: auto; }

/* "?" info tooltip — e.g. explaining what3words next to a field label */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border);
    color: var(--slate);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    position: relative;
    vertical-align: middle;
}
.info-tip-bubble {
    display: none;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    background: var(--ink);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 6px;
    z-index: 20;
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus .info-tip-bubble { display: block; }
.meetup-spot { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }

/* Detail page */
.listing-detail { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; }
.listing-images .main-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #eef1ee;
    border-radius: var(--radius);
    overflow: hidden;
}
.listing-images .main-image img { width: 100%; height: 100%; object-fit: cover; }
.thumb-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumb-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

.price-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.price-box .amount { font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.countdown { font-weight: 600; color: var(--danger); }

.bid-list { list-style: none; padding: 0; margin: 12px 0; }
.bid-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

.dashboard-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.dashboard-tabs a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); }

table.simple-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.simple-table th, table.simple-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
table.simple-table th { background: var(--bg-soft); }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }

.hero {
    background: linear-gradient(120deg, #0f172a, var(--ink));
    color: #fff;
    border-radius: var(--radius);
    padding: 36px 24px;
    margin-bottom: 28px;
}
.hero h1 { margin: 0 0 8px; font-size: 1.8rem; }
.hero p { margin: 0 0 16px; opacity: 0.9; }
.hero .btn:not(.btn-accent) { background: #fff; border-color: #fff; color: var(--ink); }
.hero .btn:not(.btn-accent):hover { background: #e5e7eb; }

.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 4px; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: 0.85rem; margin-top: 40px; }

/* Verification status (profile page) */
.verification-status {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.verification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.verification-item:last-child { border-bottom: none; }
.verification-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* Phone OTP input */
.otp-input {
    font-size: 1.4rem;
    letter-spacing: 0.4em;
    text-align: center;
    max-width: 220px;
}

/* Messaging / negotiation */
.conversation-list { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 8px; }
.conversation-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.conversation-row.unread { border-color: var(--ink); }
.conversation-row a {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    color: var(--ink);
}
.conversation-listing { font-weight: 700; }
.conversation-with { color: var(--muted); font-size: 0.85rem; }
.conversation-preview { color: var(--slate); font-size: 0.85rem; flex: 1 1 auto; }

.message-thread { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.message-bubble {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    max-width: 80%;
    align-self: flex-start;
}
.message-bubble.mine { align-self: flex-end; background: var(--bg-soft); }
.message-bubble p { margin: 4px 0; }
.message-sender { font-weight: 700; font-size: 0.8rem; color: var(--slate); }
.message-offer { display: inline-block; margin-left: 8px; font-size: 0.75rem; font-weight: 700; color: var(--ink); background: var(--border); border-radius: 999px; padding: 1px 8px; }
.message-time { color: var(--muted); font-size: 0.7rem; }

@media (max-width: 760px) {
    .nav-toggle { display: inline-block; order: 3; }
    .header-search { order: 4; flex-basis: 100%; }
    .site-nav {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-top: 10px;
    }
    .site-nav.open { display: flex; }
    .listing-detail { grid-template-columns: 1fr; }
    .message-bubble { max-width: 100%; }
}

.btn-small { padding: 4px 10px; font-size: 0.85rem; width: auto; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; }
.listing-group-heading { grid-column: 1 / -1; margin: 12px 0 0; font-size: 1.05rem; }
.location-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.policy-warning { border: 2px solid #b3261e; background: #fdecea; color: #5c1410; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.policy-warning h2 { margin: 0 0 8px; color: #b3261e; font-size: 1.15rem; }
.policy-warning ul { margin: 8px 0 8px 20px; }
.policy-accept label { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.policy-accept input { width: auto; margin-top: 4px; }
