/* ===========================================================================
   RepoCars Auction — Classic American Auction-House Design System
   Modeled after Maple Brothers / Redline-style sites:
   light theme · brick-red brand · orange CTA · Bebas Neue + Poppins.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
    /* Brand */
    --brand:        #b4211a;     /* primary brick red */
    --brand-dark:   #871914;     /* hover/active red */
    --brand-soft:   rgba(180, 33, 26, 0.08);

    /* Call-to-action accent */
    --cta:          #ff8400;
    --cta-dark:     #d96f00;
    --cta-soft:     rgba(255, 132, 0, 0.10);

    /* Surfaces */
    --bg:           #fafafa;     /* body background */
    --bg-soft:      #f3f3f3;     /* alt section bg */
    --surface:      #ffffff;     /* card bg */
    --hero-dark:    #0d0d0d;     /* hero/header dark */
    --hero-overlay: rgba(0, 0, 0, 0.55);

    /* Text */
    --ink:          #2a2a2a;
    --ink-soft:     #555555;
    --ink-mute:     #777777;
    --ink-faint:    #999999;
    --on-dark:      #ffffff;
    --on-dark-soft: #d0d0d0;

    /* Lines */
    --border:       #dddddd;
    --border-soft:  #eeeeee;
    --border-dark:  #2a2a2a;

    /* Semantic */
    --live:         #b4211a;
    --won:          #2e7d32;
    --info:         #1565c0;

    /* Type */
    --font-display: 'Bebas Neue', 'Oswald', Helvetica, Arial, sans-serif;
    --font-body:    'Poppins', Helvetica, Arial, sans-serif;

    /* Rhythm */
    --radius-sm:    2px;
    --radius:       4px;
    --radius-lg:    6px;

    --shadow-card:  0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);

    --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Base ──────────────────────────────────────────────────────────────── */

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box; }

html { background: var(--bg); }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
    text-rendering: optimizeLegibility;
}

/* Headings — Bebas Neue / red brand */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3 {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--brand);
    letter-spacing: 0.01em;
    line-height: 1.05;
    margin: 0 0 0.5em;
}

h1, .h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); letter-spacing: 0.02em; }
h2, .h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3, .h3 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.125rem; color: var(--ink); }

/* Display variants for huge hero/CTA headlines */
.display-hero {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: 0.01em;
    color: var(--on-dark);
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.display-xl {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: 0.015em;
}

p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; transition: color 180ms; }
a:hover { color: var(--brand-dark); }

/* Eyebrow — small caps tracker */
.eyebrow {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--brand);
}

/* Numeric / tabular */
.numeric { font-feature-settings: "tnum"; }

/* Hairline */
.hairline { height: 2px; background: var(--brand); width: 60px; margin: 1.25rem 0; }
.hairline-full { height: 1px; background: var(--border); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 2rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 200ms var(--ease-out), transform 150ms var(--ease-out), box-shadow 200ms var(--ease-out);
    line-height: 1;
}

.btn-primary {
    background: var(--brand);
    color: var(--on-dark);
}
.btn-primary:hover { background: var(--brand-dark); color: var(--on-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(180, 33, 26, 0.35); }

.btn-brand {
    background: var(--brand);
    color: var(--on-dark);
}
.btn-brand:hover { background: var(--brand-dark); color: var(--on-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(180, 33, 26, 0.35); }

.btn-orange {
    background: var(--cta);
    color: var(--on-dark);
}
.btn-orange:hover { background: var(--cta-dark); color: var(--on-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 132, 0, 0.35); }

.btn-ghost {
    background: transparent;
    color: var(--brand);
    border: 2px solid var(--brand);
    padding: calc(0.95rem - 2px) calc(2rem - 2px);
}
.btn-ghost:hover { background: var(--brand); color: var(--on-dark); }

.btn-ghost-light {
    background: transparent;
    color: var(--on-dark);
    border: 2px solid var(--on-dark);
    padding: calc(0.95rem - 2px) calc(2rem - 2px);
}
.btn-ghost-light:hover { background: var(--on-dark); color: var(--ink); }

.btn-sm { padding: 0.6rem 1.4rem; font-size: 0.95rem; }

/* ── Forms ─────────────────────────────────────────────────────────────── */

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="datetime-local"],
input[type="date"], input[type="search"],
select, textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 180ms, box-shadow 180ms;
    line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
label { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; color: var(--ink); display: block; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-required::after { content: ' *'; color: var(--brand); }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: box-shadow 250ms var(--ease-out), transform 250ms var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

/* Vehicle/auction card */
.vehicle-card {
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 250ms var(--ease-out);
    text-decoration: none;
    color: inherit;
    display: block;
}
.vehicle-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: var(--brand);
    color: inherit;
}
.vehicle-card .image-wrap {
    aspect-ratio: 4 / 3;
    background: #1a1a1a;
    overflow: hidden;
    position: relative;
}
.vehicle-card .image-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 600ms var(--ease-out);
}
.vehicle-card:hover .image-wrap img { transform: scale(1.05); }
.vehicle-card .body { padding: 1.25rem 1.5rem 1.5rem; }
.vehicle-card .title {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 1.5rem;
    color: var(--ink);
    line-height: 1.1;
    margin: 0.4rem 0;
}
.vehicle-card:hover .title { color: var(--brand); }

/* Pills/badges */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}
.pill-live    { background: var(--brand); color: var(--on-dark); }
.pill-soon    { background: var(--cta); color: var(--on-dark); }
.pill-closed  { background: #757575; color: var(--on-dark); }
.pill-outline { background: transparent; color: var(--ink); border: 1px solid var(--border); }

/* Live ribbon (top-right) */
.ribbon-live {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--brand);
    color: var(--on-dark);
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(180, 33, 26, 0.35);
}

/* Live pulse dot */
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(180, 33, 26, 0.55); }
    50%      { box-shadow: 0 0 0 8px rgba(180, 33, 26, 0); }
}
.live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand);
    animation: live-pulse 1.5s ease-in-out infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ── Hero (dark photo bg) ──────────────────────────────────────────────── */

.hero {
    background: var(--hero-dark);
    color: var(--on-dark);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.85) 100%),
                radial-gradient(ellipse at 70% 20%, rgba(180,33,26,0.18) 0%, transparent 60%);
    z-index: 1;
}
.hero > * { position: relative; z-index: 2; }
.hero h1, .hero .h1 { color: var(--on-dark); }

/* ── Section spacing ───────────────────────────────────────────────────── */

.section { padding: clamp(3.5rem, 6vw, 6rem) 0; }
.section-alt { background: var(--bg-soft); }

/* ── Top utility / contact bar ─────────────────────────────────────────── */

.utility-bar {
    background: var(--brand);
    color: var(--on-dark);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}
.utility-bar a { color: var(--on-dark); }
.utility-bar a:hover { color: #ffd6a3; }

/* ── Header / nav ──────────────────────────────────────────────────────── */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .nav-link {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0.6rem 1.1rem;
    transition: color 180ms;
    text-decoration: none;
    position: relative;
}
.site-header .nav-link:hover { color: var(--brand); }
.site-header .nav-link.active::after {
    content: '';
    position: absolute;
    left: 1.1rem; right: 1.1rem; bottom: 0;
    height: 3px;
    background: var(--brand);
}

/* Wordmark */
.wordmark {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.04em;
    color: var(--ink);
    text-decoration: none;
    line-height: 1;
}
.wordmark .accent { color: var(--brand); }

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer {
    background: var(--surface);
    color: var(--ink-soft);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    border-top: 4px solid var(--brand);
}
.site-footer h4 {
    font-family: var(--font-display);
    color: var(--brand);
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.site-footer a { color: var(--ink-soft); transition: color 180ms; }
.site-footer a:hover { color: var(--brand); }
.footer-legal {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
    font-size: 0.8rem;
    color: var(--ink-mute);
}

/* ── Spec list (vehicle details) ───────────────────────────────────────── */

.spec-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-soft);
}
.spec-row:last-child { border-bottom: none; }
.spec-row dt {
    font-family: var(--font-display);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-mute);
}
.spec-row dd { margin: 0; color: var(--ink); font-weight: 500; }

/* ── Tables (admin) ────────────────────────────────────────────────────── */

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    background: var(--bg-soft);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--brand);
}
.admin-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-soft); color: var(--ink-soft); }
.admin-table tr:hover td { background: var(--bg-soft); }

/* ── Prose for legal/about ─────────────────────────────────────────────── */

.prose {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--ink-soft);
    max-width: 70ch;
}
.prose h2 { color: var(--brand); margin: 3rem 0 1rem; font-size: 2rem; }
.prose h3 { color: var(--ink); margin: 2rem 0 0.75rem; font-size: 1.5rem; }
.prose p { margin: 1.1rem 0; }
.prose ul, .prose ol { margin: 1rem 0 1rem 1.5rem; }
.prose ul li { list-style: none; position: relative; padding-left: 1.5rem; margin: 0.4rem 0; }
.prose ul li::before { content: '▸'; position: absolute; left: 0; color: var(--brand); font-weight: bold; }
.prose ol { padding-left: 1rem; }
.prose ol li { margin: 0.4rem 0; }
.prose a { color: var(--brand); border-bottom: 1px solid var(--brand-soft); }
.prose strong { color: var(--ink); }
.prose blockquote {
    border-left: 4px solid var(--brand);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--ink);
    font-size: 1.2rem;
}

/* ── Dashboard tabs (top nav inside dashboard) ────────────────────────── */

.dash-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.dash-tab {
    padding: 0.85rem 1.4rem;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: var(--surface);
    border-right: 1px solid var(--border);
    text-decoration: none;
    transition: all 180ms;
    flex: 1 1 auto;
    text-align: center;
    min-width: max-content;
}
.dash-tab:last-child { border-right: none; }
.dash-tab:hover { background: var(--bg-soft); color: var(--brand); }
.dash-tab.active { background: var(--brand); color: var(--on-dark); }
.dash-tab.active:hover { background: var(--brand-dark); color: var(--on-dark); }

/* Dashboard stat tiles */
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    transition: border-color 180ms, box-shadow 180ms;
}
.stat-tile:hover { border-color: var(--brand); box-shadow: var(--shadow-card); }
.stat-tile .label {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
    color: var(--ink-mute);
}
.stat-tile .value {
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 1;
    color: var(--brand);
    margin-top: 0.4rem;
}
.stat-tile.is-success .value { color: var(--won); }
.stat-tile.is-info .value    { color: var(--info); }

/* Status pills inside tables */
.status-live      { background: rgba(180,33,26,0.1); color: var(--brand); border: 1px solid rgba(180,33,26,0.25); }
.status-soon      { background: rgba(255,132,0,0.1); color: var(--cta); border: 1px solid rgba(255,132,0,0.25); }
.status-closed    { background: var(--bg-soft); color: var(--ink-mute); border: 1px solid var(--border); }
.status-success   { background: rgba(46,125,50,0.1); color: var(--won); border: 1px solid rgba(46,125,50,0.25); }

/* ── Stat block ────────────────────────────────────────────────────────── */

.stat-num {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1;
    color: var(--brand);
}

/* ── Page-load reveal ──────────────────────────────────────────────────── */

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.7s var(--ease-out) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.35s; }

/* ── Misc ──────────────────────────────────────────────────────────────── */

.countdown-urgent { color: var(--brand); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.5; } }

.lightbox-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.lightbox-overlay img { max-height: 90vh; max-width: 90vw; object-fit: contain; }

.spinner {
    border: 2px solid var(--brand-soft);
    border-top-color: var(--brand);
    border-radius: 50%;
    width: 22px; height: 22px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* Selection */
::selection { background: var(--brand); color: var(--on-dark); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
