/* ===== CARON colours ===== */
:root {
    --navy: #1B2A4A;
    --navy-dark: #141F38;
    --gold: #E9B649;
    --cream: #F5EFE6;
    --page: #F6F4F0;
    --white: #FFFFFF;
    --border: #E5E1D8;
    --tab-bg: #EEECE7;
    --muted: #6B7280;
    --radius: 18px;
}

/* ===== Base ===== */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--page);
    color: var(--navy);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }   /* pushes the footer to the bottom on short pages */

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.15; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.gold { color: var(--gold); }
.muted-light { color: rgba(245, 239, 230, 0.7); }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-block { display: block; width: 100%; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #F0C463; }
.btn-outline-light { background: transparent; color: var(--cream); border-color: rgba(245, 239, 230, 0.35); }
.btn-outline-light:hover { border-color: var(--cream); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--navy); }

/* ===== Header ===== */
.site-header { background: var(--navy); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--cream); }
.brand-icon {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 1.5px solid var(--gold);
    border-radius: 12px;
    color: var(--gold);
}
.brand-name { font-size: 24px; font-weight: 700; letter-spacing: 1px; color: var(--cream); }

.menu-toggle { background: none; border: 0; color: var(--gold); font-size: 30px; cursor: pointer; }

/* Mobile menu: hidden until ☰ is tapped */
.main-nav {
    display: none;
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 14px;
    padding: 20px 16px;
    background: var(--navy);
    z-index: 10;
}
.main-nav.open { display: flex; }
.main-nav a { color: var(--cream); }

/* ===== Hero ===== */
.hero {
    background: radial-gradient(circle at 75% 30%, #2A3B5E 0%, var(--navy) 45%, var(--navy-dark) 100%);
    color: var(--cream);
    padding: 48px 0 40px;
}
.eyebrow {
    display: flex; align-items: center; gap: 14px;
    margin: 0 0 24px;
    color: var(--gold);
    font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 48px; height: 1px; background: var(--gold); }

.hero h1 { font-size: 44px; }
.hero-sub { font-size: 26px; font-weight: 600; margin: 0 0 16px; }
.hero-text { color: rgba(245, 239, 230, 0.85); font-size: 18px; margin: 0 0 28px; }
.hero-buttons { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }

/* ===== Search card ===== */
.search-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.tabs { display: flex; background: var(--tab-bg); border-radius: 999px; padding: 6px; margin-bottom: 14px; }
.tab {
    flex: 1; padding: 10px 6px;
    border: 0; border-radius: 999px;
    background: none; color: var(--muted);
    font-size: 15px; cursor: pointer;
}
.tab.active { background: var(--navy); color: var(--white); }

.search-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.search-fields select,
input, select, textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--navy);
    font-size: 16px;
}
textarea { border-radius: 14px; }

/* ===== Sections and cards ===== */
.section { padding: 48px 0; }
.card-grid { display: grid; gap: 16px; }
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.card p { color: var(--muted); margin: 0; }

/* ===== Footer ===== */
.site-footer { background: var(--navy-dark); color: var(--cream); padding: 36px 0 20px; }
.footer-row { display: grid; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a:hover { color: var(--gold); }
.copyright { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 14px; color: rgba(245, 239, 230, 0.6); }

/* ===== Forms ===== */
.form-card { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.form-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form-card label.checkbox { flex-direction: row; align-items: center; font-weight: 400; }
.form-card label.checkbox input { width: auto; }
.form-note { text-align: center; color: var(--muted); margin: 0; }
.form-note a { color: var(--navy); font-weight: 600; text-decoration: underline; }
.error { color: #B42318; font-size: 14px; margin: -8px 0 0; }
.alert-success { background: #E7F6EC; color: #1E6B3A; border-radius: 12px; padding: 12px 16px; margin: 16px 0 0; }
.nav-user { color: var(--gold); }
.form-row { display: flex; justify-content: space-between; align-items: center; }
.link { font-size: 14px; text-decoration: underline; }

/* ===== Admin ===== */
.admin-wrap { padding-top: 24px; padding-bottom: 48px; }
.admin-menu { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; }
.admin-menu a { padding: 8px 16px; border-radius: 999px; background: var(--white); border: 1px solid var(--border); white-space: nowrap; font-size: 14px; }
.admin-menu a.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.page-head h2 { margin: 0; }
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; max-width: 420px; }
.form-card.left { margin: 0; }
.toolbar.wide { max-width: 720px; flex-wrap: wrap; }
.toolbar.wide input, .toolbar.wide select { flex: 1; min-width: 140px; }
.tabs-inline { max-width: 480px; }
.tabs-inline .tab { text-align: center; }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; background: var(--page); color: var(--muted); font-weight: 600; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 14px; justify-content: flex-end; }
.actions a, .link-btn { color: var(--navy); font-weight: 600; text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 0; font-size: 14px; cursor: pointer; }

.badge { display: inline-block; white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: #E7F6EC; color: #1E6B3A; }
.badge-grey { background: var(--tab-bg); color: var(--muted); }
.badge-red { background: #FDECEC; color: #B42318; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 12px; font-weight: 700; text-align: center; }
.tab-pills { flex-direction: row !important; flex-wrap: wrap; margin-bottom: 16px !important; }
.tab-pills a { border-radius: 999px !important; }
.details { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; font-size: 14px; }
.details dt { color: var(--muted); }
.details dd { margin: 0 0 8px; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.stat-number { font-size: 30px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 14px; }
.pagination { display: flex; gap: 16px; align-items: center; font-size: 14px; color: var(--muted); }
.pagination a { color: var(--navy); font-weight: 600; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); vertical-align: middle; margin-right: 6px; }
.color-input { height: 48px; padding: 4px; cursor: pointer; }

/* ===== Sell form / My Listings ===== */
.narrow { max-width: 760px; }
.left-note { text-align: left; }
.sell-form { display: flex; flex-direction: column; gap: 16px; }
.form-section { display: flex; flex-direction: column; gap: 12px; }
.form-section h3 { margin: 0; }
.form-section label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form-section label.checkbox { flex-direction: row; align-items: center; font-weight: 400; }
.form-section label.checkbox input { width: auto; }
.field-grid { display: grid; gap: 12px; }
.alert-error { background: #FDECEC; color: #B42318; border-radius: 12px; padding: 12px 16px; }
.listing-row { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.listing-row h3 { margin: 0 0 4px; }
.listing-row-actions { display: flex; gap: 12px; align-items: center; }

/* ===== Photos & video ===== */
.media-section .page-head { margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-item { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--tab-bg); }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-caption { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.media-remove { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.upload-btn { align-self: flex-start; }
.upload-row { display: grid; grid-template-columns: 1fr; gap: 4px; font-size: 13px; padding: 8px 0; border-top: 1px solid var(--border); }
.upload-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--tab-bg); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.upload-row.failed .upload-status { color: #B42318; }
.upload-row .link-btn { justify-self: start; }

/* ===== Documents & submit ===== */
.doc-row { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.doc-actions { display: flex; gap: 14px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li::before { margin-right: 8px; font-weight: 700; }
.checklist li.missing::before { content: "✕"; color: #B42318; }
.checklist li.done::before { content: "✓"; color: #1E6B3A; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ===== Car search ===== */
.search-layout { display: grid; gap: 20px; }
.filters summary { cursor: pointer; list-style: none; }
.filters summary h3 { margin: 0; display: inline; }
.filters summary::after { content: " ▾"; color: var(--muted); }
.filters[open] summary { margin-bottom: 14px; }
.filter-form { display: flex; flex-direction: column; gap: 12px; }
.filter-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.results-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.results-head h2 { margin: 0; font-size: 22px; }
.results-head select { width: auto; }
.muted { color: var(--muted); font-weight: 400; font-size: 16px; }

.car-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.car-card { display: block; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s; }
.car-card:hover { box-shadow: 0 8px 24px rgba(27, 42, 74, .12); }
.car-photo { position: relative; aspect-ratio: 4 / 3; background: var(--tab-bg); }
.car-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-seller { position: absolute; left: 10px; top: 10px; background: var(--navy); color: var(--cream); font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.car-body { padding: 14px 16px 16px; }
.car-body h3 { font-size: 17px; margin: 0 0 6px; }
.car-specs, .car-location { color: var(--muted); font-size: 14px; margin: 0; }
.car-price { font-size: 20px; font-weight: 700; margin: 8px 0 4px; }

/* ===== Car detail ===== */
.car-detail { display: grid; gap: 20px; }
.main-photo { border-radius: var(--radius); overflow: hidden; }
.gallery { margin-top: 10px; }
.price-card { align-self: start; }
.car-title { font-size: 24px; margin: 0; }
.car-price.big { font-size: 28px; margin: 4px 0; }
.full-details h3 { margin-top: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { padding: 6px 12px; font-size: 13px; width: 140px; }
.table td.changed { background: #FFF6DD; font-weight: 700; }
.spec-section { border-top: 1px solid var(--border); padding: 10px 0; }
.spec-section summary { cursor: pointer; font-weight: 600; }
.spec-section .details { margin-top: 10px; }
.price-input { width: 120px; padding: 8px 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.secret-code { font-size: 36px; font-weight: 700; letter-spacing: 8px; margin: 0; color: var(--navy); }
.secret-box { border: 2px solid var(--gold); }
.camera { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 3 / 4; object-fit: cover; }
.notice { margin-bottom: 10px; }
.notice.unread { border-left: 4px solid var(--gold); }
.notice p { margin: 6px 0; }
.bell { position: relative; }
.otp-input { font-size: 24px; letter-spacing: 8px; text-align: center; }
.form-card-inner { display: flex; flex-direction: column; gap: 12px; }
.form-card-inner label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }

/* ===== Tablet and desktop ===== */
@media (min-width: 768px) {
    .menu-toggle { display: none; }
    .main-nav { display: flex; position: static; flex-direction: row; align-items: center; gap: 24px; padding: 0; }

    .hero { padding: 80px 0 64px; }
    .hero h1 { font-size: 64px; }
    .hero-buttons { flex-direction: row; }

    .search-card { max-width: 820px; padding: 20px; }
    .search-fields { grid-template-columns: 1fr 1fr 1fr; }

    .card-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-row { grid-template-columns: 2fr 1fr 1fr; }

    .admin-wrap { display: grid; grid-template-columns: 200px 1fr; gap: 28px; }
    .admin-menu { flex-direction: column; margin: 0; }
    .admin-menu a { border-radius: 12px; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .field-grid { grid-template-columns: 1fr 1fr; }
    .media-grid { grid-template-columns: repeat(5, 1fr); }
    .doc-row { flex-direction: row; justify-content: space-between; align-items: center; }
    .details { grid-template-columns: 220px 1fr; }
    .search-layout { grid-template-columns: 280px 1fr; align-items: start; }
    .car-grid { grid-template-columns: repeat(2, 1fr); }
    .car-grid.three { grid-template-columns: repeat(3, 1fr); }
    .car-detail { grid-template-columns: 1.6fr 1fr; }
    .full-details { grid-column: 1 / -1; }
    .details dd { margin: 0; }
    .listing-row { flex-direction: row; justify-content: space-between; align-items: center; }
}
