/* IRON MARKET — preto profundo + laranja ferrugem. Tema escuro único, de propósito. */
:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #121110;
  --ink: #efe9e3;
  --muted: #9a928a;
  --soft: #c9c1b9;
  --line: #262321;
  --steel: #000000;
  --steel-ink: #efe9e3;
  --steel-line: #2b2826;
  --field-bg: #0c0b0a;
  --accent: #c8531f;
  --accent-hi: #e26a33;
  --accent-ink: #000000;
  --plate-red: #b83a2c;
  --plate-yellow: #d39a2a;
  --plate-green: #4f8a5b;
  --plate-blue: #4a6fa8;
  --ok: #5fae74;
  --warn: #d39a2a;
  --bad: #d4553f;
  --chip-bg: #1c1a18;
  --shadow: 0 1px 2px rgba(0,0,0,.5);
  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent-hi); }

/* topo */
.top { background: var(--steel); color: var(--steel-ink); border-bottom: 1px solid var(--steel-line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 800; font-stretch: 62%; font-size: 34px; line-height: 1; letter-spacing: .01em; color: var(--accent); text-decoration: none; }
.logo svg { width: 46px; height: 46px; flex: none; border-radius: 10px; box-shadow: 0 0 0 1px var(--steel-line); }
.logo small { display: block; font-family: var(--f-body); font-weight: 500; font-stretch: 100%; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.who { font-size: 13px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 4px; padding: 10px 16px; font-weight: 700; letter-spacing: .02em; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost.on { border-color: var(--accent); color: var(--accent-hi); }
.btn.danger { background: var(--bad); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.hero { background-color: var(--steel); background-image: linear-gradient(90deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.72) 45%, rgba(0,0,0,.35) 100%), url("hero.jpg"); background-size: cover; background-position: center; color: var(--steel-ink); border-bottom: 1px solid var(--steel-line); }
.hero .wrap { padding-block: 48px 52px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: end; }
.hero h1 { font-family: var(--f-display); font-weight: 800; font-stretch: 62%; font-size: clamp(36px, 6vw, 64px); line-height: .98; margin: 0 0 14px; text-wrap: balance; text-transform: uppercase; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; color: var(--soft); max-width: 58ch; }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--soft); }
.steps b { font-family: var(--f-mono); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent-hi); font-size: 13px; background: rgba(0,0,0,.6); }

/* filtros */
.filters { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.filters .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; padding-block: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
input, select, textarea { width: 100%; background: var(--field-bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; }
textarea { min-height: 90px; resize: vertical; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; align-self: end; padding-bottom: 9px; white-space: nowrap; }
.chk input { width: auto; }

/* lista */
main .wrap { padding-block: 22px 40px; }
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bar h2 { font-family: var(--f-display); font-stretch: 62%; font-weight: 800; font-size: 30px; margin: 0; text-transform: uppercase; color: var(--accent); }
.count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; text-align: left; padding: 0; box-shadow: var(--shadow); transition: transform .15s; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card.sold { opacity: .65; }
.thumb { aspect-ratio: 4/3; max-width: 100%; background: var(--chip-bg); display: grid; place-items: center; position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 46%; height: auto; color: var(--muted); opacity: .55; }
.plate { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 99px; padding: 3px 10px 3px 4px; font-size: 12px; font-weight: 600; }
.plate i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid currentColor; }
.tag-sold, .tag-ex { position: absolute; top: 10px; right: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .1em; padding: 3px 8px; border-radius: 4px; }
.tag-ex { background: var(--steel); }
.body { padding: 12px 14px 14px; display: grid; gap: 6px; min-width: 0; }
.title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.price { font-family: var(--f-mono); font-size: 20px; font-variant-numeric: tabular-nums; color: var(--accent-hi); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); }
.cond { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.cond::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cond.A { color: var(--ok); } .cond.B { color: var(--warn); } .cond.C { color: var(--bad); }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; padding: 22px; display: grid; gap: 8px; margin-bottom: 16px; }
.empty h3 { margin: 0; font-family: var(--f-display); font-stretch: 85%; font-size: 20px; text-transform: uppercase; }
.empty p { margin: 0; color: var(--muted); max-width: 62ch; }
.notice { font-size: 14px; color: var(--muted); padding: 10px 0; }

/* evento */
.event { background: var(--steel); color: var(--steel-ink); border-top: 1px solid var(--steel-line); }
.event .wrap { padding-block: 34px 34px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; }
.event h2 { font-family: var(--f-display); font-weight: 800; font-stretch: 62%; font-size: clamp(34px, 5.5vw, 56px); margin: 4px 0 8px; text-transform: uppercase; line-height: 1; color: var(--accent); }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.event p { color: var(--soft); margin: 0; max-width: 56ch; }
.event form { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); padding: 16px; border-radius: 8px; }
.plates-row { display: flex; gap: 6px; margin-top: 14px; }
.plates-row span { width: 18px; height: 46px; border-radius: 3px; }
footer { border-top: 1px solid var(--steel-line); color: var(--muted); font-size: 13px; }
footer .wrap { padding-block: 18px calc(18px + env(safe-area-inset-bottom, 0px)); }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 20; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); width: min(720px, 100%); max-height: 100%; overflow: auto; border-radius: 10px; border: 1px solid var(--line); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal header h3 { margin: 0; font-family: var(--f-display); font-stretch: 85%; font-size: 20px; text-transform: uppercase; }
.x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal .content { padding: 18px; display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--muted); }
.err { color: var(--bad); font-size: 14px; }
.ok-msg { color: var(--ok); font-size: 14px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.detail-img { width: 100%; aspect-ratio: 4/3; background: var(--chip-bg); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.detail-img img { width: 100%; height: 100%; object-fit: contain; }
.detail-img svg { width: 40%; color: var(--muted); opacity: .5; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { width: 72px; height: 54px; padding: 0; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer; background: var(--chip-bg); }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.specs div { background: var(--bg); border-radius: 6px; padding: 8px 10px; }
.specs dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.contact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg); padding: 12px; border-radius: 8px; }
.contact code { font-family: var(--f-mono); font-size: 17px; user-select: all; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.tabs { display: flex; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 10px 16px; border-radius: 6px; z-index: 30; font-size: 14px; max-width: calc(100% - 32px); }

@media (max-width: 860px) {
  .hero .wrap, .event .wrap { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters .wrap { grid-template-columns: 1fr 1fr; }
  .filters .wrap .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .steps { display: none; }
  .logo { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
