@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&family=Inter:wght@400;600&display=swap');

:root {
    --bg: #000000;
    --bg-card: #161616;
    --border: #2c2c2c;
    --text: #f2f2f2;
    --text-dim: #9a9a9a;
    --accent: #e2231a;
    --ok: #4caf50;
    --bad: #e2231a;
    --warn: #f4a300;
}

* { box-sizing: border-box; }

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

h1, h2, h3 {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

a { color: var(--accent); }

.site-header {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    border-bottom: 3px solid var(--accent);
}

.site-header h1 {
    margin: 0 0 0.25rem;
    font-size: 2rem;
    font-weight: 700;
}

.site-header h1 span { color: var(--accent); }

.subtitle {
    color: var(--text-dim);
    margin: 0;
    font-size: 0.95rem;
}

.site-nav {
    text-align: center;
    padding: 0.75rem;
    font-size: 0.85rem;
}

.site-nav a {
    color: var(--text-dim);
    text-decoration: none;
    margin: 0 0.75rem;
}

.site-nav .btn-sell {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: 8px;
    text-decoration: none;
    margin: 0;
}
.site-nav .btn-sell:hover {
    opacity: 0.9;
}

.site-nav a:hover { color: var(--text); }

main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

main.narrow { max-width: 640px; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.card h2, .card h3 { margin-top: 0; }

.error-card { border-color: var(--accent); color: #ffb3ad; }
.success-card { border-color: var(--ok); color: #b6f2ba; }

.text-dim { color: var(--text-dim); margin: 0; }

/* --- Listing grid (public homepage) --- */

.listing-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.listing-card:hover { border-color: var(--accent); }

.listing-card .photo {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: #0a0a0a;
}

/* Full-size photo on the listing detail page - keep it inside the viewport on mobile */
.listing-grid img.photo {
    max-width: 100%;
    height: auto;
    display: block;
}

.listing-card .info { padding: 0.9rem 1rem 1.1rem; }

.listing-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
}

.listing-card .price {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0.3rem 0;
}

.listing-card .meta {
    color: var(--text-dim);
    font-size: 0.82rem;
}

.badge-checked {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--ok);
    border: 1px solid var(--ok);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 3rem 1rem;
}

/* --- Forms --- */

form .field { margin-bottom: 1.1rem; }

form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

form input[type="text"],
form input[type="number"],
form input[type="email"],
form input[type="tel"],
form input[type="password"],
form textarea,
form select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
}

form textarea { resize: vertical; min-height: 100px; }

form input:focus, form textarea:focus, form select:focus {
    outline: none;
    border-color: var(--accent);
}

form button, .btn {
    display: inline-block;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    text-transform: uppercase;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

form button:hover, .btn:hover { opacity: 0.9; }

.file-hint {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

/* --- Admin moderation queue --- */

.mod-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.mod-row:last-child { border-bottom: none; }

.mod-row img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #0a0a0a;
}

.mod-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.mod-actions .approve { background: var(--ok); }
.mod-actions .reject { background: var(--bad); }

.status-pill {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    margin-left: 0.5rem;
}

.status-pending_payment, .status-pending_review { background: rgba(244, 163, 0, 0.15); color: var(--warn); }
.status-approved { background: rgba(76, 175, 80, 0.15); color: var(--ok); }
.status-rejected { background: rgba(226, 35, 26, 0.15); color: var(--bad); }

footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    padding: 1.5rem 1rem 2.5rem;
}

/* Login gate (shared with admin panel) */
.login-main {
    max-width: 380px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 1rem;
}

.login-form { width: 100%; text-align: center; }
.login-form h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.login-form h1 span { color: var(--accent); }
.login-form .subtitle { margin-bottom: 1.5rem; }

.login-form input[type="password"] {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    margin-bottom: 1rem;
}

.login-form button {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    text-transform: uppercase;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.login-error {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: left;
}

@media (max-width: 480px) {
    .mod-row { flex-direction: column; }
    .mod-row img { width: 100%; height: 160px; }
}

/* --- Vehicle Data Global check display (listing.php) - same rules as dev.ecurmp.com/style.css --- */
.result-pass { color: var(--ok); font-weight: 600; }
.result-fail { color: var(--bad); font-weight: 600; }
.advisory-row td {
    border-bottom: 1px solid var(--border);
    padding-top: 0;
}
.advisory-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-dim);
}
.advisory-type {
    display: inline-block;
    min-width: 70px;
    color: var(--warn);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    margin-right: 0.5rem;
}
.advisory-dangerous .advisory-type { color: var(--bad); }
.valuation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}
.valuation-grid .label {
    display: block;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
}
.valuation-grid .value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0.25rem;
}
.vehicle-meta {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.specs-list {
    list-style: none;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.88rem;
    margin: 0.75rem 0 1.25rem;
    padding: 0;
}
.tax-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
.tax-grid > div {
    flex: 1 1 0;
    min-width: 120px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
}
.tax-grid .label {
    display: block;
    color: var(--text-dim);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tax-grid .value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0.35rem;
}
.history-check {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.history-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.history-row:last-child { border-bottom: none; }
.history-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.flag-ok .history-icon { color: var(--ok); background: rgba(76, 175, 80, 0.15); }
.flag-bad .history-icon { color: var(--bad); background: rgba(226, 35, 26, 0.15); }
.history-label {
    flex: 0 0 140px;
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.history-status { flex: 1; font-size: 0.95rem; }
.flag-bad .history-status { font-weight: 600; }
