/*--------------------------------------------------------------
# Search by plate: VIN | Держномер switch, inline message, pick-list popup
# (homepage hero + /perevirka-avto-po-nomeru)
--------------------------------------------------------------*/

/* VIN | Держномер switch: a white pill above the field, the active half in
   the brand teal. Sits on the teal hero, so it carries its own colours. */
.search-mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.search-mode-switch__btn {
  border: 0;
  background: transparent;
  color: #172a28;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.search-mode-switch__btn:hover {
  background: #e6f3f1;
}

.search-mode-switch__btn[aria-pressed="true"] {
  background: #008374;
  color: #ffffff;
}

.search-mode-switch__btn:focus-visible {
  outline: 3px solid #ffb703;
  outline-offset: 2px;
}

/* sample value shown while the empty field is focused: same colour as the
   typed text, dimmed, so it reads on the green hero */
#vin_input_field::placeholder {
  color: color-mix(in srgb, var(--default-color), transparent 40%);
  opacity: 1;
}

/* the plate is typed in capitals whatever the keyboard does */
#vin_search_form[data-search-mode="plate"] #vin_input_field {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* plate-mode-only lines around the field (format hint, note under the
   button): hidden while the form is in VIN mode */
#vin_search_form:not([data-search-mode="plate"]) .plate-only {
  display: none;
}

/* same colour as the field label, dimmed, small. The id keeps the hero's
   own paragraph margins (.hero p) off these lines. */
#hero .plate-form-hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}

#hero .plate-form-hint {
  text-align: left;
  padding-left: 2px;
}

/* not found / errors under the button */
.plate-search-msg {
  display: none;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff8e1;
  border: 1px solid #ffe08a;
  color: #5c3b00;
}

.plate-search-msg.is-visible {
  display: block;
}

.plate-search-msg__link {
  border: 0;
  background: none;
  padding: 0;
  color: #008374;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- popup ---- */

html.plate-modal-open {
  overflow: hidden;
}

.plate-modal {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #ffffff;
  color: #222222;
  box-shadow: 0 24px 60px rgba(23, 42, 40, 0.35);
  overflow: hidden;
}

.plate-modal::backdrop {
  background: rgba(23, 42, 40, 0.55);
  backdrop-filter: blur(3px);
}

/* fallback for browsers without <dialog>.showModal() */
.plate-modal[open]:not(:modal) {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100;
}

.plate-modal__inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.plate-modal__header {
  position: relative;
  padding: 28px 72px 20px 28px;
  border-bottom: 1px solid #e7eceb;
}

.plate-modal__eyebrow {
  margin: 0 0 8px;
  font-family: var(--heading-font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #008374;
}

.plate-modal__eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #008374;
  vertical-align: middle;
}

.plate-modal__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 10px;
  font-family: var(--heading-font);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  color: #172a28;
}

.plate-modal__plate {
  display: inline-block;
  padding: 2px 12px;
  border: 1px solid #d5dedc;
  border-radius: 10px;
  background: #f2f6f5;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
}

.plate-modal__lead {
  margin: 0;
  color: #5b6b69;
  font-size: 0.98rem;
  line-height: 1.5;
}

.plate-modal__close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5dedc;
  border-radius: 12px;
  background: #ffffff;
  color: #172a28;
  font-size: 1rem;
  cursor: pointer;
}

.plate-modal__close:hover {
  background: #f2f6f5;
}

.plate-modal__close:focus-visible,
.plate-car:focus-visible {
  outline: 3px solid #ffb703;
  outline-offset: 2px;
}

.plate-modal__body {
  padding: 18px 28px 24px;
  overflow-y: auto;
}

.plate-modal__list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.plate-modal__count {
  font-weight: 700;
  color: #172a28;
}

.plate-modal__pick-hint {
  font-size: 0.85rem;
  color: #7a8a88;
}

.plate-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plate-car {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #dfe6e5;
  border-radius: 16px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.plate-car:hover {
  border-color: #008374;
  background: #f4fbfa;
  box-shadow: 0 0 0 3px rgba(0, 131, 116, 0.12);
  color: inherit;
}

.plate-modal__item:first-child .plate-car {
  border-color: #8fcfc6;
  background: #f4fbfa;
}

.plate-car__icon {
  flex: 0 0 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eef3f2;
  color: #172a28;
  font-size: 1.4rem;
}

.plate-car__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plate-car__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.plate-car__title {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.08rem;
  color: #172a28;
}

.plate-car__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: #4d5c5a;
  font-size: 0.95rem;
}

.plate-car__vin {
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #7a8a88;
  letter-spacing: 0.03em;
}

.plate-car__arrow {
  flex: 0 0 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef3f2;
  color: #172a28;
}

.plate-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.plate-badge--latest {
  background: #dcf5e7;
  color: #0b6b3a;
}

.plate-badge--range {
  background: #eef1f1;
  color: #4d5c5a;
}

.plate-modal__tip {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  padding: 12px 16px;
  border: 1px solid #ffe08a;
  border-radius: 14px;
  background: #fff8e1;
  color: #5c3b00;
  font-size: 0.93rem;
  line-height: 1.5;
}


/* phones: a bottom sheet, the badge drops under the title */
@media (max-width: 575.98px) {
  .plate-modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .plate-modal__inner {
    max-height: 92vh;
  }

  .plate-modal__header {
    padding: 22px 64px 16px 18px;
  }

  .plate-modal__title {
    font-size: 1.3rem;
  }

  .plate-modal__close {
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
  }

  .plate-modal__body {
    padding: 14px 16px 20px;
  }

  .plate-modal__pick-hint {
    display: none;
  }

  .plate-car {
    gap: 12px;
    padding: 12px;
  }

  .plate-car__icon {
    flex-basis: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .plate-car__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .plate-car__arrow {
    flex-basis: 34px;
    height: 34px;
  }
}

/*--------------------------------------------------------------
# /perevirka-avto-po-nomeru
--------------------------------------------------------------*/

.plate-content {
  max-width: 820px;
  margin: 0 auto;
}

.plate-content h2 {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 40px 0 14px;
  color: #172a28;
}

.plate-content p,
.plate-content li {
  font-size: 1.02rem;
  line-height: 1.65;
}

.plate-content ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.plate-content a {
  color: #008374;
  font-weight: 500;
  text-decoration: underline;
}

.plate-faq__item {
  border: 1px solid #dfe6e5;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: #ffffff;
}

.plate-faq__item summary {
  font-family: var(--heading-font);
  font-weight: 700;
  color: #172a28;
  cursor: pointer;
}

.plate-faq__item[open] summary {
  margin-bottom: 8px;
}

.plate-faq__item p {
  margin: 0;
}

.plate-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 32px;
}

.plate-content h3 {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 24px 0 10px;
  color: #172a28;
}

.plate-content .plate-disclaimer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid #e7eceb;
  font-size: 0.85rem;
  color: #7a8a88;
}
