/* Переиспользуемые UI-компоненты: модалка, форма, кнопки */

/* ——— Модалка ——— */
.fiamo-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.fiamo-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.fiamo-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 10, 0.5);
  cursor: pointer;
}

.fiamo-modal__dialog {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}

.fiamo-modal--theme-dark .fiamo-modal__dialog {
  background: #1b5059;
}

.fiamo-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 1;
}

.fiamo-modal__close img {
  display: block;
  width: 24px;
  height: 24px;
}

.fiamo-modal__close:hover {
  opacity: 1;
}

.fiamo-modal__content {
  display: block;
}

.fiamo-modal__dialog--notice .fiamo-modal__content {
  display: none;
}

.fiamo-modal__notice {
  display: none;
  max-width: 520px;
}

.fiamo-modal__dialog--notice .fiamo-modal__notice {
  display: block;
}

.fiamo-modal__notice-title {
  margin: 0 0 16px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.2;
  color: #ffffff;
}

.fiamo-modal__notice-desc {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 20px;
  line-height: 28px;
  color: rgba(255, 255, 255, 0.85);
}

.fiamo-modal__heading {
  margin: 0 0 16px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.2;
  color: #ffffff;
}

.fiamo-modal__subheading {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 20px;
  line-height: 28px;
  color: rgba(255, 255, 255, 0.85);
}

/* ——— Форма ——— */
.fiamo-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fiamo-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fiamo-field__label {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #ffffff;
}

.fiamo-input {
  width: 100%;
  padding: 5px 12px;
  border: 1px solid rgba(241, 248, 251, 0.55);
  border-radius: 12px;
  background: transparent;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #f1f8fb;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.fiamo-input::placeholder {
  color: rgba(241, 248, 251, 0.55);
}

.fiamo-input:hover {
  border-color: rgba(241, 248, 251, 0.75);
}

.fiamo-input:focus {
  outline: none;
  border-color: #c1f328;
  box-shadow: 0 0 0 1px #c1f328;
}

.fiamo-field.is-error .fiamo-input,
.fiamo-input.is-error {
  border-color: #fa7676;
  box-shadow: 0 0 0 1px #fa7676;
}

.fiamo-field.is-error .fiamo-input:focus,
.fiamo-input.is-error:focus {
  border-color: #c1f328;
  box-shadow: 0 0 0 1px #c1f328;
}

.fiamo-field__error {
  display: none;
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  line-height: 16px;
  color: #fa7676;
}

.fiamo-field.is-error .fiamo-field__error {
  display: block;
}

/* Чекбокс */
.fiamo-field--checkbox .fiamo-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  line-height: 16px;
  color: #f1f8fb;
  cursor: pointer;
}

.fiamo-checkbox__input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  appearance: none;
  border: 1px solid #f1f8fb;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
}

.fiamo-checkbox__input:checked {
  border: none;
  background: url("../images/icon_check.svg") center / 20px 20px no-repeat;
}

.fiamo-field--checkbox.is-error .fiamo-checkbox__input {
  border-color: #fa7676;
  box-shadow: 0 0 0 1px #fa7676;
}

.fiamo-field--checkbox.is-error .fiamo-checkbox__input:focus {
  border-color: #c1f328;
  box-shadow: 0 0 0 1px #c1f328;
}

.fiamo-checkbox__text a {
  color: #c1f328;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fiamo-checkbox__text a:hover {
  color: #ffffff;
}

/* Кнопки */
.fiamo-btn {
  border: none;
  border-radius: 16px;
  padding: 12px 24px;
  font-family: "Inter", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  cursor: pointer;
  transition: background 0.2s ease;
  box-sizing: border-box;
}

.fiamo-btn--primary {
  background: #c1f328;
  color: #07070a;
}

.fiamo-btn--primary:hover {
  background: #b0e020;
}

.fiamo-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fiamo-form__submit-error {
  display: none;
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  line-height: 16px;
  color: #fa7676;
  text-align: center;
}

.fiamo-form__submit-error.is-visible {
  display: block;
}

/* Скрытое поле для antispam / статистики (не показывать пользователю) */
.fiamo-field--ws {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .fiamo-modal__dialog {
    border-radius: 20px;
  }

  .fiamo-modal__notice-title,
  .fiamo-modal__heading {
    font-size: 24px;
    padding-right: 32px;
  }

  .fiamo-modal__notice-desc,
  .fiamo-modal__subheading {
    font-size: 16px;
    line-height: 24px;
  }
}
