/* Реферальная форма ukonit-referal.ru */
:root {
  --rf-bg: #F7F0E4;
  --rf-title: #005C3B;
  --rf-text: #25302B;
  --rf-field: #FFFFFF;
  --rf-border: #D8D0C4;
  --rf-btn: #005C3B;
  --rf-btn-text: #FFFFFF;
  --rf-accent: #FF741F;
  --rf-muted: rgba(37, 48, 43, 0.72);
  --rf-ok-bg: #E4F0E8;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.rf-body {
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--rf-text);
  background: var(--rf-bg);
  -webkit-font-smoothing: antialiased;
}

.rf-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--rf-bg);
}

.rf-page__bg {
  position: absolute;
  inset: 0;
  background-color: var(--rf-bg);
  background-image:
    linear-gradient(180deg, var(--rf-bg) 0%, var(--rf-bg) 38%, rgba(247, 240, 228, 0.55) 58%, rgba(247, 240, 228, 0) 78%),
    url("/assets/img/ref/bg-mobile.png");
  background-repeat: no-repeat;
  background-position: center top, center bottom;
  background-size: auto, cover;
  pointer-events: none;
  z-index: 0;
}

.rf-page.is-done .rf-page__bg {
  background-image: none;
}

.rf-page.is-done::after {
  content: "";
  position: absolute;
  left: -20%;
  right: -10%;
  bottom: -8%;
  height: 42%;
  background:
    linear-gradient(115deg, transparent 0 28%, var(--rf-accent) 28% 34%, transparent 34% 40%, var(--rf-title) 40% 100%);
  clip-path: polygon(0 35%, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
  pointer-events: none;
}

.rf-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px 22px 48px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.rf-brand {
  display: block;
  text-decoration: none;
  margin: 0 auto 36px;
  max-width: 260px;
}

.rf-brand__logo {
  display: block;
  width: 100%;
  height: auto;
}

.rf-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.rf-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--rf-title);
  letter-spacing: -0.02em;
}

.rf-lead {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--rf-muted);
  max-width: 28em;
}

.rf-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
}

.rf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rf-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--rf-text);
}

.rf-field input[type="text"],
.rf-field input[type="tel"],
.rf-field textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--rf-border);
  border-radius: 12px;
  background: var(--rf-field);
  color: var(--rf-text);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rf-field textarea {
  height: auto;
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.45;
}

.rf-field input::placeholder,
.rf-field textarea::placeholder {
  color: #9a9288;
}

.rf-field input:focus,
.rf-field textarea:focus {
  border-color: var(--rf-title);
  box-shadow: 0 0 0 3px rgba(0, 92, 59, 0.12);
}

.rf-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--rf-muted);
  margin-top: 4px;
}

.rf-consent input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--rf-title);
}

.rf-consent a {
  color: var(--rf-title);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rf-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.rf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  height: 54px;
  margin-top: 8px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--rf-btn);
  color: var(--rf-btn-text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.rf-btn:hover {
  background: #014a30;
}

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

.rf-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.rf-btn__arrow {
  font-size: 20px;
  line-height: 1;
  color: var(--rf-accent);
}

.rf-error {
  display: none;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fdeceb;
  color: #9b2c2c;
  font-size: 13px;
  line-height: 1.4;
}

.rf-error.is-on {
  display: block;
}

.rf-done {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 28px;
}

.rf-page.is-done .rf-form-block {
  display: none;
}

.rf-page.is-done .rf-done {
  display: flex;
}

.rf-done__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--rf-ok-bg);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

.rf-done__icon svg {
  width: 34px;
  height: 34px;
}

.rf-done .rf-title {
  margin-bottom: 12px;
}

.rf-done .rf-lead {
  margin: 0;
  max-width: 22em;
}

@media (min-width: 768px) {
  .rf-page__bg {
    background-image:
      linear-gradient(90deg, var(--rf-bg) 0%, rgba(247, 240, 228, 0.94) 36%, rgba(247, 240, 228, 0.4) 58%, rgba(247, 240, 228, 0) 78%),
      url("/assets/img/ref/bg-desktop.png");
    background-position: center, right center;
    background-size: auto, cover;
  }

  .rf-shell {
    width: min(100%, 1120px);
    padding: 40px 56px 64px;
    align-items: flex-start;
  }

  .rf-brand {
    margin: 0 0 56px;
    max-width: 320px;
  }

  .rf-main {
    max-width: 480px;
    padding-top: 24px;
  }

  .rf-title {
    font-size: 44px;
  }

  .rf-lead {
    font-size: 16px;
    margin-bottom: 32px;
  }

  .rf-page.is-done .rf-shell {
    align-items: center;
  }

  .rf-page.is-done .rf-brand {
    margin-left: auto;
    margin-right: auto;
  }

  .rf-page.is-done .rf-main {
    max-width: 560px;
    align-items: center;
  }

  .rf-page.is-done::after {
    height: 48%;
  }
}

@media (min-width: 1100px) {
  .rf-shell {
    padding-left: 72px;
  }

  .rf-main {
    padding-top: 48px;
  }
}
