:root {
  --text: #1a1a1a;
  --text-muted: #8f8f8f;
  --field-bg: #f2f1f3;
  --field-bg-hover: #ebeaed;
  --accent: #1570ef;
  --accent-hover: #175cd3;
  --accent-text: #fff;
  --danger: #e5352f;
  --success: #2fa85b;
  --radius-field: 12px;
  --radius-button: 16px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "YS Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.3;
}

.page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.card { width: 100%; max-width: 500px; }

.title {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 38px;
  font-weight: 700;
}

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

.field { position: relative; }

.field__error {
  display: none;
  margin: 4px 0 0 16px;
  font-size: 13px;
  color: var(--danger);
}

.field.is-invalid .field__error { display: block; }
.field.is-invalid .input { box-shadow: inset 0 0 0 2px var(--danger); }

.input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-field);
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: background .15s, box-shadow .15s;
}

.input::placeholder { color: var(--text-muted); }
.input:hover:not(:disabled) { background: var(--field-bg-hover); }
.input:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.input:disabled { color: var(--text-muted); cursor: default; }

/* убираем стрелки у числового поля бюджета */
.input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

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

.select, .multiselect__toggle {
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
  text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%231a1a1a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.select.is-empty, .multiselect__toggle.is-empty { color: var(--text-muted); }
.select option { color: var(--text); }

.multiselect__toggle {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.multiselect__menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border-radius: var(--radius-field);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .14);
}

.multiselect__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
}

.multiselect__option:hover { background: var(--field-bg); }

.multiselect__option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--text);
  cursor: pointer;
}

.field--clearable .input { padding-right: 44px; }

.clear {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #a6a6a6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none'%3E%3Cpath d='m2 2 6 6m0-6L2 8' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center no-repeat;
  cursor: pointer;
}

.clear:hover { background-color: #8f8f8f; }

.check-result {
  margin-top: 16px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: #ffe1e1;
}

.check-result__title { font-size: 20px; line-height: 26px; font-weight: 700; }
.check-result__text { margin-top: 4px; font-size: 13px; line-height: 18px; }

.field--locked .input { padding-right: 130px; }

.link {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.button {
  position: relative;
  height: 56px;
  margin-top: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}

.button:hover:not(:disabled) { background: var(--accent-hover); }
.button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.button:disabled { cursor: default; color: transparent; }

.button:disabled::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent-text);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  z-index: 100;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 16px 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  animation: toast-in .2s ease-out;
}

.toast__icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='m3 8.5 3 3 7-7' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
}

.toast--error .toast__icon {
  background-color: var(--danger);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='m4 4 8 8m0-8-8 8' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.toast__text { font-size: 18px; font-weight: 700; white-space: pre-line; }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }

@media (max-width: 480px) {
  .title { font-size: 26px; line-height: 32px; }
}
