:root {
  --w-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --w-dur: 0.24s;
  --z-cookie: 620;
  --z-chat-launcher: 630;
  --z-chat-panel: 631;
  --z-global-search: 625;
  --cookie-bar-h: 0px;
}

body.is-modal-open .chat-launcher,
body.is-modal-open .chat-panel {
  z-index: 140;
}

body.is-chat-open {
  overflow: hidden;
}

body.has-cookie-bar {
  --cookie-bar-h: 96px;
  padding-bottom: var(--cookie-bar-h);
}

input[type="search"].global-search__input::-webkit-search-decoration,
input[type="search"].global-search__input::-webkit-search-cancel-button,
input[type="search"].global-search__input::-webkit-search-results-button,
input[type="search"].global-search__input::-webkit-search-results-decoration {
  display: none;
  appearance: none;
}

.site-search__toggle[aria-expanded="true"] {
  border-color: rgba(25, 118, 210, 0.25);
  background: #e3f2fd;
  color: #1565c0;
}

.global-search__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(360px, 52vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(188, 204, 220, 0.8);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(16, 42, 67, 0.14);
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--w-dur) var(--w-ease),
    transform var(--w-dur) var(--w-ease),
    visibility 0s linear var(--w-dur);
  z-index: var(--z-global-search);
}

.global-search__panel.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.global-search__item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #102a43;
  text-align: left;
  text-decoration: none;
}

.global-search__item:hover,
.global-search__item:focus {
  background: #eef6ff;
  outline: none;
}

.global-search__item-title {
  font-weight: 700;
}

.global-search__item-snippet,
.global-search__hint {
  font-size: 13px;
  color: #5d6d7e;
}

.global-search__hint {
  padding: 12px 14px 6px;
}

.site-cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-cookie);
  background: #102a43;
  color: #fff;
  padding: 16px 20px;
  box-shadow: 0 -10px 30px rgba(16, 42, 67, 0.2);
  transition:
    transform 0.32s var(--w-ease),
    opacity 0.32s var(--w-ease);
}

.site-cookie-bar.is-hiding {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.site-cookie-bar__inner {
  width: min(100%, 1200px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
}

.site-cookie-bar p {
  margin: 0;
  flex: 1 1 320px;
}

.site-cookie-bar a {
  color: #bbdefb;
}

.site-cookie-bar .btn--secondary {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
}

.site-cookie-bar .btn--ghost {
  color: rgba(255, 255, 255, 0.82);
}

.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--cookie-bar-h));
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(25, 118, 210, 0.3);
  z-index: var(--z-chat-launcher);
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: calc(92px + var(--cookie-bar-h));
  width: min(400px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid rgba(188, 204, 220, 0.8);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 50px rgba(16, 42, 67, 0.22);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity var(--w-dur) var(--w-ease),
    transform var(--w-dur) var(--w-ease),
    visibility 0s linear var(--w-dur);
  z-index: var(--z-chat-panel);
}

.chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eef6ff, #fff3e0);
  border-bottom: 1px solid rgba(188, 204, 220, 0.8);
}

.chat-panel__title {
  margin: 0;
  font-size: 16px;
  color: #102a43;
}

.chat-panel__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #5d6d7e;
  cursor: pointer;
  font-size: 22px;
}

.chat-panel__messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg--bot {
  align-self: flex-start;
  background: #eef6ff;
  color: #102a43;
  border-bottom-left-radius: 4px;
}

.chat-msg--bot a {
  color: #1565c0;
  font-weight: 700;
}

.chat-typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef6ff;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5d6d7e;
  animation: chatDot 1s ease-in-out infinite;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatDot {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chat-panel__form {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(188, 204, 220, 0.8);
  background: #f8fbff;
}

.chat-panel__form input {
  flex: 1;
  min-width: 0;
}

.chat-panel__send {
  min-width: 92px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffa726, #fb8c00);
  color: #102a43;
  font-weight: 700;
  cursor: pointer;
}

.custom-checkbox {
  position: relative;
  display: inline-grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  cursor: pointer;
  color: var(--c-neutral-900);
}

.custom-checkbox__input,
.custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-checkbox__ui {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid rgba(13, 71, 161, 0.34);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  transform: translateZ(0);
}

.custom-checkbox__bg,
.custom-checkbox__check,
.custom-select__dropdown,
.custom-select__option,
.custom-select__chev {
  will-change: transform, opacity;
}

.custom-checkbox__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(25, 118, 210, 0.14),
    rgba(255, 167, 38, 0.24)
  );
  opacity: 0;
  transition: opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-checkbox__check {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 12px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  opacity: 0;
  transform: translate(-50%, -62%) scale(0.45) rotate(12deg);
  transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-checkbox__text {
  min-width: 0;
}

.custom-checkbox.is-checked .custom-checkbox__ui {
  border-color: rgba(13, 71, 161, 0.72);
  background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-500));
}

.custom-checkbox.is-checked .custom-checkbox__bg {
  opacity: 1;
}

.custom-checkbox.is-checked .custom-checkbox__check {
  opacity: 1;
  transform: translate(-50%, -62%) scale(1) rotate(45deg);
}

.custom-checkbox.is-disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.custom-checkbox:focus-visible {
  outline: 2px solid var(--c-primary-600);
  outline-offset: 4px;
  border-radius: 12px;
}

.custom-select {
  position: relative;
}

.custom-select__trigger {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--c-neutral-100);
  border-radius: 14px;
  background: var(--c-neutral-0);
  color: var(--c-neutral-900);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform: translateZ(0);
  transition:
    border-color 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select__trigger:hover {
  border-color: rgba(25, 118, 210, 0.32);
  background: #fbfdff;
}

.custom-select__trigger:focus-visible {
  outline: 2px solid var(--c-primary-600);
  outline-offset: 3px;
}

.custom-select__trigger.is-placeholder {
  color: var(--c-neutral-500);
}

.custom-select.is-open .custom-select__trigger {
  border-color: rgba(25, 118, 210, 0.45);
  box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.12);
}

.custom-select.is-disabled .custom-select__trigger {
  cursor: not-allowed;
  opacity: 0.7;
}

.custom-select__value {
  min-width: 0;
}

.custom-select__chev {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.7;
  transform: rotate(45deg);
  transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select.is-open .custom-select__chev {
  opacity: 1;
  transform: rotate(225deg);
}

.custom-select__dropdown {
  --dropdown-shift: 8px;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: 100%;
  padding: 8px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(188, 204, 220, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(16, 42, 67, 0.16);
  opacity: 0;
  transform: translate3d(0, var(--dropdown-shift), 0);
  pointer-events: none;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(25, 118, 210, 0.45) rgba(227, 242, 253, 0.7);
  transition:
    opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select.is-open-up .custom-select__dropdown {
  --dropdown-shift: -8px;
  top: auto;
  bottom: calc(100% + 8px);
}

.custom-select.is-open .custom-select__dropdown {
  pointer-events: auto;
}

.custom-select.is-ready .custom-select__dropdown {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.custom-select__dropdown::-webkit-scrollbar {
  width: 10px;
}

.custom-select__dropdown::-webkit-scrollbar-track {
  background: rgba(227, 242, 253, 0.72);
  border-radius: 999px;
}

.custom-select__dropdown::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(25, 118, 210, 0.7),
    rgba(21, 101, 192, 0.82)
  );
  border-radius: 999px;
  border: 2px solid rgba(227, 242, 253, 0.72);
}

.custom-select__option {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--c-neutral-900);
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition:
    background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: calc(var(--option-index, 0) * 0.03s);
}

.custom-select.is-ready .custom-select__option {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.custom-select__option:hover,
.custom-select__option.is-highlighted {
  background: rgba(227, 242, 253, 0.95);
  color: var(--c-primary-700);
}

.custom-select__option.is-selected {
  background: linear-gradient(
    135deg,
    rgba(13, 71, 161, 0.96),
    rgba(21, 101, 192, 0.96)
  );
  color: #ffffff;
}

.custom-select__option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 640px) {
  .chat-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    right: 0;
    bottom: 0;
  }

  .chat-launcher {
    right: 16px;
    bottom: calc(16px + var(--cookie-bar-h));
  }
}
