/* Custom form dropdown — replaces the native OS select panel. */

.t-select {
  position: relative;
  width: 100%;
}

.t-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background: none !important;
}

.t-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  font: inherit;
  text-align: left;
  color: var(--ink, var(--color--dark-blue, #081122));
  background: transparent;
  cursor: pointer;
}

.t-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-select.is-placeholder .t-select-value {
  color: #8b90a0;
}

.t-select-chevron {
  flex: none;
  color: #5c6270;
  transition: transform 0.18s ease;
}

.t-select.is-open .t-select-chevron {
  transform: rotate(180deg);
}

.t-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line, #e4e7ee);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(8, 17, 34, 0.12);
}

.t-select.is-up .t-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.t-select-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink, var(--color--dark-blue, #081122));
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.t-select-option:hover,
.t-select-option.is-active {
  background: var(--accent-soft, var(--color--accent-soft, #ece8f6));
}

.t-select-option.is-selected {
  color: var(--accent, var(--color--accent, #6746b5));
  font-weight: 500;
}

.t-select-trigger:focus-visible {
  outline: 2px solid var(--accent, var(--color--accent, #6746b5));
  outline-offset: 2px;
}

/* Promo form — underline field */
.t-select.is-underline .t-select-trigger {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line, #e4e7ee);
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink, #081122);
  transition: border-color 0.18s ease;
}

.t-select.is-underline.is-open .t-select-trigger,
.t-select.is-underline .t-select-trigger:focus-visible {
  outline: none;
  border-bottom-color: var(--accent, #6746b5);
}

.t-select.is-underline.is-invalid .t-select-trigger {
  border-bottom-color: #c0392b;
}

.form-card .t-select-menu {
  right: 0;
}

/* Contact form — boxed field */
.t-select.is-boxed .t-select-trigger {
  height: 52px;
  padding: 0 14px;
  border: 1px solid #d8dbe3;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  line-height: 24px;
}

.t-select.is-boxed.is-open .t-select-trigger,
.t-select.is-boxed .t-select-trigger:focus-visible {
  outline: none;
  border-color: var(--color--dark-blue, #081122);
}

.t-select.is-boxed.is-invalid .t-select-trigger {
  border-color: #8a3a3a;
}

/* Phone country code */
.t-select.is-compact {
  width: auto;
  min-width: 88px;
}

.t-select.is-compact .t-select-trigger {
  height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
}

.t-select.is-compact .t-select-trigger:focus-visible,
.t-select.is-compact.is-open .t-select-trigger {
  outline: none;
}

.t-select.is-compact .t-select-menu {
  left: 0;
  right: auto;
  min-width: 168px;
  width: max-content;
}

.ct-phone-cc:has(.t-select)::after {
  content: none;
}

.ct-phone:has(.t-select.is-open),
.ct-phone:has(.t-select-trigger:focus-visible) {
  border-color: var(--color--dark-blue, #081122);
}
