@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:wght@500;600&display=swap");

:root {
  --project-modal-accent: #bffe08;
  --project-modal-ink: #141414;
  --project-modal-bg: #f4f4f4;
  --project-modal-surface: #fff;
  --project-modal-muted: rgba(20, 20, 20, .62);
  --project-modal-error: #85483e;
  --project-modal-ease: var(--motion-ease-out, cubic-bezier(.23, 1, .32, 1));
  --project-modal-panel-pad: clamp(28px, 3.2vw, 48px);
}

.project-modal,
.project-modal * { box-sizing: border-box; }

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  color: var(--project-modal-ink);
  font-family: "Inter Tight", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
}

.project-modal[hidden] { display: none; }
.project-modal [hidden] { display: none !important; }

.project-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  opacity: 0;
}

.project-modal__dialog {
  position: relative;
  width: min(1180px, 100%);
  height: min(640px, 90dvh);
  max-height: 90dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(320px, .78fr) minmax(0, 1.22fr);
  gap: 10px;
  padding: 10px;
  border-radius: 35px;
  background: var(--project-modal-bg);
  box-shadow: 0 32px 100px rgba(0, 0, 0, .28);
  opacity: 0;
  transform: translateY(18px) scale(.985);
}

.project-modal[data-open] .project-modal__overlay { opacity: 1; }
.project-modal[data-open] .project-modal__dialog { opacity: 1; transform: none; }

.project-modal__close {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  background: #e9e9e7;
  color: var(--project-modal-ink);
  font-family: inherit;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.project-modal__close:hover { background: #dededb; }
.project-modal__close:active { transform: scale(.96); }

.project-modal__aside,
.project-modal__form-panel {
  min-width: 0;
  min-height: 0;
  border-radius: 25px;
}

.project-modal__aside {
  padding: var(--project-modal-panel-pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 42px;
  background: var(--project-modal-ink);
  color: #faf9fd;
}

.project-modal__intro { display: grid; gap: 18px; }

.project-modal__eyebrow {
  margin: 0;
  color: var(--project-modal-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.03em;
  text-transform: uppercase;
}

.project-modal__title {
  max-width: 470px;
  margin: 0;
  font-size: clamp(42px, 4.2vw, 66px);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.project-modal__lead {
  max-width: 440px;
  margin: 0;
  color: rgba(250, 249, 253, .66);
  font-size: 16px;
  line-height: 1.48;
  letter-spacing: -.035em;
}

.project-modal__benefits { display: grid; gap: 8px; }

.project-modal__benefit {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-radius: 16px;
  background: #222;
  color: rgba(250, 249, 253, .78);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.03em;
}

.project-modal__benefit:first-child {
  background: var(--project-modal-accent);
  color: var(--project-modal-ink);
}

.project-modal__form-panel {
  display: flex;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--project-modal-panel-pad);
  background: var(--project-modal-surface);
  scrollbar-gutter: stable;
}

.project-form { width: 100%; min-height: 0; display: grid; gap: 14px; }
.project-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.project-field { min-width: 0; display: grid; align-content: start; gap: 4px; }
.project-field--full { grid-column: 1 / -1; }

.project-field label,
.project-field__legend {
  margin: 0;
  color: var(--project-modal-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.project-field input,
.project-field select,
.project-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  background: var(--project-modal-bg);
  color: var(--project-modal-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.035em;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.project-field input,
.project-field select {
  height: 48px;
  border-radius: 60px;
  padding: 0 18px;
}

.project-field select {
  appearance: auto;
  cursor: pointer;
}

.project-select {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.project-select[data-open] { z-index: 20; }

.project-select .project-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.project-select__trigger {
  position: relative;
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 60px;
  padding: 0 50px 0 18px;
  background: var(--project-modal-bg);
  color: var(--project-modal-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.035em;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-select__trigger:hover { background: #eeeeec; }

.project-select__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-select__chevron {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 8px;
  height: 8px;
  margin-top: -5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transform-origin: 62% 62%;
  transition: transform 220ms var(--project-modal-ease);
  pointer-events: none;
}

.project-select[data-open] .project-select__chevron { transform: rotate(225deg); }

.project-select__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 2;
  max-height: min(322px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 18px;
  background: var(--project-modal-surface);
  box-shadow: 0 18px 46px rgba(20, 20, 20, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(.985);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 180ms var(--project-modal-ease), transform 180ms var(--project-modal-ease), visibility 180ms;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 20, 20, .28) transparent;
}

.project-select[data-open] .project-select__menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.project-select__option {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 9px 38px 9px 12px;
  background: transparent;
  color: var(--project-modal-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.025em;
  text-align: left;
  cursor: pointer;
}

.project-select__option:hover,
.project-select__option:focus-visible { background: #f0f0ee; outline: 0; }

.project-select__option[aria-selected="true"] { background: var(--project-modal-accent); }

.project-select__option[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(-45deg);
}

.project-field textarea {
  min-height: 124px;
  padding: 16px 18px;
  border-radius: 20px;
  resize: vertical;
}

.project-field input::placeholder,
.project-field textarea::placeholder { color: rgba(20, 20, 20, .42); }

.project-field input:hover,
.project-field select:hover,
.project-field textarea:hover { background: #eeeeec; }

.project-field input:focus-visible,
.project-field select:focus-visible,
.project-field textarea:focus-visible,
.project-select__trigger:focus-visible,
.project-modal button:focus-visible,
.project-modal a:focus-visible {
  outline: 2px solid var(--project-modal-accent);
  outline-offset: 2px;
}

.project-field [aria-invalid="true"] {
  border-color: rgba(133, 72, 62, .52);
  box-shadow: 0 0 0 3px rgba(133, 72, 62, .08);
}

.project-error {
  min-height: 0;
  margin: 0 4px;
  color: var(--project-modal-error);
  font-size: 12px;
  line-height: 1.25;
}
.project-error:not(:empty) { min-height: 14px; }

.project-form__consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.project-form__consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--project-modal-ink); }
.project-form__consent label { color: var(--project-modal-muted); font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: -.02em; }
.project-form__consent a { color: inherit; text-underline-offset: 2px; }
.project-form__consent .project-error { grid-column: 2; margin: -4px 0 0; }

.project-form__submit {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 60px;
  padding: 0 24px;
  background: var(--project-modal-ink);
  color: #faf9fd;
  margin-top: 2px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.05em;
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease, opacity .18s ease;
}

.project-form__submit:hover { filter: brightness(1.25); }
.project-form__submit:active { transform: scale(.985); }
.project-form__submit:disabled { cursor: wait; opacity: .54; }

.project-form__success {
  width: 100%;
  flex: 1;
  min-height: 470px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
}

.project-form__success-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--project-modal-accent);
  font-size: 26px;
}

.project-form__success h2 {
  max-width: 500px;
  margin: 0;
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.06em;
}

.project-form__success p { max-width: 480px; margin: 0; color: var(--project-modal-muted); font-size: 17px; line-height: 1.5; letter-spacing: -.035em; }

@media (prefers-reduced-motion: no-preference) {
  .project-modal__overlay { transition: opacity 260ms var(--project-modal-ease); }
  .project-modal__dialog { transition: opacity 300ms var(--project-modal-ease), transform 300ms var(--project-modal-ease); }
  .project-modal[data-closing] .project-modal__overlay { opacity: 0; }
  .project-modal[data-closing] .project-modal__dialog { opacity: 0; transform: translateY(12px) scale(.99); }
}

@media (max-width: 900px) {
  .project-modal { padding: 10px; }
  .project-modal__dialog { height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); grid-template-columns: 1fr; overflow-y: auto; }
  .project-modal__aside { min-height: auto; padding: 30px; gap: 30px; }
  .project-modal__title { max-width: 620px; font-size: clamp(38px, 7vw, 56px); }
  .project-modal__benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-modal__benefit { align-items: flex-start; flex-direction: column; }
  .project-modal__form-panel { min-height: 520px; align-items: flex-start; overflow: visible; padding-top: var(--project-modal-panel-pad); }
  .project-form { min-height: 0; }
  .project-form__submit { margin-top: 0; }
}

@media (max-width: 620px) {
  .project-modal { padding: 6px; }
  .project-modal__dialog { max-height: calc(100dvh - 12px); gap: 6px; padding: 6px; border-radius: 25px; }
  .project-modal__close { position: fixed; top: 18px; right: 18px; background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, .12); }
  .project-modal__aside { padding: 24px 20px; border-radius: 20px; gap: 24px; }
  .project-modal__title { padding-right: 48px; font-size: clamp(36px, 11vw, 50px); }
  .project-modal__lead { font-size: 15px; }
  .project-modal__benefits { grid-template-columns: 1fr; gap: 6px; }
  .project-modal__benefit { min-height: 48px; flex-direction: row; align-items: center; padding: 10px 12px; }
  .project-modal__form-panel { min-height: 690px; padding: 28px 14px 24px; border-radius: 20px; }
  .project-form__grid { grid-template-columns: 1fr; gap: 12px; }
  .project-field--full { grid-column: auto; }
  .project-field input,
  .project-field select { height: 56px; font-size: 16px; }
  .project-select__trigger { height: 56px; padding-right: 54px; font-size: 16px; }
  .project-select__chevron { right: 20px; }
  .project-select__option { min-height: 48px; font-size: 16px; }
  .project-field textarea { font-size: 16px; }
  .project-form__submit { min-height: 56px; }
  .project-form__success { min-height: 640px; align-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .project-modal__overlay,
  .project-modal__dialog,
  .project-modal__close,
  .project-form__submit,
  .project-select__menu,
  .project-select__chevron { transition: none !important; }
}
