/* =========================================================
   DARK MODE  —  applies when the page has class "dark" on
   <html>: automatically on phones/computers set to dark mode,
   or when the visitor taps the ☾ button. Same layout, darker
   colors. (?tema=oscuro / ?tema=claro in the address forces one.)
   ========================================================= */

html.dark {
  color-scheme: dark;
  --ink: #f2f3f5;            /* headings & strong text become light */
  --text: #d5d8dd;
  --muted: #9aa3af;
  --bg: #0e1014;
  --bg-alt: #151922;
  --surface: #1a1f28;        /* cards, boxes, inputs */
  --border: #2a313c;
  --accent: #dba56c;         /* brighter bronze so it reads on dark */
  --accent-light: #c98a4f;
}

/* Surfaces that are white in light mode */
html.dark .car,
html.dark .sell-form,
html.dark .lang-btn,
html.dark .menu-btn,
html.dark .cat-tab,
html.dark .cur-switch,
html.dark .badge-off,
html.dark .ann-card,
html.dark .review,
html.dark input,
html.dark select,
html.dark textarea { background: var(--surface); }

html.dark .header { background: rgba(14,16,20,.88); }
html.dark .nav { background: var(--bg); }

/* Primary buttons become bronze with dark text */
html.dark .btn-primary { background: var(--accent-light); color: #111318; }
html.dark .btn-primary:hover { background: var(--accent); }
html.dark .btn-outline { border-color: #3a4250; }
html.dark .btn-outline:hover { border-color: var(--ink); }
html.dark .btn-icon { background: var(--surface); border-color: #3a4250; color: #34d399; }
html.dark .btn-icon:hover { background: #12291f; border-color: #34d399; }

/* Things that used the dark "ink" color as a background */
html.dark .cat-tab.active,
html.dark .cur-switch button.active { background: var(--ink); color: #111318; }
html.dark .cat-tab.active span { color: rgba(17,19,24,.6); }
html.dark .badge { background: #0b0d11; }
html.dark .badge-on { background: rgba(11,13,17,.88); }
html.dark .badge-off { color: var(--ink); }
html.dark .badge-sold, html.dark .badge-sale { background: #dc2626; }
html.dark .footer { background: #08090c; border-top: 1px solid var(--border); }
html.dark .vision-card { background: var(--surface); border: 1px solid var(--border); }
html.dark .ann-top { background: #08090c; }
html.dark .ann-countdown { background: rgba(201,138,79,.16); }

/* Sell form plan cards */
html.dark .sell-form .plan:hover { border-color: #3a4250; }
html.dark .plan-list .yes::before { color: #4ade80; }
html.dark .plan-list .no::before { color: #6b7280; }
html.dark .plan[class*="tier-"] { --tier-ink: var(--tier); --badge-bg: var(--surface); } /* tier text in the lighter color so it reads on dark */
html.dark .plan.tier-silver   { --tier: #d3d9e1; }
html.dark .plan.tier-platinum { --tier: #9a9fd0; } /* the light-mode slate-violet is too dark on a dark page */

/* Price colors */
html.dark .price-now.is-sale { color: #f87171; }
html.dark .price-save { background: rgba(248,113,113,.12); color: #fca5a5; }

/* Vehicle page */
html.dark .gallery-nav { background: rgba(26,31,40,.92); color: var(--ink); }
html.dark .gallery-nav:hover { background: var(--surface); }
html.dark .lot-status.on { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.35); }
html.dark .lot-status.on .lot-dot { box-shadow: 0 0 0 4px rgba(16,185,129,.2); }
html.dark .lot-status.off { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.35); }
html.dark .lot-status.off .lot-dot { box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
html.dark .sold-note { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.4); color: #fca5a5; }

/* The gray "no photo yet" placeholder: dim it so it doesn't glare */
html.dark img[src^="data:image/svg"] { filter: invert(.88) hue-rotate(180deg); }

/* Softer shadows on dark */
html.dark .car:hover { box-shadow: 0 12px 30px rgba(0,0,0,.45); }
html.dark .map { filter: brightness(.85) contrast(1.05); }
