* {
  box-sizing: border-box;
}

:root {
  --ink: #10171a;
  --muted: #637176;
  --line: rgba(16, 23, 26, 0.12);
  --panel: rgba(255, 255, 255, 0.92);
  --dark: #091411;
  --green: #7de04f;
  --deep-green: #137b63;
  --soft: #f4f7f7;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(6, 15, 14, 0.72), rgba(245, 247, 248, 0.86) 42%, rgba(245, 247, 248, 0.94)),
    url("bmw-bg.jfif") center / cover fixed;
  color: var(--ink);
  font-family: Tahoma, Arial, sans-serif;
  line-height: 1.8;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  background: #eef5f3;
}

.primary {
  border-color: var(--deep-green);
  background: var(--deep-green);
  color: #fff;
}

.primary:hover {
  background: #0f6a56;
}

.ghost {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.big {
  min-width: 160px;
  padding: 12px 18px;
  font-weight: 700;
}

.full {
  width: 100%;
}

.ghost-on-light {
  border-color: #cbd6d9;
  background: #f8fbfa;
  color: var(--ink);
}

.otp-box {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d6e4e1;
  border-radius: 12px;
  background: #f8fbfa;
}

.otp-box.visible {
  display: block;
}

.otp-box p {
  margin-bottom: 12px;
  color: var(--muted);
}

.otp-box strong {
  color: var(--deep-green);
  font-size: 20px;
}

.portal-notice {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(125, 224, 79, 0.55);
  border-radius: 12px;
  background: rgba(125, 224, 79, 0.16);
  color: #10210e;
  font-weight: 700;
}

.portal-notice.visible {
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.25;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
}

.view {
  display: none;
  min-height: 100vh;
}

.view.active {
  display: block;
}

.landing-view {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #000;
  color: #fff;
}

.hero-shell {
  display: grid;
  grid-template-rows: 50vh 50vh;
  min-height: 100vh;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  max-width: none;
  padding: 34px 28px 18px;
  text-align: center;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.brand-lockup img,
.brand-mini img {
  border-radius: 12px;
  object-fit: cover;
  background: #07120d;
}

.brand-lockup img {
  width: min(38vh, 340px);
  height: min(38vh, 340px);
  border: 1px solid rgba(125, 224, 79, 0.45);
  box-shadow: 0 0 70px rgba(125, 224, 79, 0.18);
}

.trial-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 12px;
  border: 1px solid rgba(125, 224, 79, 0.45);
  border-radius: 999px;
  background: rgba(125, 224, 79, 0.13);
  color: #bfff9c;
  font-weight: 700;
}

.producer {
  margin-bottom: 14px;
  color: #dcebdc;
  font-size: 16px;
}

.hero-text {
  max-width: 760px;
  margin-bottom: 0;
  color: #f2f7f4;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.hero-media {
  position: relative;
  overflow: hidden;
  min-height: 50vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.12) 24%, rgba(0, 0, 0, 0.2) 70%, rgba(0, 0, 0, 0.76) 100%);
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 50vh;
  object-fit: cover;
}

.landing-copyright {
  position: absolute;
  right: 18px;
  bottom: 10px;
  z-index: 3;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.dots-button {
  position: fixed;
  z-index: 20;
  top: 22px;
  right: 22px;
  display: grid;
  gap: 4px;
  width: 44px;
  height: 44px;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
}

.dots-button span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.more-menu {
  position: fixed;
  z-index: 19;
  top: 74px;
  right: 22px;
  display: none;
  width: 250px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(9, 20, 17, 0.94);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
}

.more-menu.open {
  display: grid;
}

.more-menu button {
  border: 0;
  background: transparent;
  color: #fff;
  text-align: right;
}

.pwa-install-button {
  position: fixed;
  z-index: 20;
  left: 22px;
  bottom: 22px;
  display: inline-grid;
  place-items: center;
  min-width: 112px;
  min-height: 46px;
  padding: 10px 16px;
  border-color: rgba(125, 224, 79, 0.62);
  border-radius: 999px;
  background: var(--green);
  color: #07120d;
  font-weight: 800;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34), 0 0 30px rgba(125, 224, 79, 0.22);
}

.pwa-install-button:hover {
  background: #a6ff74;
}

.pwa-install-button.ready {
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34), 0 0 36px rgba(125, 224, 79, 0.5);
}

.pwa-install-button.is-installed {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #eaffde;
}

.mini-header,
.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 26px;
  background: rgba(9, 20, 17, 0.94);
  color: #fff;
  backdrop-filter: blur(8px);
}

.brand-mini {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mini img {
  width: 54px;
  height: 54px;
}

.brand-mini span,
.panel-title span,
.module-head p,
.section-title span,
small {
  color: var(--muted);
}

.app-header .brand-mini span,
.mini-header button,
.app-header button {
  color: #eaf5ef;
}

.mini-header button[data-go] {
  border-color: var(--green);
  background: var(--green);
  color: #050905;
  font-weight: 800;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.auth-view,
.dashboard-view {
  background:
    linear-gradient(rgba(245, 247, 248, 0.84), rgba(245, 247, 248, 0.92)),
    url("bmw-bg.jfif") center / cover fixed;
}

.auth-grid,
.portal-layout,
.staff-login-shell {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  justify-content: center;
  align-content: center;
  gap: 18px;
  min-height: calc(100vh - 92px);
  padding: 26px;
}

.choice-card {
  min-height: 240px;
  display: grid;
  align-content: space-between;
}

.choice-card p {
  color: var(--muted);
}

.auth-grid {
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 0.55fr);
  align-items: start;
}

.portal-layout {
  grid-template-columns: minmax(480px, 1fr) minmax(340px, 0.58fr);
}

.staff-login-shell {
  min-height: calc(100vh - 92px);
  place-items: center;
}

.login-card {
  width: min(430px, 100%);
}

#customerRegisterForm {
  width: min(760px, 100%);
}

#customerLoginForm {
  width: min(430px, 100%);
}

.login-card img {
  display: block;
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  border-radius: 12px;
  object-fit: cover;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(10px);
}

.elevated {
  box-shadow: 0 22px 50px rgba(16, 23, 26, 0.12);
}

.compact-panel {
  position: sticky;
  top: 18px;
}

.panel-title,
.section-title,
.module-head,
.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-title.slim {
  margin-top: 14px;
}

.grid {
  display: grid;
  gap: 12px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full-row {
  grid-column: 1 / -1;
}

.custom-model-field {
  display: none;
}

.custom-model-field.visible {
  display: grid;
}

.birth-date-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.15fr 1fr;
  gap: 8px;
}

label {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  color: #344145;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd6d9;
  border-radius: 9px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.iran-plate {
  display: grid;
  grid-template-columns: 0.5fr 0.9fr 1fr 1.35fr 1fr;
  align-items: stretch;
  overflow: hidden;
  width: min(520px, 100%);
  aspect-ratio: 52 / 11;
  min-height: 86px;
  margin: 0 auto;
  border: 3px solid #111;
  border-radius: 8px;
  background: #fff;
  direction: ltr;
  box-shadow: 0 10px 22px rgba(16, 23, 26, 0.08);
}

.iran-plate input,
.iran-plate select {
  height: 100%;
  border: 0;
  border-left: 1px dashed #c9d0d2;
  border-radius: 0;
  background: #fff;
  color: #050505;
  text-align: center;
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 900;
  line-height: 1;
}

.iran-plate select {
  direction: rtl;
  appearance: none;
  padding: 0;
}

.iran-plate-mark {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 2px;
  padding: 7px 4px;
  background: #123cbd;
  color: #fff;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}

.iran-plate-mark::before {
  content: "";
  width: 30px;
  height: 14px;
  border-radius: 2px;
  background:
    linear-gradient(#239f40 0 33%, #fff 33% 66%, #da0000 66%);
}

.plate-iran-box {
  display: grid;
  grid-template-rows: 28% 72%;
  border-left: 1px dashed #c9d0d2;
  background: #fff;
  direction: rtl;
  aspect-ratio: 1 / 1;
}

.plate-iran-box span {
  display: grid;
  place-items: center;
  border-bottom: 1px dashed #c9d0d2;
  color: #111;
  margin: 0 -1px 0 0;
  font-size: clamp(11px, 1.6vw, 16px);
  font-weight: 800;
}

.plate-iran-box input {
  width: 100%;
  border: 0;
  font-size: clamp(24px, 4.4vw, 38px);
}

.plate-digits {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  height: 100%;
}

.plate-digits select {
  min-width: 0;
  padding: 0;
}

.plate-iran-box .plate-digits select {
  border-left: 0;
}

.plate-iran-box .plate-digits select + select {
  border-right: 1px dashed #d9dee0;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(9, 20, 17, 0.92);
  position: sticky;
  top: 18px;
  height: calc(100vh - 120px);
}

.side-nav button {
  border: 0;
  background: transparent;
  color: #dcebdc;
  text-align: right;
}

.side-nav button.active {
  background: rgba(125, 224, 79, 0.16);
  color: #bfff9c;
}

.module {
  display: none;
}

.module.active {
  display: block;
}

.module-head {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.eyebrow {
  margin: 0 0 4px;
  color: #bfff9c;
  font-size: 13px;
  font-weight: 700;
}

.eyebrow.dark {
  color: var(--deep-green);
}

.module-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-stats span {
  min-width: 132px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.module-stats strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

.sub-tabs,
.tabs,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.sub-tabs button.active,
.tabs button.active {
  background: var(--ink);
  color: #fff;
}

.acceptance-pane {
  display: none;
}

.acceptance-pane.active {
  display: block;
}

.admission-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(320px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.form-vehicle-hero {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #d6e4e1;
  border-radius: 12px;
  aspect-ratio: 16 / 6;
  background: #0f2a2e;
}

.form-vehicle-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.handover-box,
.service-box {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #d6e4e1;
  border-radius: 12px;
  background: rgba(248, 251, 250, 0.92);
}

.schematic-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.8fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.schematic-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid #cbd6d9;
  border-radius: 12px;
  background: #fff;
}

.schematic-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.part-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  padding: 4px 8px;
  border-color: rgba(15, 42, 46, 0.3);
  background: rgba(19, 123, 99, 0.92);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(15, 42, 46, 0.18);
}

.part-pin.active {
  background: var(--ink);
}

.active-part {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
}

.active-part small {
  color: #cbd6d9;
}

.body-part-grid {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  margin-top: 10px;
  padding-left: 4px;
}

.part-note {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6e4e1;
  border-radius: 10px;
  background: #fff;
}

.part-note.active {
  border-color: var(--deep-green);
  box-shadow: 0 0 0 3px rgba(19, 123, 99, 0.08);
}

.photo-grid,
.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #d6e4e1;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.check-grid input {
  width: auto;
}

.photo-slot {
  min-height: 128px;
  margin: 0;
  place-items: center;
  border: 1px dashed #bac8cc;
  border-radius: 12px;
  background: #fff;
  color: #607176;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.photo-slot input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-slot img {
  display: none;
  width: 100%;
  height: 128px;
  object-fit: cover;
}

.photo-slot.has-image {
  border-style: solid;
  padding: 0;
  color: transparent;
}

.photo-slot.has-image img {
  display: block;
}

.records {
  display: grid;
  gap: 12px;
}

.compact-records {
  gap: 10px;
}

.record {
  border: 1px solid #dce4e6;
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.record h3 {
  margin-bottom: 2px;
  font-size: 16px;
}

.record p,
.record-body,
.record-money {
  color: #4b5b60;
  font-size: 13px;
}

.badge {
  align-self: start;
  border-radius: 999px;
  padding: 3px 10px;
  background: #e4f3ef;
  color: #0f6b56;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.record-money {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e3eaec;
  color: var(--ink);
  font-weight: 700;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.empty {
  padding: 28px;
  border: 1px dashed #cbd6d9;
  border-radius: 12px;
  text-align: center;
  color: #6c7b80;
}

.state {
  background: rgba(255, 255, 255, 0.9);
}

.module-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-cards article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(16, 23, 26, 0.08);
  font-size: 20px;
  font-weight: 700;
}

.module-cards span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

dialog {
  max-width: 520px;
  border: 0;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dialog-close {
  float: left;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

@media (max-width: 1160px) {
  .hero-shell,
  .auth-grid,
  .choice-grid,
  .portal-layout,
  .admission-grid,
  .schematic-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    height: auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .landing-view,
  .auth-grid,
  .choice-grid,
  .portal-layout,
  .dashboard-layout {
    padding: 14px;
  }

  .hero-shell {
    min-height: auto;
  }

  .hero-media,
  .hero-media img {
    min-height: 280px;
  }

  .pwa-install-button {
    left: 14px;
    bottom: 14px;
    min-width: 96px;
    min-height: 42px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .brand-lockup {
    display: grid;
  }

  .two,
  .three,
  .photo-grid,
  .check-grid,
  .module-cards,
  .side-nav {
    grid-template-columns: 1fr;
  }

  .iran-plate {
    grid-template-columns: 0.5fr 0.9fr 1fr 1.35fr 1fr;
    max-width: 100%;
    min-height: 62px;
  }

  .iran-plate input,
  .iran-plate select {
    font-size: 22px;
  }

  .plate-iran-box input {
    font-size: 21px;
  }

  .app-header,
  .mini-header,
  .module-head,
  .panel-title,
  .section-title {
    display: grid;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-header,
  .side-nav,
  .sub-tabs,
  .record-actions,
  .actions,
  .part-pin,
  #resetForm {
    display: none !important;
  }

  .dashboard-layout,
  .admission-grid,
  .schematic-grid {
    display: block;
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: 0;
  }
}
