:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-alt: #f9fbfa;
  --text: #12343a;
  --muted: #6b7b7e;
  --line: #e3e8ea;
  --brand: #1ab248;
  --brand-dark: #13853a;
  --danger: #d34a4a;
  --shadow: 0 14px 28px rgba(18, 52, 58, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

body[data-page="index"] {
  background:
    radial-gradient(circle at top right, rgba(26, 178, 72, 0.12), transparent 34%),
    radial-gradient(circle at left bottom, rgba(26, 178, 72, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(26, 178, 72, 0.04) 0%, rgba(26, 178, 72, 0) 18%),
    var(--bg);
}

body[data-page="join"] {
  background:
    radial-gradient(circle at top right, rgba(26, 178, 72, 0.12), transparent 34%),
    radial-gradient(circle at left bottom, rgba(26, 178, 72, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(26, 178, 72, 0.04) 0%, rgba(26, 178, 72, 0) 18%),
    var(--bg);
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

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

button,
input {
  font: inherit;
}

.header,
.footer,
main {
  width: 100%;
}

.content,
.container {
  width: 100%;
  max-width: 754px;
  margin: 0 auto;
  padding: 0 15px;
}

.header {
  position: relative;
  height: 42px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 6px #e9eaec;
}

.header .content {
  height: 100%;
  display: flex;
  align-items: center;
}

.header__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header__logo img {
  width: 32px;
  height: 32px;
}

.header__logo span {
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.15em;
  color: #000;
  white-space: nowrap;
}

main {
  padding: 64px 0 40px;
}

.top {
  margin-bottom: 18px;
  padding: 28px 28px 24px;
  background: linear-gradient(145deg, #ffffff 0%, #f4faf5 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.top__content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.top__left {
  flex: 1 1 auto;
}

.top__headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top__brand {
  width: 134px;
  flex: 0 0 auto;
}

.h1 {
  margin: 0 0 10px;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.title__desc {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

.title__accent {
  color: var(--brand);
  font-weight: 700;
}

.form,
.bottom,
.done {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form {
  padding: 24px;
}

.form__title,
.done__title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

.form__desc,
.done__desc,
.commercial-notice,
.empty-state {
  color: var(--muted);
}

.form__desc,
.done__desc,
.commercial-notice,
.empty-state {
  line-height: 1.6;
}

.form__desc {
  margin-bottom: 18px;
}

.form__row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.form__row + .form__row {
  margin-top: 12px;
}

.form__row--consent {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.consent-item {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

.form__input {
  flex: 1 1 360px;
}

.field {
  position: relative;
}

.field__control {
  position: relative;
}

.input__search,
.input__email {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid #d5dce0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field--floating .input__search {
  padding: 20px 18px 8px;
}

.field--floating .input__search::placeholder {
  color: transparent;
}

.field__label {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  font-size: 16px;
  line-height: 1.2;
  color: #7a7a7a;
  pointer-events: none;
  transition:
    top 0.2s ease,
    transform 0.2s ease,
    font-size 0.2s ease,
    color 0.2s ease;
}

.field--floating .input__search:focus + .field__label,
.field--floating .input__search:not(:placeholder-shown) + .field__label {
  top: 11px;
  transform: none;
  font-size: 11px;
  color: #809095;
}

.input__search:focus,
.input__email:focus {
  outline: none;
  border-color: rgba(26, 178, 72, 0.8);
  box-shadow: 0 0 0 4px rgba(26, 178, 72, 0.14);
}

.field.is-invalid .input__search,
.field.is-invalid .input__email {
  border-color: rgba(211, 74, 74, 0.8);
  box-shadow: 0 0 0 4px rgba(211, 74, 74, 0.12);
}

.field__error {
  display: none;
  margin-top: 7px;
  font-size: 13px;
  color: var(--danger);
}

.field.is-invalid .field__error {
  display: block;
}

.form__note {
  font-size: 12px;
  line-height: 1.55;
  color: #7a878b;
}

.form__btn {
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), #2daa50);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(26, 178, 72, 0.2);
}

.btn img {
  width: 20px;
  height: 20px;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  padding: 14px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.checkbox-label {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.checkbox-accent {
  color: inherit;
}

.checkbox-link {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkbox.is-invalid {
  border-color: #ff2c2c;
  background: #fff;
}

.consent-error {
  display: none;
  max-width: none;
  padding-top: 6px;
  font-size: 16px;
  line-height: 1.45;
  color: #ff1f1f;
}

.consent-error.is-visible {
  display: block;
}

.track-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #f3f7f5;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.track-note strong {
  overflow-wrap: anywhere;
}

.bottom {
  margin-top: 68px;
  padding: 24px;
}

.bottom p,
.bottom li {
  color: var(--muted);
  line-height: 1.7;
}

.bottom p + ul,
.bottom ul + p {
  margin-top: 14px;
}

.bottom ul {
  margin: 0;
  padding-left: 18px;
}

.commercial-notice {
  max-width: 754px;
  margin: 18px auto 0;
  padding: 0 15px;
  font-size: 12px;
  text-align: center;
}

.done {
  padding: 24px;
}

.done__content {
  display: block;
}

.done__left ul {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.done__left li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.6;
  color: var(--muted);
}

.done__left li img {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.empty-state {
  display: none;
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid rgba(211, 74, 74, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(211, 74, 74, 0.04);
  font-size: 14px;
}

.empty-state.is-visible {
  display: block;
}

.footer {
  padding: 30px 0;
}

.footer__bottom {
  min-height: 1px;
}

@media (max-width: 780px) {
  .header {
    height: 86px;
    min-height: 0;
  }

  .header .content {
    justify-content: center;
    padding: 0 6px;
  }

  .header__logo {
    gap: 6px;
    width: auto;
    justify-content: flex-start;
  }

  .header__logo img {
    width: 32px;
    height: 32px;
  }

  .header__logo span {
    max-width: none;
    font-size: 13px;
    line-height: 14px;
    letter-spacing: 0;
    white-space: nowrap;
    text-align: left;
  }

  main {
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .top,
  .form,
  .bottom,
  .done {
    padding: 18px 16px;
  }

  .top__content {
    display: block;
  }

  .top__headline {
    align-items: flex-start;
    gap: 12px;
  }

  .top__brand {
    width: 108px;
    margin-top: 2px;
  }

  .h1 {
    font-size: 30px;
    margin-bottom: 0;
  }

  .form__row {
    flex-direction: column;
    align-items: stretch;
  }

  .form__row--consent {
    gap: 10px;
  }

  .form__input {
    flex: 1 1 auto;
    width: 100%;
  }

  .form__btn {
    width: 100%;
    max-width: none;
  }

  .form__btn,
  .btn {
    width: 100%;
  }

  .consent-error {
    max-width: none;
    padding-top: 0;
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .content,
  .container {
    padding: 0 10px;
  }

  .header .content {
    padding: 0 4px;
  }

  .header__logo {
    gap: 5px;
  }

  .header__logo img {
    width: 30px;
    height: 30px;
  }

  .header__logo span {
    max-width: none;
    font-size: 12.5px;
    line-height: 13px;
    letter-spacing: 0;
  }

  .top {
    margin-bottom: 14px;
  }

  .top__headline {
    gap: 10px;
  }

  .top__brand {
    width: 92px;
  }

  .h1 {
    font-size: 26px;
  }

  .title__desc {
    font-size: 15px;
    line-height: 1.45;
  }

  .form {
    padding: 16px 14px;
  }

  .form__title {
    font-size: 24px;
  }

  .form__desc {
    margin-bottom: 14px;
  }

  .input__search,
  .input__email,
  .btn {
    min-height: 54px;
  }

  .field--floating .input__search {
    padding-top: 19px;
  }

  .field__label {
    font-size: 15px;
  }

  .field--floating .input__search:focus + .field__label,
  .field--floating .input__search:not(:placeholder-shown) + .field__label {
    top: 10px;
    font-size: 10px;
  }

  .checkbox {
    padding: 12px 13px;
  }
}
