/* Promptkits sign-up window. Builds on .legal-dialog from styles.css. */

.signup-dialog {
  width: min(calc(560px * var(--site-scale)), calc(100% - calc(32px * var(--site-scale))));
}

.signup-form {
  display: grid;
  grid-auto-rows: max-content;
  grid-template-rows: none;
  align-content: start;
  height: max-content;
  min-height: 0;
  gap: .9rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.signup-form h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.65rem;
  line-height: 1.2;
}

.signup-form p {
  margin: 0;
}

.signup-form input[type="email"] {
  width: 100%;
  min-height: calc(47px * var(--site-scale));
  border: calc(1px * var(--site-scale)) solid var(--line);
  border-radius: calc(6px * var(--site-scale));
  padding: .8rem 1rem;
  color: var(--ink);
  outline: none;
}

.signup-form input[type="email"]:focus {
  border-color: #7893c6;
  outline: calc(2px * var(--site-scale)) solid rgba(41, 87, 168, .45);
  outline-offset: calc(2px * var(--site-scale));
}

.signup-form .form-honey {
  display: none;
}

.signup-form .turnstile-slot {
  min-height: 65px;
  width: 100%;
  min-width: 0;
  border-radius: calc(6px * var(--site-scale));
  overflow: hidden;
  clip-path: inset(0 round calc(6px * var(--site-scale)));
}
.signup-form .turnstile-slot > div,
.signup-form .turnstile-slot iframe {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  border-radius: calc(6px * var(--site-scale)) !important;
}
.signup-form .turnstile-slot > div {
  overflow: hidden;
}
.signup-form .turnstile-slot iframe {
  display: block;
  max-width: 100%;
  border-radius: inherit;
}

.signup-check {
  display: grid;
  grid-template-columns: calc(20px * var(--site-scale)) 1fr;
  gap: .65rem;
  align-items: start;
  cursor: pointer;
  line-height: 1.45;
}

.signup-check input {
  width: calc(18px * var(--site-scale));
  height: calc(18px * var(--site-scale));
  margin: .15rem 0 0;
  accent-color: var(--navy);
}

.signup-status {
  height: auto;
  min-height: 0;
  overflow: visible;
  color: var(--blue);
  font-size: .875rem;
  line-height: 1.4;
}

.signup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

 .signup-actions button {
  min-height: calc(45px * var(--site-scale));
  padding: 0 1.4rem;
  border: 0;
  border-radius: calc(4px * var(--site-scale));
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  transition: background .16s ease;
}

.signup-actions button:hover,
.signup-actions button:focus-visible {
  background: #0c347f;
  outline: none;
}

.signup-actions button:disabled {
  opacity: .5;
  cursor: default;
}

.signup-form p,
.signup-check span {
  text-wrap: pretty;
}

.signup-note {
  line-height: 1.2;
  color: var(--muted);
  font-size: .8rem;
}

.signup-note button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
}

.signup-note button:hover,
.signup-note button:focus-visible {
  color: var(--blue);
  outline: none;
}

/* All fixed selections use the same grey square and white tick. */
.signup-check:has(input[type="checkbox"]:checked:disabled) { cursor: default; }
.signup-check input[type="checkbox"]:checked:disabled {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  background: #c1c4cd;
  border: 0;
  border-radius: calc(4px * var(--site-scale));
  opacity: 1;
}
.signup-check input[type="checkbox"]:checked:disabled::after {
  content: "";
  position: absolute;
  left: calc(6px * var(--site-scale));
  top: calc(2px * var(--site-scale));
  width: calc(5px * var(--site-scale));
  height: calc(9px * var(--site-scale));
  border: solid #fff;
  border-width: 0 calc(2px * var(--site-scale)) calc(2px * var(--site-scale)) 0;
  transform: rotate(45deg);
}

.signup-dialog::backdrop {
  background: rgba(3, 19, 54, .09);
  -webkit-backdrop-filter: blur(calc(8px * var(--site-scale)));
  backdrop-filter: blur(calc(8px * var(--site-scale)));
}

/* Compact, hairline close icon on every device. Retain the 32px tap target. */
.signup-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #60666d;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.signup-close::before,
.signup-close::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 1px;
  background: currentColor;
  border-radius: 1px;
  pointer-events: none;
}
.signup-close::before { transform: rotate(45deg); }
.signup-close::after { transform: rotate(-45deg); }
.signup-close:hover { color: var(--navy); }
.signup-close:focus-visible {
  color: var(--navy);
  background: transparent;
}
.signup-form h2 { padding-right: 1.25rem; }

html.signup-background-locked {
  overflow: hidden;
  overscroll-behavior: none;
}
html.signup-background-locked body {
  position: fixed;
  top: var(--signup-scroll-top);
  left: 0;
  right: 0;
  width: 100%;
}
.signup-dialog {
  height: fit-content;
  min-height: 0;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 560px) {
  .signup-close { top: auto; bottom: .65rem; }
}

.contact-privacy { font-size: .8rem; line-height: 1.2; color: var(--muted); }

/* Separate direct prompt access from optional e-mail subscriptions. */
.signup-prompts { margin: .25rem 0 .7rem; }
.signup-prompts a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: calc(45px * var(--site-scale)); padding: 0 1.4rem;
  background: var(--navy); color: #fff; border-radius: calc(4px * var(--site-scale));
  text-decoration: none;
}
.signup-prompts a:hover, .signup-prompts a:focus-visible { background: #0c347f; }

/* Compact space before submit, while retaining a stable validation area. */
.blog-subscribe .signup-form,
.promptkit-subscribe .signup-form { row-gap: .65rem; }
/* Keep action and note in one compact grid item, rather than flattening
   them into separate auto-positioned rows of the parent form grid. */
.signup-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .65rem;
  min-height: 0;
}
.signup-footer .signup-actions { justify-content: flex-start; }
@media (max-width: 902px) {
  .signup-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
  }
  .signup-footer .signup-note {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .signup-footer .signup-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    flex-wrap: nowrap;
  }
  #signup-dialog .signup-close {
    top: .4rem;
    right: .4rem;
    bottom: auto;
  }
}

/* Forms must fit their content, with no empty status row or stretched grid tracks. */
.signup-form .signup-status:empty { display: none; }
.signup-form .signup-status:not(:empty) { display: block; }
