html:has(.contact-dialog[open]) { overflow: hidden; }

.contact-dialog {
  --contact-travel: 100dvh;
  --contact-blue: #2654ff;
  --contact-field-border: #d9dfee;
  --contact-field-surface: rgb(255 255 255 / 60%);
  --contact-field-shadow: 0 3px 7px rgb(50 82 166 / 6%);
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(400px, calc(100% - 32px), calc((100dvh - 32px) * 7 / 9));
  height: auto;
  aspect-ratio: 7 / 9;
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 92%);
  border-radius: 17px;
  background:
    radial-gradient(ellipse 92% 34% at 97% 1%, #cbd8fb 0%, #e8edfc 49%, transparent 100%),
    linear-gradient(157deg, #f4f7ff 0%, #fafbfd 53%, #f2f5fe 100%);
  box-shadow: 0 16px 48px rgb(17 26 56 / 29%), inset 0 0 8px #fff;
  color: #182235;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.contact-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  animation: contact-slide-in .52s cubic-bezier(.32,.72,.29,1) both;
}
.contact-dialog[open].is-closing { animation: contact-slide-out .43s cubic-bezier(.5,.05,.8,.55) both; pointer-events: none; }
.contact-dialog::backdrop { background: rgb(25 34 56 / 70%); }
.contact-dialog[open]::backdrop { animation: contact-backdrop-in .25s ease both; }
.contact-dialog[open].is-closing::backdrop { animation: contact-backdrop-out .43s ease both; }

.contact-dialog-panel { position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 25px clamp(16px, 5.5vw, 23px) 40px; }
.contact-wave { position: absolute; z-index: -1; left: 0; display: block; width: 100%; pointer-events: none; }
.contact-wave-top { top: 0; height: 114px; opacity: .85; }
.contact-wave-bottom { bottom: 0; height: 46px; }
.contact-heading { margin-bottom: 12px; }
.contact-dialog-panel h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 34px 8px 0;
  color: #141e30;
  font-size: clamp(22px, 6.7vw, 29px);
  font-weight: 750;
  line-height: 1.15;
}
.contact-dialog-panel h2:lang(en) { font-size: clamp(21px, 6vw, 28px); }
.contact-heading p { margin: 0; color: #5d687c; font-size: clamp(11px, 3.35vw, 14px); line-height: 1.45; }
.contact-icon {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-heading-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 33px;
  border-radius: 8px;
  background: radial-gradient(ellipse at 25% 110%, #83abff, transparent 55%), linear-gradient(135deg, #5691ff, #2358f6 48%, #2456f0);
  box-shadow: inset 0 1px 5px #b8ccff, 0 2px 9px rgb(39 95 238 / 23%);
  color: #fff;
}
.contact-heading-icon svg { width: 23px; height: 23px; }
.contact-dialog-close {
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #566176;
  cursor: pointer;
}
.contact-dialog-close:hover, .contact-dialog .contact-dialog-close:focus-visible { outline: none; background: #eef1f6; }
.contact-dialog-close svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.contact-form { display: grid; flex: 1; align-content: space-evenly; gap: 14px; }
.contact-dialog [hidden] { display: none; }
.contact-field, .contact-message-field { position: relative; }
.contact-field-icon { position: absolute; z-index: 1; top: 11px; left: 12px; color: #626d81; pointer-events: none; }
.contact-form input[type="tel"], .contact-message-field {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  border: 1px solid var(--contact-field-border);
  border-radius: 10px;
  background: var(--contact-field-surface);
  box-shadow: var(--contact-field-shadow);
}
.contact-form input[type="tel"], .contact-form textarea {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 10px 12px 10px 41px;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.contact-form input[type="tel"] { min-height: 40px; padding-block: 6px; }
.contact-message-field { overflow: hidden; }
.contact-form input[type="tel"]::placeholder, .contact-form textarea::placeholder { color: #5d687b; }
.contact-form input[type="tel"]::placeholder { font-size: 14px; }
.contact-form input[type="tel"]:focus, .contact-message-field:focus-within {
  outline: none;
  border-color: var(--contact-blue);
  box-shadow: 0 0 0 2px rgb(38 84 255 / 12%);
}
.contact-form input[type="tel"][aria-invalid="true"] { border-color: #d92d20; box-shadow: none; }
.contact-field-error { margin: 6px 0 0; color: #b42318; font-size: 13px; }
.contact-field-error:empty { margin: 0; }
.contact-form textarea { display: block; height: 104px; padding-bottom: 3px; border: 0; background: transparent; resize: none; }
.contact-form textarea::placeholder { font-size: 14px; }
.contact-form textarea:focus { outline: none; }
.contact-type-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; }
.contact-type-row:lang(en) { grid-template-columns: minmax(0, 1fr) minmax(max-content, 1.25fr) minmax(0, 1fr); }
.contact-type-row label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1.6vw, 8px);
  min-height: 40px;
  padding: 6px 4px;
  border: 1px solid var(--contact-field-border);
  border-radius: 10px;
  background: var(--contact-field-surface);
  box-shadow: var(--contact-field-shadow);
  font-size: clamp(11px, 3.5vw, 13px);
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.contact-type-row label > .contact-icon { color: #5b6679; }
.contact-type-row label:lang(en) > .contact-icon { width: 14px; height: 14px; }
.contact-type-row label:has(input:checked) { border-color: var(--contact-blue); background: #eaf0ff; box-shadow: 0 4px 9px rgb(38 84 255 / 13%); }
.contact-type-row label:has(input:checked) > .contact-icon { color: var(--contact-blue); }
.contact-type-row label:has(input:focus-visible) { outline: 2px solid var(--contact-blue); outline-offset: 2px; }
.contact-option-check {
  position: absolute;
  top: -4px;
  right: -3px;
  display: none;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: #2d62f4;
  color: #fff;
}
.contact-option-check svg { width: 12px; height: 12px; stroke-width: 2.7; }
.contact-type-row label:has(input:checked) .contact-option-check { display: grid; }
.contact-count { display: block; padding: 0 10px 7px; color: #637089; font-size: 12px; line-height: 16px; text-align: right; }
.contact-slide {
  --thumb-width: 40px;
  --track-height: 44px;
  --slide-travel: calc(100% - var(--thumb-width));
  --thumb-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232957ff' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 5 7 7-7 7m8-14 7 7-7 7'/%3E%3C/svg%3E");
  position: relative;
  height: var(--track-height);
  border-radius: 999px;
  background: linear-gradient(105deg, #edf1ff, #dce5fc);
}
.contact-slide-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--thumb-width) + var(--slide-travel) * var(--contact-slider-position, 0));
  border-radius: inherit;
  background: radial-gradient(ellipse at 79% 0, rgb(143 177 255 / 62%), transparent 55%), linear-gradient(102deg, #1749f2, #2d60f7 63%, #4e79fa);
  box-shadow: inset 0 2px 5px rgb(255 255 255 / 39%), 0 6px 12px rgb(45 84 222 / 24%);
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
.contact-slide.has-progress .contact-slide-fill { visibility: visible; }
.contact-slide-target {
  position: absolute;
  inset-block: 6px;
  left: calc(var(--thumb-width) / 2 + var(--slide-travel) * var(--contact-slider-target, 0));
  width: calc(var(--thumb-width) + 2px);
  border: 1px dashed #8199e7;
  border-radius: 999px;
  background: rgb(159 179 247 / 23%);
  opacity: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.contact-slide.is-dragging .contact-slide-target,
.contact-slide:has(input:focus-visible) .contact-slide-target { opacity: .72; }
.contact-slide input {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: var(--track-height);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.contact-slide input:active { cursor: grabbing; }
.contact-slide input:disabled { opacity: .48; cursor: default; }
.contact-slide-label {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  inset: 0 auto 0 calc(var(--thumb-width) + 14px);
  width: max-content;
  color: #3b5394;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}
.contact-slide-fill .contact-slide-label { color: #fff; }
.contact-slide-label:lang(en) { font-size: 13px; }
.contact-slide-label svg { width: 19px; height: 19px; }
.contact-slide input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: var(--thumb-width);
  height: var(--thumb-width);
  box-sizing: border-box;
  border: 2px solid #5281ff;
  border-radius: 999px;
  background: #fff var(--thumb-image) center / 19px 19px no-repeat;
  box-shadow: 0 2px 7px rgb(26 64 191 / 30%);
}
.contact-slide input::-moz-range-thumb {
  width: var(--thumb-width);
  height: var(--thumb-width);
  box-sizing: border-box;
  border: 2px solid #5281ff;
  border-radius: 999px;
  background: #fff var(--thumb-image) center / 19px 19px no-repeat;
  box-shadow: 0 2px 7px rgb(26 64 191 / 30%);
}
.contact-a11y { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.contact-status { margin: 10px 0 0; font-size: 14px; color: #304363; }
.contact-status:empty { margin: 0; }
.contact-retry { margin-top: 8px; padding: 6px 0; border: 0; background: transparent; color: #1e43cc; text-decoration: underline; cursor: pointer; }
.contact-dialog[open].is-success {
  display: block;
  inset: max(16px, env(safe-area-inset-top)) 0 auto;
  width: min(420px, calc(100% - 32px));
  height: fit-content;
  aspect-ratio: auto;
  margin: 0 auto;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  animation: none;
}
.contact-success { outline: none; }
.contact-success p {
  margin: 0;
  padding: 16px 18px;
  color: #175b42;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
}
.contact-success-progress { height: 4px; background: #dcefe6; }
.contact-success-progress::after {
  display: block;
  height: 100%;
  background: #239565;
  content: "";
  transform-origin: left;
  animation: contact-success-countdown var(--contact-success-duration) linear both;
}

@keyframes contact-success-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes contact-slide-in { from { transform: translateY(var(--contact-travel)); } to { transform: translateY(0); } }
@keyframes contact-slide-out { from { transform: translateY(0); } to { transform: translateY(var(--contact-travel)); } }
@keyframes contact-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes contact-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@media (max-width: 700px) {
  .contact-dialog {
    width: min(calc(100% - 16px), 420px, calc((100dvh - 24px) * 7 / 9));
    max-height: calc(100dvh - 24px);
  }
}
@media (max-width: 360px), (max-height: 560px) {
  .contact-dialog-panel { padding-top: 20px; padding-bottom: 32px; }
  .contact-type-row { gap: 6px; }
  .contact-type-row label:lang(en) { gap: 3px; font-size: 11px; }
  .contact-slide-label { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-dialog[open], .contact-dialog[open].is-closing, .contact-dialog[open]::backdrop, .contact-dialog[open].is-closing::backdrop { animation: none; }
}
