@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700;800&display=swap");

.tricolor-form {
  --tri-bg: #46555c;
  --tri-field-bg: #ffffff;
  --tri-field-text: #46555c;
  --tri-label: #ffffff;
  --tri-border: rgba(255, 255, 255, 0.45);
  --tri-muted: rgba(255, 255, 255, 0.82);
  --tri-accent: #41b4e7;
  --tri-accent-dark: #229bd0;
  --tri-panel: #ffffff;
  background: var(--tri-bg);
  border-radius: 14px;
  color: var(--tri-label);
  font-family: "Rubik", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0 auto;
  max-width: 940px;
  padding: clamp(16px, 3vw, 26px);
  width: 100%;
}

.tricolor-form *,
.tricolor-form *::before,
.tricolor-form *::after {
  box-sizing: border-box;
}

.tricolor-form__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.tricolor-form__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  position: relative;
}

.tricolor-form__field {
  grid-column: span 3;
}

.tricolor-form__field--third {
  grid-column: span 2;
}

.tricolor-form__field--wide {
  grid-column: 1 / -1;
}

.tricolor-form label,
.tricolor-form legend {
  color: var(--tri-label);
  font-size: 13px;
  font-weight: 700;
}

.tricolor-form input,
.tricolor-form select,
.tricolor-form textarea {
  background: var(--tri-field-bg);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--tri-field-text);
  font: inherit;
  min-height: 42px;
  padding: 9px 12px;
  width: 100%;
}

.tricolor-form input::placeholder,
.tricolor-form textarea::placeholder {
  color: rgba(70, 85, 92, 0.62);
}

.tricolor-form textarea {
  line-height: 1.5;
  min-height: 170px;
  resize: vertical;
}

.tricolor-form input:focus,
.tricolor-form select:focus,
.tricolor-form textarea:focus {
  border-color: var(--tri-accent);
  outline: 3px solid rgba(255, 255, 255, 0.28);
}

.tricolor-form input[type="file"] {
  color: var(--tri-field-text);
  padding: 10px 12px;
}

#tri-resource-slot input[type="file"] {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.tricolor-form__dropzone {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px dashed rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 96px;
  padding: 18px 16px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.tricolor-form__dropzone:hover,
.tricolor-form__dropzone.is-dragover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
}

.tricolor-form__drop-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.tricolor-form__drop-meta,
.tricolor-form__file-name {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.tricolor-form__file-name:not(:empty) {
  color: #ffffff;
  font-weight: 700;
  margin-top: 3px;
}

.tricolor-form__phone {
  display: grid;
  grid-template-columns: 1fr;
}

.tricolor-form__suggestions {
  background: var(--tri-panel);
  border: 1px solid rgba(70, 85, 92, 0.16);
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(18, 28, 35, 0.22);
  color: var(--tri-field-text);
  display: none;
  left: 0;
  max-height: 340px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.tricolor-form__suggestions.is-open {
  display: block;
}

.tricolor-form__company-line {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
}

.tricolor-form__no-company {
  align-self: stretch;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 42px;
  padding: 8px 12px;
  width: auto;
}

.tricolor-form__no-company:hover,
.tricolor-form__no-company:focus {
  background: #41b4e7;
  border-color: #41b4e7;
  outline: none;
}

.tricolor-form__no-company[hidden] {
  display: none;
}

.tricolor-form__selected-company {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(70, 85, 92, 0.12);
  border-radius: 10px;
  color: var(--tri-field-text);
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) 40px;
  min-height: 64px;
  padding: 10px 12px;
}

.tricolor-form__selected-company[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .tricolor-form__company-line {
    grid-template-columns: 1fr;
  }

  .tricolor-form__no-company {
    width: 100%;
  }
}

.tricolor-form__selected-text {
  min-width: 0;
}

.tricolor-form__edit-company {
  align-items: center;
  background: #eef3f5;
  border: 0;
  border-radius: 999px;
  color: #46555c;
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.tricolor-form__edit-company:hover,
.tricolor-form__edit-company:focus {
  background: #41b4e7;
  color: #ffffff;
  outline: none;
}

.tricolor-form__suggestion {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e9edf0;
  color: var(--tri-field-text);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, auto);
  min-height: 64px;
  max-width: 100%;
  overflow: hidden;
  padding: 11px 13px;
  text-align: left;
  width: 100%;
}

.tricolor-form__suggestion > span:nth-child(2) {
  min-width: 0;
}

.tricolor-form__suggestion:hover,
.tricolor-form__suggestion:focus {
  background: #f5f7f8;
  color: var(--tri-field-text);
  outline: none;
}

.tricolor-form__suggestion:hover *,
.tricolor-form__suggestion:focus * {
  color: inherit;
}

.tricolor-form__suggestion:hover .tricolor-form__company-meta,
.tricolor-form__suggestion:focus .tricolor-form__company-meta {
  color: rgba(70, 85, 92, 0.74);
}

.tricolor-form__suggestion:hover .tricolor-form__badge,
.tricolor-form__suggestion:focus .tricolor-form__badge {
  color: #46555c;
}

.tricolor-form__suggestion:hover .tricolor-form__location-pill,
.tricolor-form__suggestion:focus .tricolor-form__location-pill {
  background: #41b4e7;
  color: #ffffff;
}

.tricolor-form__suggestion:hover .tricolor-form__legal-pill,
.tricolor-form__suggestion:focus .tricolor-form__legal-pill {
  background: #eef2f3;
  color: #46555c;
}

.tricolor-form__suggestion:hover .tricolor-form__location-pill *,
.tricolor-form__suggestion:focus .tricolor-form__location-pill * {
  color: #ffffff;
}

.tricolor-form__suggestion:hover .tricolor-form__legal-pill *,
.tricolor-form__suggestion:focus .tricolor-form__legal-pill * {
  color: #46555c;
}

.tricolor-form__suggestion--create {
  border-bottom: 0;
  background: #f8fbfc;
  border-top: 1px solid #dbe5ea;
}

.tricolor-form__suggestion--create .tricolor-form__logo {
  background: #41b4e7;
  color: #ffffff;
}

.tricolor-form__logo {
  align-items: center;
  background: #edf1f3;
  border-radius: 10px;
  color: #46555c;
  display: flex;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  overflow: hidden;
  width: 44px;
}

.tricolor-form__logo-wrap {
  align-items: center;
  display: grid;
  gap: 3px;
  justify-items: center;
  width: 44px;
}

.tricolor-form__logo-source {
  color: rgba(70, 85, 92, 0.68);
  display: block;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  max-width: 96px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tricolor-form__logo img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.tricolor-form__company-name {
  display: block;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tricolor-form__location-pill {
  align-items: center;
  background: #46555c;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 400;
  gap: 2px;
  line-height: 18px;
  max-width: 100%;
  height: 18px;
  padding: 0 6px;
  vertical-align: middle;
}

.tricolor-form__location-icon {
  display: inline-block;
  font-size: 9px;
  line-height: 1;
  transform: translateY(1px);
}

.tricolor-form__legal-pill {
  align-items: center;
  background: #edf1f3;
  border-radius: 999px;
  color: #46555c;
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 10px;
  font-weight: 400;
  line-height: 18px;
  max-width: min(100%, 220px);
  height: 18px;
  overflow-wrap: anywhere;
  padding: 0 6px;
  vertical-align: middle;
  word-break: break-word;
}

.tricolor-form__company-meta-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin-top: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tricolor-form__company-meta-row > * {
  align-self: center;
}

.tricolor-form__company-meta {
  color: rgba(70, 85, 92, 0.74);
  display: inline;
  flex: 1 1 180px;
  font-size: 12px;
  line-height: 1.35;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tricolor-form__badge {
  background: #eef2f3;
  border-radius: 999px;
  color: #46555c;
  font-size: 12px;
  font-weight: 700;
  max-width: 96px;
  overflow: hidden;
  padding: 5px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tricolor-form__debug-badge {
  align-items: flex-end;
  display: grid;
  gap: 3px;
  justify-items: end;
  max-width: 108px;
  min-width: 0;
  overflow: hidden;
}

.tricolor-form__score {
  color: rgba(70, 85, 92, 0.68);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tricolor-form__suggestion:hover .tricolor-form__score,
.tricolor-form__suggestion:focus .tricolor-form__score {
  color: rgba(70, 85, 92, 0.72);
}

.tricolor-form__notice {
  color: var(--tri-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.tricolor-form__notice a {
  color: #ffffff;
  font-weight: 700;
}

.tricolor-form__consent {
  align-items: flex-start;
  color: var(--tri-label);
  display: flex;
  gap: 10px;
}

.tricolor-form__footer {
  align-items: start;
  display: grid;
  gap: 12px 18px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
}

.tricolor-form__rgpd {
  display: grid;
  gap: 12px;
  grid-column: 1;
}

.tricolor-form__resources-inline {
  grid-column: 2;
}

.tricolor-form__footer .tricolor-form__submit {
  grid-column: 1 / -1;
  justify-self: start;
}

.tricolor-form__footer .tricolor-form__status,
.tricolor-form__footer .tricolor-form__debug {
  grid-column: 1 / -1;
}

.tricolor-form__consent input {
  accent-color: var(--tri-accent);
  margin-top: 3px;
  min-height: auto;
  width: auto;
}

.tricolor-form__submit {
  align-self: flex-start;
  background: var(--tri-accent);
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 44px;
  padding: 11px 22px;
}

.tricolor-form__submit:hover {
  background: var(--tri-accent-dark);
}

.tricolor-form__submit[disabled] {
  cursor: wait;
  opacity: 0.68;
}

.tricolor-form__status {
  color: var(--tri-label);
  font-size: 14px;
  min-height: 20px;
}

.tricolor-form__sending[hidden] {
  display: none;
}

.tricolor-form__sending {
  align-items: center;
  color: #ffffff;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 12px;
  grid-column: 1 / -1;
}

.tricolor-form.is-sending {
  cursor: wait;
}

.tricolor-form.is-sending input,
.tricolor-form.is-sending select,
.tricolor-form.is-sending textarea,
.tricolor-form.is-sending button,
.tricolor-form.is-sending .tricolor-form__dropzone {
  opacity: 0.72;
}

.tricolor-form__mail-flight {
  display: inline-block;
  height: 34px;
  position: relative;
  width: 72px;
}

.tricolor-form__mail-letter {
  animation: tricolor-mail-flight 1.35s ease-in-out infinite;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 rgba(70, 85, 92, 0.12);
  height: 20px;
  left: 4px;
  position: absolute;
  top: 8px;
  width: 30px;
}

.tricolor-form__mail-letter::before,
.tricolor-form__mail-letter::after {
  border-top: 10px solid rgba(65, 180, 231, 0.32);
  content: "";
  height: 0;
  position: absolute;
  top: 0;
  width: 0;
}

.tricolor-form__mail-letter::before {
  border-right: 15px solid transparent;
  left: 0;
}

.tricolor-form__mail-letter::after {
  border-left: 15px solid transparent;
  right: 0;
}

.tricolor-form__mail-bird {
  animation: tricolor-bird-wing 0.72s ease-in-out infinite;
  border: 2px solid #ffffff;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 14px 0 0;
  height: 18px;
  position: absolute;
  right: 8px;
  top: 6px;
  transform: rotate(-20deg);
  transform-origin: left bottom;
  width: 28px;
}

.tricolor-form__mail-bird::after {
  border: 2px solid #ffffff;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 12px 0 0;
  content: "";
  height: 14px;
  left: -18px;
  position: absolute;
  top: 8px;
  transform: rotate(-20deg);
  width: 22px;
}

.tricolor-form--thanks {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 260px;
  padding: clamp(28px, 5vw, 54px);
  text-align: center;
}

.tricolor-form--thanks h2 {
  color: #ffffff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.18;
  margin: 10px 0 0;
}

.tricolor-form--thanks p {
  color: var(--tri-muted);
  font-size: 16px;
  line-height: 1.5;
  margin: 8px 0 0;
}

.tricolor-form__thanks-icon {
  height: 58px;
  position: relative;
  width: 96px;
}

.tricolor-form__thanks-icon .tricolor-form__mail-letter {
  animation: none;
  left: 30px;
  top: 22px;
}

.tricolor-form__thanks-icon .tricolor-form__mail-bird {
  animation: none;
  right: 8px;
  top: 8px;
}

@keyframes tricolor-mail-flight {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(5px) rotate(-4deg);
  }
  18% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(38px) translateY(-8px) rotate(8deg);
  }
}

@keyframes tricolor-bird-wing {
  0%,
  100% {
    transform: rotate(-28deg);
  }
  50% {
    transform: rotate(-2deg);
  }
}

.tricolor-form__debug {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--tri-border);
  border-radius: 10px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.45;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.tricolor-hs-hidden {
  height: 1px;
  left: -9999px;
  overflow: hidden;
  position: absolute;
  top: auto;
  width: 1px;
}

.tricolor-form__hs-file label,
.tricolor-form__hs-file legend {
  display: none;
}

@media (max-width: 720px) {
  .tricolor-form {
    border-radius: 10px;
    padding: 18px;
  }

  .tricolor-form__grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .tricolor-form__field,
  .tricolor-form__field--third,
  .tricolor-form__field--wide {
    grid-column: 1;
  }

  .tricolor-form__suggestion {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .tricolor-form__badge {
    grid-column: 2;
    justify-self: start;
  }

  .tricolor-form__submit {
    width: 100%;
  }

  .tricolor-form__footer {
    grid-template-columns: 1fr;
  }

  .tricolor-form__rgpd,
  .tricolor-form__resources-inline,
  .tricolor-form__footer .tricolor-form__submit,
  .tricolor-form__footer .tricolor-form__status,
  .tricolor-form__footer .tricolor-form__debug {
    grid-column: 1;
    grid-row: auto;
  }
}
