:root {
    /* Deep green anchors (used for the few elements that stay dark) */
    --navy: #123524;
    --navy-2: #1a4732;
    --navy-3: #225c40;
    --ink: #3c4a44;
    --heading: #233a32;
    --muted: #6e827a;
    --line: #e4ece8;
    --bg: #f2f7f5;
    --accent: #9bbeb4;            /* sage green */
    --accent-dark: #7fa99c;       /* deeper sage (hover) */
    --accent-ink: #1f3a30;        /* dark text/icon on sage buttons */
    --gold: #f59e0b;
    --green: #2f8f6b;             /* success / "sold" */
    --red: #dc2626;
    /* Light sage surfaces (formerly the dark navy areas) */
    --surface: #dfece7;
    --surface-2: #cce0d8;
    --surface-line: #b6d2c7;
    --green-ink: #2c4a3e;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(13, 27, 42, .06), 0 1px 3px rgba(13, 27, 42, .05);
    --shadow: 0 6px 24px rgba(13, 27, 42, .08);
    --shadow-lg: 0 18px 48px rgba(13, 27, 42, .16);
}

* { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; }

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Headings sit a shade deeper than body for a calm, premium hierarchy. */
h1, h2, h3, h4, h5, h6 { color: var(--heading); }
/* Keep headings on dark surfaces inheriting their light color. */
.hero :is(h1, h2, h3, h4, h5, h6),
.bid-current :is(h1, h2, h3, h4, h5, h6),
.app-footer :is(h1, h2, h3, h4, h5, h6) { color: inherit; }

a { text-decoration: none; }

.text-muted-2 { color: var(--muted) !important; }
.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }
.letter-tight { letter-spacing: -.02em; }

/* ---------- Navbar ---------- */
.navbar-brand-logo {
    display: inline-flex; align-items: center; gap: .55rem;
    font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; color: var(--green-ink);
}
.navbar-brand-logo .mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, #7fa99c, #5f8a7b);
    display: grid; place-items: center; color: #fff; font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(95, 138, 123, .4);
}
.app-navbar {
    background: var(--surface);
    box-shadow: 0 1px 0 var(--surface-line);
}
.app-navbar .nav-link { color: var(--ink); font-weight: 500; }
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { color: var(--green-ink); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 10px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--accent-ink); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1f2937; }
.btn-gold:hover { background: #d98a06; border-color: #d98a06; color: #1f2937; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); color: #fff; }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(1100px 480px at 80% -10%, rgba(22, 163, 74, .18), transparent 60%),
        linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 55%, #c2e6d0 100%);
    color: var(--ink); position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(20, 83, 45, .06) 1px, transparent 1px);
    background-size: 22px 22px; opacity: .6;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.hero .lead { color: var(--muted); }
.stat-pill {
    background: rgba(255, 255, 255, .55); border: 1px solid var(--surface-line);
    border-radius: 12px; padding: 1rem 1.25rem;
}
.stat-pill .num { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; color: var(--green-ink); }
.stat-pill .lbl { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Cards ---------- */
.section-title { font-weight: 800; letter-spacing: -.02em; }
.card-clean {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.auction-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
    height: 100%; display: flex; flex-direction: column;
}
.auction-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.auction-thumb {
    aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: #e9edf2;
    display: block;
}
.auction-thumb-ph {
    aspect-ratio: 16 / 10; width: 100%; display: grid; place-items: center;
    background: linear-gradient(135deg, #e9edf2, #dde3ea); color: #9aa6b2; font-size: 2.4rem;
}
.card-body-tight { padding: 1rem 1.1rem 1.15rem; }
.price-now { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; color: var(--navy); }

/* ---------- Badges ---------- */
.badge-soft { font-weight: 600; padding: .4em .7em; border-radius: 999px; font-size: .72rem; }
.badge-live { background: rgba(220, 38, 38, .12); color: var(--red); }
.badge-live .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--red);
    display: inline-block; margin-right: 5px; animation: pulse 1.4s infinite;
}
.badge-scheduled { background: rgba(13, 148, 136, .14); color: #0d9488; }
.badge-sold { background: rgba(22, 163, 74, .12); color: var(--green); }
.badge-ended { background: #eef1f4; color: var(--muted); }
.badge-spec { background: #f1f4f8; color: #475569; font-weight: 600; border-radius: 8px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 70% { box-shadow: 0 0 0 7px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }

/* ---------- Countdown ---------- */
.countdown { display: inline-flex; gap: .35rem; align-items: center; }
.countdown .seg {
    background: rgba(20, 83, 45, .07); border: 1px solid var(--surface-line);
    color: var(--green-ink); border-radius: 8px; padding: .3rem .45rem;
    font-weight: 700; font-size: .95rem; min-width: 38px; text-align: center; font-variant-numeric: tabular-nums;
}
.countdown .seg small { display: block; font-size: .54rem; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.countdown.ending .seg { background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .2); color: var(--red); }

/* ---------- Bid panel ---------- */
.bid-panel { position: sticky; top: 1.25rem; }
.bid-current {
    background: linear-gradient(160deg, var(--surface), var(--surface-2));
    color: var(--ink); border: 1px solid var(--surface-line);
    border-radius: var(--radius); padding: 1.25rem 1.35rem;
}
.bid-current .price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--green-ink); }
.bid-current .text-white-50 { color: var(--muted) !important; }
.bid-current .border-light { border-color: var(--surface-line) !important; }
.bid-feed { max-height: 320px; overflow-y: auto; }
.bid-feed .bid-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .65rem .25rem; border-bottom: 1px solid var(--line);
}
.bid-feed .bid-row:last-child { border-bottom: 0; }
.bid-row.flash { animation: flashbid 1.2s ease; }
@keyframes flashbid { 0% { background: rgba(245, 158, 11, .25); } 100% { background: transparent; } }
.avatar-sm {
    width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
    color: var(--accent-ink); display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700;
}

/* ---------- Gallery ---------- */
.gallery-main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; background: #e9edf2; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs img {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer;
    border: 2px solid transparent; transition: border-color .15s;
}
.gallery-thumbs img.active, .gallery-thumbs img:hover { border-color: var(--accent); }

/* ---------- Spec grid ---------- */
.spec-item { padding: .85rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.spec-item .k { color: var(--muted); }
.spec-item .v { font-weight: 600; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 2.5rem 1rem; }
.auth-card { width: 100%; max-width: 460px; }
.role-toggle input { display: none; }
.role-toggle label {
    flex: 1; text-align: center; border: 1.5px solid var(--line); border-radius: 10px;
    padding: .75rem; cursor: pointer; font-weight: 600; color: var(--muted);
}
.role-toggle input:checked + label { border-color: var(--accent); color: var(--green-ink); background: rgba(155,190,180,.18); }

/* ---------- Dashboard / Admin ---------- */
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.stat-card .icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 1.25rem; }
.stat-card .val { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.sidebar-link { display: flex; align-items: center; gap: .65rem; padding: .65rem .85rem; border-radius: 10px; color: var(--ink); font-weight: 500; }
.sidebar-link:hover { background: var(--surface); color: var(--green-ink); }
.sidebar-link.active { background: var(--navy); color: #fff; }

/* ---------- Footer ---------- */
.app-footer { background: var(--surface); color: var(--muted); }
.app-footer a { color: var(--muted); }
.app-footer a:hover { color: var(--green-ink); }
.app-footer .text-white { color: var(--green-ink) !important; }
.app-footer hr { border-color: var(--surface-line) !important; opacity: 1; }

.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(155,190,180,.35); }
