.ebook-form .btn {
  opacity: 1;
  transition: background-color .25s ease, cursor .25s ease, opacity .25s ease, transform .25s ease;
}

.ebook-form .btn[aria-disabled="true"] {
  background: var(--green);
  cursor: not-allowed;
  opacity: .46;
  transform: none;
}

.ebook-form .btn[aria-disabled="false"]:hover,
.rules-link:hover,
.rules-close:hover {
  transform: translateY(-1px);
}

.ebook-consent {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.ebook-consent-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.ebook-consent input {
  position: absolute;
  opacity: 0;
}

.ebook-check {
  width: 17px;
  height: 17px;
  border: 1px solid rgba(77, 90, 67, .28);
  border-radius: 5px;
  background: rgba(255, 255, 255, .82);
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ebook-consent input:checked + .ebook-check {
  border-color: var(--green-dark);
  background: var(--green-dark);
  box-shadow: inset 0 0 0 4px var(--white);
}

.ebook-consent.has-error .ebook-check {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(188, 91, 91, .12);
}

.ebook-consent.has-error {
  color: var(--rose);
}

.ebook-consent input:focus-visible + .ebook-check,
.rules-link:focus-visible,
.rules-close:focus-visible,
.ebook-form input:focus-visible {
  outline: 2px solid rgba(188, 91, 91, .45);
  outline-offset: 3px;
}

.ebook-form input[aria-invalid="true"] {
  border-color: var(--rose);
}

.rules-link {
  padding: 0;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s ease, transform .2s ease;
}

.rules-link:hover { color: var(--rose); }

.rules-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(36, 48, 37, .42);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .24s ease;
}

.rules-modal[hidden] { display: none; }

.rules-modal.is-open { opacity: 1; }

.rules-modal-card {
  position: relative;
  width: min(600px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 36px;
  border: 1px solid rgba(231, 221, 215, .8);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 70px rgba(36, 48, 37, .2);
  transform: scale(.96);
  transition: transform .24s ease;
}

.rules-modal.is-open .rules-modal-card { transform: scale(1); }

.rules-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(77, 90, 67, .16);
  border-radius: 50%;
  background: var(--white);
  color: var(--green-dark);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: transform .2s ease, color .2s ease;
}

.rules-modal h2 {
  margin-right: 42px;
  font-size: 28px;
}

.rules-copy {
  display: grid;
  gap: 14px;
}

.rules-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

@media (max-width: 620px) {
  .ebook-consent { align-items: flex-start; }
  .rules-modal-card { padding: 30px 22px; }
}
