:root {
  --green: #3aa58f;
  --green-dark: #2e8a77;
  --green-soft: #e3efeb;
  --green-line: #cfe3dc;
  --orange: #f28a3e;
  --orange-dark: #e2762a;
  --blue: #2196f3;
  --blue-dark: #1a7fd1;
  --text: #111;
  --muted: #555;
  --line: #bdbdbd;
  --page: #eaeaea;
  --card: #f3f3f3;
  --white: #fff;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html:has(.modal[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.3;
}

@media (max-width: 767px) {
  body {
    background: var(--card);
  }
}

img,
svg {
  display: block;
  max-width: 100%;
}

.accent {
  color: var(--green);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 44px;
  padding: .7em 1.4em;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 6px 16px rgb(242 138 62 / 28%);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.btn:hover {
  background: var(--orange-dark);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid rgb(242 138 62 / 40%);
  outline-offset: 3px;
}

.btn[disabled] {
  opacity: .7;
  cursor: wait;
}

.btn__arrow {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hero — mobile: logo, title, photo, facts and button stacked in one card.
   Sizes are relative to the card width (cqi) to keep the mockup proportions. */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--card);
  text-align: center;
  container-type: inline-size;
}

.hero__content {
  display: contents;
}

.hero__logo {
  order: 1;
  width: 22cqi;
  margin: 4.8cqi auto 3.6cqi;
}

.hero__logo img {
  width: 100%;
  height: auto;
}

.hero__title {
  order: 2;
  margin: 0 4.8cqi 4.8cqi;
  font-size: 6cqi;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.hero__line {
  display: block;
  white-space: nowrap;
}

/* The photo gives up height on short screens so the button stays on the first screen. */
.hero__media {
  order: 3;
  width: 100%;
  aspect-ratio: 736 / 868;
  max-height: max(70cqi, calc(100svh - 98cqi));
}

.hero__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.hero__facts {
  order: 4;
  display: flex;
  gap: 4.2cqi;
  width: 100%;
  margin: 0;
  padding: 6cqi 4.2cqi 0;
  list-style: none;
}

.fact {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 2.4cqi;
  min-width: 0;
  padding: 2.7cqi 2.4cqi;
  border: 1px solid var(--green-line);
  border-radius: 3cqi;
  background: var(--card);
}

.fact__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 8.4cqi;
  height: 8.4cqi;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 4.8cqi;
  font-weight: 700;
}

.fact__icon svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}

.fact__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #222;
  font-size: 3.9cqi;
  line-height: 1.3;
  white-space: nowrap;
}

.fact__text b {
  color: var(--text);
  font-weight: 700;
}

.hero__btn {
  order: 5;
  min-height: 14.4cqi;
  margin: 6cqi auto 7.2cqi;
  padding: 0 8.4cqi;
  font-size: 5cqi;
}

/* Shine sweeping across the main CTA */
.hero__btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero__btn::after {
  content: "";
  position: absolute;
  inset: -20% auto -20% 0;
  z-index: 1;
  width: 45%;
  background: linear-gradient(90deg, rgb(255 255 255 / 0) 0%, rgb(255 255 255 / 50%) 50%, rgb(255 255 255 / 0) 100%);
  transform: translateX(-120%) skewX(-20deg);
  pointer-events: none;
  animation: btn-shine 2.8s ease-in-out infinite;
}

@keyframes btn-shine {
  0% { transform: translateX(-120%) skewX(-20deg); }
  55%, 100% { transform: translateX(340%) skewX(-20deg); }
}

/* Hero — desktop: text over the wide photo, as in the desktop mockup */
@media (min-width: 768px) {
  .page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 56px;
  }

  .hero {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: none;
    min-height: min(calc((100vw - 48px) * 1159 / 1770), 786px);
    border-radius: 20px;
    background: #f8fafc;
    text-align: left;
  }

  .hero__media {
    position: absolute;
    inset: 0;
    max-height: none;
    aspect-ratio: auto;
  }

  .hero__bg {
    object-position: 70% 50%;
  }

  .hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 64%;
    padding: clamp(24px, 4cqi, 64px);
  }

  .hero__logo {
    width: clamp(90px, 12.5cqi, 170px);
    margin: 0 0 clamp(24px, 8cqi, 96px);
  }

  .hero__title {
    margin: 0 0 clamp(16px, 3cqi, 32px);
    font-size: clamp(28px, 4.5cqi, 56px);
    line-height: 1.22;
  }

  .hero__facts {
    gap: clamp(10px, 2.2cqi, 18px);
    width: auto;
    margin: 0 0 clamp(20px, 3.6cqi, 40px);
    padding: 0;
  }

  .fact {
    flex: none;
    gap: clamp(8px, 1.6cqi, 12px);
    padding: clamp(6px, 1.1cqi, 10px) clamp(12px, 1.8cqi, 16px) clamp(6px, 1.1cqi, 10px) clamp(6px, 1.1cqi, 10px);
    border-color: #e3e3e3;
    border-radius: clamp(8px, 1.6cqi, 12px);
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 2px 8px rgb(0 0 0 / 5%);
  }

  .fact__icon {
    width: clamp(28px, 5.4cqi, 40px);
    height: clamp(28px, 5.4cqi, 40px);
    font-size: clamp(13px, 2.6cqi, 18px);
  }

  .fact__text {
    align-items: flex-start;
    font-size: clamp(12px, 2.1cqi, 16px);
  }

  .hero__btn {
    min-height: clamp(46px, 7.4cqi, 60px);
    margin: 0;
    padding: 0 1.4em;
    font-size: clamp(15px, 2.8cqi, 20px);
  }
}

/* Application form in a modal dialog: full screen on mobile, centered card on desktop */
.modal {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
  background: var(--card);
  color: var(--text);
  overscroll-behavior: contain;
}

.modal[open] {
  animation: modal-in .25s ease;
}

.modal:focus {
  outline: none;
}

.modal::backdrop {
  background: rgb(17 17 17 / 50%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: #444;
  cursor: pointer;
  transition: background .2s ease;
}

.modal__close:hover {
  background: #e4e4e4;
}

.modal__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.apply {
  position: relative;
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  padding: 60px 16px 32px;
  text-align: center;
}

.apply__title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.apply__lead {
  max-width: 300px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
}

.field {
  display: block;
}

.field__label,
.choice__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(58 165 143 / 16%);
}

.input.is-invalid {
  border-color: #d93636;
  box-shadow: 0 0 0 3px rgb(217 54 54 / 12%);
}

.input input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.input input::placeholder {
  color: #9a9a9a;
}

.input__icon,
.choice__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.input__icon svg,
.choice__icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice__title {
  padding: 0;
}

.choice__grid {
  display: grid;
  gap: 12px;
}

.choice__grid_2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice__grid_3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chip {
  position: relative;
  display: block;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  height: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: #333;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.chip:hover span {
  border-color: var(--green);
}

.chip input:checked + span {
  border-color: #c9dcd6;
  background: var(--green-soft);
  color: var(--text);
  font-weight: 500;
}

.chip input:focus-visible + span {
  outline: 3px solid rgb(58 165 143 / 35%);
  outline-offset: 2px;
}

.choice.is-invalid .choice__title {
  color: #c62828;
}

.choice.is-invalid .chip span {
  border-color: #e58f8f;
}

.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form__status {
  margin: 0;
  font-size: 14px;
  text-align: center;
}

.form__status.is-error {
  color: #c62828;
}

.form__status.is-success {
  color: var(--green-dark);
  font-weight: 600;
}

.form__btn {
  align-self: center;
  min-width: 200px;
  margin-top: 4px;
  font-size: 15px;
}

@media (min-width: 768px) {
  .modal {
    width: min(640px, calc(100% - 48px));
    height: fit-content;
    max-height: calc(100dvh - 48px);
    margin: auto;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgb(0 0 0 / 25%);
  }

  .apply {
    max-width: none;
    min-height: 0;
    padding: 44px 48px 40px;
  }

  .apply__title {
    font-size: 32px;
  }

  .apply__lead {
    max-width: 420px;
    margin-bottom: 28px;
    font-size: 17px;
  }

  .form {
    gap: 22px;
  }

  .field__label,
  .choice__title {
    font-size: 16px;
  }

  .input {
    min-height: 52px;
  }

  .chip span {
    min-height: 54px;
    font-size: 14px;
  }

  .form__btn {
    min-height: 52px;
    min-width: 240px;
    font-size: 17px;
  }
}

/* Thank-you page */
.thanks-page {
  min-height: 100svh;
  background: var(--card);
}

.thanks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38%;
  align-items: start;
  gap: 2cqi;
  max-width: 480px;
  margin: 0 auto;
  padding: 9cqi 4.8cqi 8cqi;
  container-type: inline-size;
}

.thanks__text {
  text-align: center;
}

.thanks__title {
  margin: 0 0 5.4cqi;
  font-size: 5.6cqi;
  font-weight: 700;
  line-height: 1.25;
}

.thanks__title span {
  display: block;
}

.thanks__lead {
  margin: 0 0 4.2cqi;
  color: #222;
  font-size: 4.3cqi;
  font-weight: 300;
  line-height: 1.3;
}

.thanks__subtitle {
  margin: 0 0 4.2cqi;
  font-size: 4.6cqi;
  font-weight: 700;
  line-height: 1.25;
}

.btn_telegram {
  min-height: 9cqi;
  padding: 0 5cqi;
  background: var(--blue);
  box-shadow: 0 8px 18px rgb(33 150 243 / 30%);
  font-size: 3.7cqi;
}

.btn_telegram:hover {
  background: var(--blue-dark);
}

.btn_telegram:focus-visible {
  outline-color: rgb(33 150 243 / 40%);
}

.thanks__bear {
  width: 100%;
  height: auto;
  margin-top: 2cqi;
}

@media (min-width: 768px) {
  .thanks-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--page);
  }

  .thanks {
    width: 100%;
    max-width: 860px;
    padding: 56px 64px;
    border-radius: 20px;
    background: var(--card);
    align-items: center;
    gap: 32px;
  }

  .thanks__title {
    margin-bottom: 24px;
    font-size: 40px;
  }

  .thanks__lead {
    margin-bottom: 24px;
    font-size: 22px;
  }

  .thanks__subtitle {
    margin-bottom: 22px;
    font-size: 24px;
  }

  .btn_telegram {
    min-height: 52px;
    padding: 0 28px;
    font-size: 17px;
  }

  .thanks__bear {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  .modal[open] {
    animation: none !important;
    transition: none !important;
  }
}
