.ci-download-button {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.ci-download-button.is-loading {
  cursor: wait;
  opacity: .7;
}

.ci-category.is-hidden,
.ci-document-card.is-hidden {
  display: none;
}

.ci-modal[hidden],
.ci-empty[hidden] {
  display: none;
}

.ci-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ci-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 24, 38, .68);
  backdrop-filter: blur(4px);
}

.ci-modal__dialog {
  position: relative;
  width: min(100%, 470px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 32px;
  border: 1px solid rgba(216, 225, 233, .9);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(3, 24, 38, .3);
}

.ci-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #71818b;
  background: #f1f5f8;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.ci-modal__close:hover,
.ci-modal__close:focus-visible {
  color: var(--ci-navy);
  background: #e5edf2;
  outline: none;
}

.ci-modal__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 15px;
  color: var(--ci-blue);
  background: #eaf2ff;
}

.ci-modal__eyebrow {
  margin-bottom: 12px;
  color: var(--ci-blue);
  border-color: #cfe0ff;
  background: #f1f6ff;
  font-size: .62rem;
}

.ci-modal__dialog h2 {
  margin: 0;
  color: var(--ci-navy);
  font-family: Sora, Inter, Arial, sans-serif;
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  letter-spacing: -.04em;
  line-height: 1.2;
}

.ci-modal__description {
  margin: 10px 0 23px;
  color: var(--ci-muted);
  font-size: .86rem;
}

.ci-modal__field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--ci-ink);
  font-size: .78rem;
  font-weight: 700;
}

.ci-modal__field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #d8e1e9;
  border-radius: 10px;
  outline: none;
  color: var(--ci-ink);
  background: #fbfcfd;
  font: inherit;
  font-weight: 400;
}

.ci-modal__field input:focus {
  border-color: var(--ci-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.ci-modal__field-help {
  margin-top: -1px;
  color: #8a9aa5;
  font-size: .68rem;
  font-weight: 400;
}

.ci-turnstile {
  min-height: 65px;
  margin-top: 18px;
}

.ci-modal__note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 12px 0 0;
  color: #80909a;
  font-size: .7rem;
  line-height: 1.45;
}

.ci-modal__note svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--ci-green);
}

.ci-modal__error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #a52b2b;
  background: #fff1f1;
  font-size: .76rem;
}

.ci-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.ci-modal__cancel,
.ci-modal__submit {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}

.ci-modal__cancel {
  border: 1px solid #d8e1e9;
  color: var(--ci-muted);
  background: #fff;
}

.ci-modal__cancel:hover,
.ci-modal__cancel:focus-visible {
  border-color: #aebec8;
  color: var(--ci-navy);
  outline: none;
}

.ci-modal__submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  color: #fff;
  background: var(--ci-navy);
}

.ci-modal__submit:hover,
.ci-modal__submit:focus-visible {
  background: var(--ci-blue);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
  outline: none;
}

.ci-modal__submit:disabled {
  cursor: wait;
  opacity: .7;
}

.ci-modal__spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ci-spin .7s linear infinite;
}

.ci-modal__submit.is-loading .ci-modal__spinner {
  display: inline-block;
}

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

body.ci-modal-open {
  overflow: hidden;
}

@media (max-width: 559px) {
  .ci-modal {
    align-items: end;
    padding: 10px;
  }

  .ci-modal__dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 27px 20px 20px;
    border-radius: 20px;
  }

  .ci-modal__actions {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
  }

  .ci-modal__actions button {
    width: 100%;
  }
}
