/* ============================================================
   SANNTEC — Design System
   Direção: industrial/técnico. Aço, papel técnico, laranja-segurança.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #1a2028;
  --ink-soft: #4a5560;
  --ink-faint: #7b8792;
  --paper: #f2f0ea;
  --card: #ffffff;
  --steel: #22303c;
  --steel-2: #31424f;
  --line: #d9d5cb;
  --line-strong: #b9b3a5;
  --accent: #f25c05;
  --accent-dark: #d14e02;
  --accent-soft: #fde8dc;
  --ok: #1d7a4f;
  --ok-soft: #e0f2e8;
  --warn: #a86a00;
  --warn-soft: #fdf0d3;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --info: #1b5fa8;
  --info-soft: #e1edf9;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --display: 'Barlow Condensed', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(26,32,40,.08), 0 4px 16px rgba(26,32,40,.07);
  --shadow-lg: 0 8px 40px rgba(26,32,40,.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(26,32,40,.025) 23px 24px),
    var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
main.narrow { max-width: 760px; }
main.wide { max-width: 1320px; }

h1, h2, h3 { font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; margin: 0 0 .5em; }
h1 { font-size: 2.6rem; font-weight: 800; }
h2 { font-size: 1.7rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .85em; }

.kicker {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em; color: var(--accent-dark);
  display: flex; align-items: center; gap: .6em; margin-bottom: .6rem;
}
.kicker::before { content: ''; width: 22px; height: 2px; background: var(--accent); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; border-bottom: 2px solid var(--steel); padding-bottom: 1rem; }
.page-head p { margin: .2rem 0 0; color: var(--ink-soft); }

/* ---------- Navbar ---------- */
.site-header { background: var(--steel); color: #fff; border-bottom: 4px solid var(--accent); }
.navbar { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 1.4rem; min-height: 62px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: .06em; color: #fff; text-decoration: none; display: flex; align-items: center; gap: .5em; }
.brand:hover { text-decoration: none; }
.brand .bolt { color: var(--accent); }
.nav-links { display: flex; gap: .2rem; flex-wrap: wrap; margin-right: auto; }
.nav-links a {
  color: #cfd8de; text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: .45rem .8rem; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em;
}
.nav-links a:hover { background: var(--steel-2); color: #fff; text-decoration: none; }
.nav-links a.active { background: var(--accent); color: #fff; }
.nav-user { display: flex; align-items: center; gap: .7rem; font-size: .85rem; }
.nav-user .who { font-family: var(--mono); color: #9fb0bb; font-size: .75rem; }
.btn-nav { background: transparent; border: 1px solid #5a6b78; color: #fff; }
.btn-nav:hover { border-color: #fff; background: var(--steel-2); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font-family: var(--body); font-weight: 700; font-size: .9rem;
  padding: .55rem 1.1rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: all .15s ease; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .03em;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-dark); }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-dark { background: var(--steel); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--steel); background: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .78rem; }
.btn-block { width: 100%; }
.btn-ok { background: var(--ok); color: #fff; }

/* ---------- Cards / painéis ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1.5rem; }
.panel-title { font-family: var(--mono); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-faint); border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin: 0 0 1rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--steel) 0%, #18232c 70%);
  color: #fff; border-bottom: 4px solid var(--accent);
  background-image:
    linear-gradient(135deg, rgba(242,92,5,.12), transparent 40%),
    repeating-linear-gradient(115deg, transparent 0 34px, rgba(255,255,255,.035) 34px 36px),
    linear-gradient(135deg, var(--steel) 0%, #18232c 70%);
  padding: 4.5rem 1.5rem 4rem;
}
.hero-inner { max-width: 1180px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 0 0 .3em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: #b8c4cd; max-width: 640px; margin: 0 0 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- Grid de cards de anúncio ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 1.2rem; }
.listing-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.listing-card .thumb { aspect-ratio: 4/3; background: linear-gradient(160deg, #31424f, #1a2530); display: grid; place-items: center; color: #6d8090; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; overflow: hidden; }
.listing-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-card .body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.listing-card .title { font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.listing-card .title:hover { color: var(--info); }
.listing-card .meta { font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.listing-card .price { font-family: var(--display); font-weight: 800; font-size: 1.45rem; margin-top: auto; padding-top: .4rem; }
.listing-card .price small { font-size: .65em; color: var(--ink-faint); font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; padding: .18rem .55rem; border-radius: 3px; border: 1px solid transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: #eceae4; color: var(--ink-soft); }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Formulários ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: .3rem; }
.field .req { color: var(--bad); }
.field .hint { font-size: .76rem; color: var(--ink-faint); margin-top: .25rem; font-family: var(--mono); }
input, select, textarea {
  width: 100%; font-family: var(--body); font-size: .95rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .55rem .7rem; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,92,5,.15); }
textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
legend { font-family: var(--mono); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-dark); padding: 0 .5em; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; }
.check input { width: auto; margin-top: .2rem; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); text-align: left; padding: .55rem .7rem; border-bottom: 2px solid var(--steel); white-space: nowrap; }
table.data td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #faf9f5; }

/* ---------- Wizard (passos) ---------- */
.steps { display: flex; gap: 0; margin-bottom: 1.8rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.step { flex: 1; padding: .7rem .9rem; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); border-left: 1px solid var(--line); display: flex; gap: .6em; align-items: center; }
.step:first-child { border-left: 0; }
.step .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; font-weight: 600; }
.step.active { background: var(--steel); color: #fff; }
.step.active .n { background: var(--accent); border-color: var(--accent); }
.step.done { color: var(--ok); }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.wizard-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 1.2rem; right: 1.2rem; display: flex; flex-direction: column; gap: .6rem; z-index: 1000; max-width: 380px; }
.toast { background: var(--steel); color: #fff; padding: .8rem 1.1rem; border-radius: var(--radius); border-left: 4px solid var(--info); box-shadow: var(--shadow-lg); font-size: .9rem; animation: slide-in .25s ease; display: flex; gap: .6rem; align-items: flex-start; }
.toast.success { border-left-color: #2ecc71; }
.toast.error { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--accent); }
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,26,32,.6); z-index: 900; display: grid; place-items: center; padding: 1.2rem; animation: fade .15s ease; }
.modal { background: #fff; border-radius: var(--radius); border-top: 4px solid var(--accent); max-width: 640px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-close { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--ink-faint); line-height: 1; }
.modal-body { padding: 1.3rem; overflow-y: auto; }
.modal-foot { padding: .9rem 1.3rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .7rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

/* ---------- Filtros / sidebar ---------- */
.market-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .market-layout { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }

/* ---------- Detalhe da máquina ---------- */
.gallery-main { aspect-ratio: 4/3; background: linear-gradient(160deg, #31424f, #1a2530); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; color: #6d8090; font-family: var(--mono); font-size: .75rem; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.gallery-thumbs img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; border: 2px solid transparent; cursor: pointer; }
.gallery-thumbs img.active { border-color: var(--accent); }
.spec-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec-table th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: .45rem .8rem .45rem 0; width: 42%; border-bottom: 1px solid var(--line); }
.spec-table td { padding: .45rem 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .85rem; }
.detail-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.8rem; align-items: start; }
@media (max-width: 860px) { .detail-layout { grid-template-columns: 1fr; } }
.price-big { font-family: var(--display); font-weight: 800; font-size: 2.3rem; color: var(--ink); }
.price-big small { font-size: .5em; color: var(--ink-faint); }

/* ---------- Home ---------- */
.cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.cat-card { padding: 1.2rem 1.3rem; border-left: 4px solid var(--steel); transition: all .15s; }
.cat-card:hover { border-left-color: var(--accent); transform: translateY(-2px); }
.cat-card h3 { margin-bottom: .4rem; }
.cat-card ul { list-style: none; margin: 0; padding: 0; }
.cat-card li { padding: .18rem 0; font-size: .9rem; }
.cat-card li a { color: var(--ink-soft); }
.cat-card li a:hover { color: var(--accent-dark); }
.flow-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 2.5rem 0; }
@media (max-width: 760px) { .flow-duo { grid-template-columns: 1fr; } }
.flow-card { padding: 1.6rem; background: var(--steel); color: #fff; border-radius: var(--radius); position: relative; overflow: hidden; }
.flow-card.alt { background: var(--accent); }
.flow-card .num { font-family: var(--display); font-weight: 800; font-size: 4.5rem; opacity: .16; position: absolute; right: .5rem; top: -.8rem; }
.flow-card h3 { font-size: 1.6rem; }
.flow-card p { color: rgba(255,255,255,.75); margin: 0 0 1.2rem; }
.flow-card .btn { background: #fff; color: var(--steel); }
.flow-card.alt .btn { color: var(--accent-dark); }

/* ---------- Matches ---------- */
.match-card { border-left: 4px solid var(--line-strong); margin-bottom: 1rem; }
.match-card.compatible { border-left-color: var(--ok); }
.match-card.partial { border-left-color: var(--warn); }
.crit-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.crit { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 3px; background: #eceae4; color: var(--ink-faint); }
.crit.yes { background: var(--ok-soft); color: var(--ok); }
.crit.no { background: var(--bad-soft); color: var(--bad); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--steel); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tabs button { background: none; border: 0; font-family: var(--body); font-weight: 700; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); padding: .7rem 1.2rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--steel); border-bottom-color: var(--accent); }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-faint); }
.empty .icon { font-size: 2.2rem; display: block; margin-bottom: .5rem; }
.skeleton { background: linear-gradient(90deg, #eceae4 25%, #f6f4ef 50%, #eceae4 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 4px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.8rem; flex-wrap: wrap; }
.alert { padding: .8rem 1.1rem; border-radius: var(--radius); font-size: .9rem; margin-bottom: 1.2rem; border-left: 4px solid; }
.alert.info { background: var(--info-soft); border-color: var(--info); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn); }
.alert.bad { background: var(--bad-soft); border-color: var(--bad); }
.site-footer { background: var(--steel); color: #8fa0ac; font-family: var(--mono); font-size: .72rem; padding: 1.4rem 1.5rem; text-align: center; letter-spacing: .06em; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--ink-faint); font-size: .85rem; }
.count-note { font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
