:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --ink: #111827;
  --muted: #6b7280;
  --line: #d8dee6;
  --primary: #0f5db8;
  --primary-dark: #0a4588;
  --accent: #d99a22;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
a { color: var(--primary); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand--link {
  color: inherit;
  text-decoration: none;
}
.brand__logo {
  width: 56px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.brand__title { color: var(--primary); font-weight: 900; letter-spacing: 0.04em; }
.brand__sub { color: var(--muted); font-size: 12px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  margin-right: 10px;
}
.nav-links a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav-links a:hover { color: var(--primary); }
.session-email { color: var(--muted); font-size: 13px; }

main { width: 100%; }
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(22px, 4vw, 56px);
  padding: clamp(36px, 7vw, 86px) clamp(18px, 4vw, 56px);
  background:
    radial-gradient(circle at 15% 15%, rgba(15, 93, 184, 0.14), transparent 30%),
    linear-gradient(135deg, #ffffff, #edf4fb);
  border-bottom: 1px solid var(--line);
}
.hero__content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  margin: 8px 0 14px;
  max-width: 860px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.hero__copy { max-width: 720px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.eyebrow { margin: 0; color: var(--primary); font-weight: 900; text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; }
.hero__panel {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__panel::before {
  content: "";
  position: absolute;
  right: clamp(36px, 9vw, 160px);
  top: 50%;
  width: clamp(300px, 30vw, 500px);
  height: clamp(230px, 27vw, 390px);
  transform: translateY(-50%);
  background: url("./static/zavi-exports-logo.png") center / contain no-repeat;
  opacity: 0.14;
}
.stat-card {
  position: relative;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 1;
}
.stat-card span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; letter-spacing: 0.1em; }
.stat-card strong { display: block; margin: 8px 0; font-size: 26px; }
.stat-card small { color: var(--muted); line-height: 1.5; }
.stat-card--dark { color: #fff; background: #07182f; border-color: #07182f; }
.stat-card--dark span, .stat-card--dark small { color: rgba(255, 255, 255, 0.72); }

.chassis-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  max-width: 860px;
  margin-top: 26px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 93, 184, 0.12); }
.input--large { min-height: 52px; font-size: 16px; border: 0; }
.textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  resize: vertical;
  outline: none;
}
.textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 93, 184, 0.12); }

.btn {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.btn:hover { border-color: var(--primary); }
.btn--primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn--ghost { background: #fff; }
.btn--large { min-height: 52px; }

.search-message { min-height: 24px; margin-top: 12px; font-weight: 700; }
.search-message--error { color: var(--danger); }
.search-message--ok { color: var(--success); }
.search-message--info { color: var(--muted); }

.section { padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 56px); }
.section__head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 22px; }
.section h2 { margin: 6px 0 0; font-size: clamp(24px, 3vw, 40px); letter-spacing: -0.03em; }
.stock-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; }
.alert--ok { border-color: rgba(8, 116, 67, 0.35); color: var(--success); }
.alert--error { border-color: rgba(180, 35, 24, 0.35); color: var(--danger); }

.cars-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.car-card { padding: 0; text-align: left; border: 1px solid var(--line); background: #fff; cursor: pointer; box-shadow: none; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.car-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.car-card__image { height: 132px; display: grid; place-items: center; background: linear-gradient(135deg, #dce8f5, #ffffff); color: rgba(15, 93, 184, 0.45); font-weight: 900; font-size: 28px; letter-spacing: 0.18em; }
.car-card__image--photo { display: block; background: #f3f6f9; }
.car-card__image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.car-card__body { display: grid; gap: 8px; padding: 14px; }
.car-card__body strong { font-size: 16px; }
.car-card__body span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.empty-state { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--line); background: var(--surface-soft); color: var(--muted); }

.pagination-bar { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 26px; }
.page-btn { min-width: 42px; min-height: 42px; border: 1px solid var(--line); background: #fff; font-weight: 900; cursor: pointer; }
.page-btn--active { color: #fff; background: var(--primary); border-color: var(--primary); }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled,
.pagination-bar .btn:disabled {
  color: #9aa4b2;
  background: #f1f4f7;
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.7;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(42px, 7vw, 88px) clamp(18px, 4vw, 56px);
  background:
    radial-gradient(circle at 88% 35%, rgba(15, 93, 184, 0.16), transparent 26%),
    linear-gradient(135deg, #ffffff, #edf4fb);
  border-bottom: 1px solid var(--line);
}
.profile-hero::after {
  content: "";
  position: absolute;
  right: clamp(28px, 8vw, 130px);
  top: 50%;
  width: clamp(220px, 26vw, 420px);
  height: clamp(170px, 24vw, 320px);
  transform: translateY(-50%);
  background: url("./static/zavi-exports-logo.png") center / contain no-repeat;
  opacity: 0.08;
}
.profile-hero > div {
  position: relative;
  z-index: 1;
  max-width: 850px;
}
.profile-hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.profile-hero__copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.profile-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.profile-menu {
  position: sticky;
  top: 82px;
  display: grid;
  background: #fff;
  border: 1px solid var(--line);
}
.profile-menu__item {
  padding: 15px 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.profile-menu__item:last-child {
  border-bottom: 0;
}
.profile-menu__item:hover,
.profile-menu__item--active {
  color: #fff;
  background: var(--primary);
}
.profile-content {
  display: grid;
  gap: 18px;
}
.profile-card {
  padding: clamp(20px, 3vw, 34px);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.profile-card h2 {
  margin: 8px 0 12px;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -0.03em;
}
.profile-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}
.profile-card p {
  color: var(--muted);
  line-height: 1.7;
}
.profile-card--dark {
  color: #fff;
  background: #07182f;
  border-color: #07182f;
}
.profile-card--dark p {
  color: rgba(255,255,255,0.72);
}
.profile-table {
  display: grid;
  margin-top: 22px;
  border: 1px solid var(--line);
}
.profile-table > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
.profile-table > div:last-child {
  border-bottom: 0;
}
.profile-table strong,
.profile-table span {
  padding: 14px 16px;
}
.profile-table strong {
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.profile-grid > div {
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.profile-steps {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}
.policy-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.footer {
  display: grid;
  gap: 22px;
  padding: 34px clamp(18px, 4vw, 56px) 24px;
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  font-size: 14px;
}
.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 620px;
}
.footer__logo {
  width: 128px;
  max-height: 82px;
  object-fit: contain;
  display: block;
}
.footer__title {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.footer__copy {
  margin: 8px 0 0;
  color: #fff;
  line-height: 1.6;
}
.footer__contact {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
}
.footer__contact span {
  display: flex;
  align-items: center;
  gap: 9px;
}
.footer__contact a {
  font-weight: 800;
  text-decoration: none;
}
.footer__contact a:hover {
  text-decoration: underline;
}
.footer__icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}
.footer__links {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
  white-space: nowrap;
}
.footer__links a {
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.footer__links a:hover { color: #fff; }
.footer__bottom {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer__copyright {
  color: #fff;
  font-size: 12px;
  text-align: center;
}
.footer a { color: #fff; }

.dialog { width: min(980px, calc(100% - 24px)); border: 0; padding: 0; background: transparent; }
.dialog::backdrop { background: rgba(7, 24, 47, 0.58); backdrop-filter: blur(3px); }
.dialog__card { background: #fff; padding: 22px; box-shadow: var(--shadow); max-height: 88vh; overflow: auto; }
.dialog__head { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.dialog__title { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 22px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 12px 14px; border: 0; background: transparent; cursor: pointer; font-weight: 900; color: var(--muted); }
.tab--active { color: var(--primary); border-bottom: 3px solid var(--primary); }
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.field--wide { grid-column: span 3; }

@media (max-width: 1100px) { .cars-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .site-header, .section__head { align-items: stretch; flex-direction: column; }
  .nav-actions { align-items: flex-start; flex-wrap: wrap; }
  .nav-links { width: 100%; order: -1; flex-wrap: wrap; margin-right: 0; }
  .hero { grid-template-columns: 1fr; }
  .chassis-search { grid-template-columns: 1fr; }
  .cars-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: span 1; }
  .profile-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .profile-menu { position: static; }
  .profile-table > div { grid-template-columns: 1fr; }
  .profile-table strong { border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-grid { grid-template-columns: 1fr; }
  .footer__top,
  .footer__bottom,
  .footer__brand { align-items: flex-start; flex-direction: column; }
  .footer__links { align-items: flex-start; justify-content: flex-start; }
}
@media (max-width: 520px) { .cars-grid { grid-template-columns: 1fr; } }
