/* MyWay Car Buying — global styles */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #16192b;
  --muted: #6b7186;
  --line: #e4e7f0;
  --brand: #2451ff;
  --brand-dark: #1a3ecf;
  --brand-ink: #0d1b52;
  --accent: #00c48c;
  --danger: #e5484d;
  --warn: #f5a623;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(22, 25, 43, .08);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo em { font-style: normal; color: var(--brand); }
.main-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.main-nav a { color: var(--ink); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--brand); text-decoration: none; }
.nav-user { font-weight: 700; color: var(--brand) !important; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink); }
.notif-link { position: relative; }
.notif-count {
  position: absolute; top: -8px; right: -12px;
  background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700;
  border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer;
  border-radius: 10px; font-family: var(--font); font-weight: 600; font-size: .95rem;
  padding: 12px 22px; transition: all .15s ease; text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff !important; box-shadow: 0 4px 14px rgba(36, 81, 255, .35); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #fff !important; box-shadow: 0 4px 14px rgba(0, 196, 140, .35); }
.btn-outline { background: transparent; color: var(--brand) !important; border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff !important; }
.btn-danger { background: var(--danger); color: #fff !important; }
.btn-ghost { background: var(--bg); color: var(--ink) !important; border: 1px solid var(--line); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #0d1b52 0%, #1a3ecf 55%, #2451ff 100%);
  color: #fff; padding: 90px 0 110px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -55% -10%; height: 70%;
  background: var(--bg); border-radius: 50% 50% 0 0;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.12; margin: 0 0 18px; font-weight: 800; max-width: 720px; }
.hero h1 .hl { color: #8fd8ff; }
.hero p.lead { font-size: 1.2rem; max-width: 620px; opacity: .92; margin: 0 0 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 55px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 1.7rem; }
.hero-stats .stat span { opacity: .8; font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section h2 { font-size: 2rem; margin: 0 0 8px; text-align: center; }
.section .sub { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 45px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.step-num {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-weight: 800; font-size: 1.1rem;
  margin-bottom: 14px;
}
.icon-big { font-size: 2rem; margin-bottom: 10px; }

.cta-band {
  background: linear-gradient(135deg, var(--brand-ink), var(--brand-dark));
  border-radius: 20px; color: #fff; padding: 55px 40px; text-align: center;
}
.cta-band h2 { color: #fff; }

/* ---------- Forms ---------- */
.form-card { max-width: 560px; margin: 50px auto; }
.form-card.wide { max-width: 860px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 16px 0 6px; }
label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--font); font-size: .95rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36, 81, 255, .12);
}
textarea { min-height: 96px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-weight: 500; }
.checkbox-line input { width: auto; }
.form-actions { margin-top: 26px; }
.field-hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* Role picker on register */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0 4px; }
.role-pick input { display: none; }
.role-pick label {
  border: 2px solid var(--line); border-radius: 12px; padding: 18px; text-align: center;
  cursor: pointer; margin: 0; transition: all .15s;
}
.role-pick input:checked + label { border-color: var(--brand); background: rgba(36, 81, 255, .06); }
.role-pick .role-icon { font-size: 1.8rem; display: block; margin-bottom: 6px; }

/* ---------- Flash ---------- */
.flash {
  margin: 18px 0 0; padding: 13px 42px 13px 16px; border-radius: 10px; font-weight: 500; position: relative;
}
.flash-success { background: #e6f9f2; color: #06734f; border: 1px solid #b5ecd9; }
.flash-error { background: #fdecec; color: #a12327; border: 1px solid #f6c6c8; }
.flash-info { background: #e9f0ff; color: #1a3ecf; border: 1px solid #c6d6ff; }
.flash-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: .6;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
}
.badge-open { background: #e6f9f2; color: #06734f; }
.badge-accepted { background: #e9f0ff; color: #1a3ecf; }
.badge-closed { background: #f0f1f5; color: #6b7186; }
.badge-role { background: #fff4e0; color: #9a6404; }

/* ---------- Dashboard / listings ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 38px 0 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.7rem; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-card b { font-size: 1.6rem; display: block; }
.stat-card span { color: var(--muted); font-size: .85rem; }

.list-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 14px; display: flex; justify-content: space-between; gap: 18px;
  align-items: center; transition: box-shadow .15s; flex-wrap: wrap;
}
.list-card:hover { box-shadow: var(--shadow); }
.list-card .lc-main { flex: 1; min-width: 240px; }
.list-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.lc-meta { color: var(--muted); font-size: .85rem; display: flex; gap: 14px; flex-wrap: wrap; }
.lc-side { text-align: right; }
.lc-side .price { font-size: 1.25rem; font-weight: 800; color: var(--brand); }

/* ---------- Request detail ---------- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 26px; align-items: start; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; vertical-align: top; }
.spec-table td:first-child { color: var(--muted); width: 42%; }
.offer-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; background: var(--surface); }
.offer-card.winner { border-color: var(--accent); background: #f3fdf9; }
.offer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.offer-price { font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.offer-files { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.offer-files img {
  width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer;
}
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 8px; font-size: .83rem;
}

/* ---------- Chat ---------- */
.chat-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; }
.chat-scroll { max-height: 380px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: .93rem; }
.chat-msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.theirs { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg .chat-meta { display: block; font-size: .7rem; opacity: .7; margin-top: 3px; }
.chat-input { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input textarea { min-height: 44px; height: 44px; flex: 1; }

/* ---------- Ratings & logos ---------- */
.stars { color: #f5a623; font-size: .95rem; letter-spacing: 1px; }
.dealer-logo {
  width: 52px; height: 52px; object-fit: contain; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; padding: 3px; flex-shrink: 0;
}

/* ---------- Share ---------- */
.share-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px;
  color: #fff !important; font-size: .85rem; font-weight: 600;
}
.share-btn:hover { text-decoration: none; filter: brightness(1.1); }
.share-fb { background: #1877f2; }
.share-x { background: #111; }
.share-wa { background: #25d366; }
.share-li { background: #0a66c2; }
.share-em { background: #6b7186; }
.share-copy { background: var(--brand-ink); border: none; cursor: pointer; font-family: var(--font); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: var(--bg); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tr:last-child td { border-bottom: none; }

/* ---------- Notifications page ---------- */
.notif-item { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.notif-item.unread { background: #f0f5ff; }
.notif-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(10, 12, 25, .88); display: none;
  align-items: center; justify-content: center; z-index: 100; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }

/* ---------- Sponsor ads ---------- */
.ad-slot {
  position: relative; margin: 26px 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.ad-tag {
  position: absolute; top: -9px; left: 16px; background: var(--surface);
  color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line);
}
.ad-rotator { text-align: center; }
.ad-frame { display: none; }
.ad-frame.is-active { display: block; }
.ad-frame img { display: block; margin: 0 auto; max-height: 110px; width: auto; max-width: 100%; border-radius: 8px; }
.state-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 14px;
  max-height: 260px; overflow-y: auto;
}
.state-grid .checkbox-line { margin: 6px 0; font-size: .88rem; font-weight: 400; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 70px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding: 44px 20px; flex-wrap: wrap; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--muted); }
.footer-copy { padding: 0 20px 28px; color: var(--muted); font-size: .82rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3, .grid-2, .detail-grid, .stat-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .state-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 18px 22px; align-items: flex-start;
  }
  .main-nav.open { display: flex; }
  .hero { padding: 60px 0 90px; }
}
