/**
 * Domain-health popup. Loaded on every page except the diagnostic page,
 * which already asks for the same thing in step 1.
 *
 * The close affordances are deliberately oversized: a visitor who wanted the
 * check will find the field, and one who did not should get rid of this in a
 * single obvious gesture rather than hunting for a 12px cross.
 */

.sdb-pop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 32, 0.72);
  animation: sdb-pop-fade 0.22s ease-out;
}

.sdb-pop[hidden] { display: none; }

.sdb-pop__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  padding: 32px 28px 26px;
  box-shadow: 0 24px 60px rgba(15, 23, 32, 0.28);
  animation: sdb-pop-rise 0.26s ease-out;
}

.sdb-pop__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary, #64748B);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.sdb-pop__close:hover { background: var(--bg-light, #F8FAFC); color: #0F1720; }
.sdb-pop__close:focus-visible { outline: 2px solid var(--sendability-blue, #12678E); outline-offset: 2px; }

.sdb-pop__title {
  margin: 0 28px 8px 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.sdb-pop__intro {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary, #64748B);
}

.sdb-pop__field { margin-bottom: 14px; }

.sdb-pop__field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
  font-weight: 600;
}

.sdb-pop__field input[type="email"],
.sdb-pop__field input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 0.95rem;
  color: #0F1720;
  background: #FFFFFF;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
}

.sdb-pop__field input:focus {
  outline: none;
  border-color: var(--sendability-blue, #12678E);
  box-shadow: 0 0 0 3px rgba(18, 103, 142, 0.12);
}

.sdb-pop__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-secondary, #64748B);
  cursor: pointer;
}

.sdb-pop__consent input { margin-top: 3px; flex-shrink: 0; }

.sdb-pop__submit {
  width: 100%;
  padding: 13px 18px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bg-dark, #0F1720);
  background: var(--gold, #D1A027);
  border: 1px solid var(--gold, #D1A027);
  border-radius: 8px;
  cursor: pointer;
}

.sdb-pop__submit:hover { opacity: 0.88; }
.sdb-pop__submit[disabled] { opacity: 0.6; cursor: default; }

.sdb-pop__msg {
  margin: 12px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.sdb-pop__msg--error { color: #EF4444; }
.sdb-pop__msg--ok { color: #15803D; }

.sdb-pop__score {
  margin: 14px 0 0;
  padding: 12px 14px;
  font-size: 0.85rem;
  background: var(--bg-light, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
}

.sdb-pop__score a { font-weight: 600; }

@keyframes sdb-pop-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sdb-pop-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .sdb-pop, .sdb-pop__card { animation: none; }
}

@media (max-width: 520px) {
  .sdb-pop { padding: 0; align-items: flex-end; }
  .sdb-pop__card { max-width: none; border-radius: 14px 14px 0 0; padding: 26px 20px 22px; }
}
