/* 독자 웹진 뉴스레터 — 비동기 제출 및 결과 모달 */
.wz-sub__field {
  display: flex;
  min-width: 220px;
  flex: 1;
}

.wz-sub__field .wz-sub__input {
  width: 100%;
  max-width: none;
}

.wz-sub__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wz-sub__msg[hidden] {
  display: none;
}

.wz-sub__form .wz-sub__msg--err {
  max-width: 520px;
  margin: 0;
}

.wz-sub__btn {
  position: relative;
  display: inline-flex;
  min-width: 108px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wz-sub__btn:focus-visible,
.wz-sub-modal button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-secondary, #38bdf8) 72%, white);
  outline-offset: 3px;
}

.wz-sub__btn[aria-busy="true"] {
  cursor: wait;
  opacity: .82;
  transform: none;
}

.wz-sub__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wz-sub-spin .7s linear infinite;
}

.wz-sub__btn[aria-busy="true"] .wz-sub__spinner {
  display: block;
}

.wz-sub-modal {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(440px, calc(100vw - 32px));
  height: fit-content !important;
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: 0 !important;
  padding: 0;
  overflow: visible;
  color: #e8edf6;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 26px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48), 0 0 0 1px rgba(255, 255, 255, .025);
  transform: translate(-50%, -50%);
}

.wz-sub-modal[open] {
  animation: none;
}

.wz-sub-modal::backdrop {
  background: rgba(3, 7, 18, .68);
  -webkit-backdrop-filter: blur(7px) saturate(.85);
  backdrop-filter: blur(7px) saturate(.85);
  animation: wz-sub-backdrop-in .28s ease-out both;
}

.wz-sub-modal__surface {
  position: relative;
  overflow: hidden;
  padding: 34px 34px 30px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 14% 0%, rgb(var(--accent-primary-rgb, 129 140 248) / .16), transparent 34%),
    radial-gradient(circle at 100% 88%, rgba(56, 189, 248, .09), transparent 38%),
    linear-gradient(145deg, rgba(17, 24, 39, .99), rgba(8, 13, 24, .99));
  text-align: center;
  animation: wz-sub-modal-surface-in .38s cubic-bezier(.16, 1, .3, 1) both;
}

.wz-sub-modal__surface::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.wz-sub-modal__accent {
  position: absolute;
  top: 0;
  left: 50%;
  width: 112px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--accent-primary, #818cf8), var(--accent-secondary, #38bdf8));
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent-primary, #818cf8) 58%, transparent);
  transform: translateX(-50%);
}

.wz-sub-modal__close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: #8d9bae;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.wz-sub-modal__close:hover {
  color: #fff;
  border-color: rgba(148, 163, 184, .3);
  background: rgba(255, 255, 255, .075);
  transform: rotate(3deg);
}

.wz-sub-modal__close svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.wz-sub-modal__icon {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 22px;
  place-items: center;
  color: #c7d2fe;
  border: 1px solid rgb(var(--accent-primary-rgb, 129 140 248) / .28);
  border-radius: 21px;
  background: linear-gradient(145deg, rgb(var(--accent-primary-rgb, 129 140 248) / .19), rgba(56, 189, 248, .07));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.wz-sub-modal[data-modal-type="warning"] .wz-sub-modal__icon {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, .3);
  background: linear-gradient(145deg, rgba(245, 158, 11, .18), rgba(251, 191, 36, .05));
}

.wz-sub-modal__icon-envelope {
  width: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wz-sub-modal__icon-check {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 24px;
  height: 24px;
  padding: 4px;
  color: #fff;
  border: 3px solid #0d1421;
  border-radius: 50%;
  background: linear-gradient(145deg, #10b981, #059669);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wz-sub-modal[data-modal-type="warning"] .wz-sub-modal__icon-check {
  background: linear-gradient(145deg, #f59e0b, #d97706);
}

.wz-sub-modal__eyebrow {
  margin: 0 0 9px;
  color: var(--accent-primary-readable, var(--accent-primary, #818cf8));
  font-family: "Outfit", var(--font-body, sans-serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .22em;
}

.wz-sub-modal__title {
  margin: 0;
  color: #f8fafc;
  font-family: "Outfit", var(--font-body, sans-serif);
  font-size: clamp(23px, 5vw, 27px);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.025em;
  word-break: keep-all;
}

.wz-sub-modal__message {
  max-width: 350px;
  margin: 14px auto 0;
  color: #a8b3c4;
  font-size: 14px;
  line-height: 1.75;
  word-break: keep-all;
}

.wz-sub-modal__tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 0;
  padding: 10px 13px;
  color: #7f8da2;
  border: 1px solid rgba(148, 163, 184, .11);
  border-radius: 12px;
  background: rgba(255, 255, 255, .026);
  font-size: 11px;
  line-height: 1.5;
}

.wz-sub-modal__tip[hidden] {
  display: none;
}

.wz-sub-modal__tip svg {
  width: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.wz-sub-modal__confirm {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
  padding: 11px 20px;
  color: var(--on-accent-primary, #fff);
  border: 0;
  border-radius: 13px;
  background: linear-gradient(105deg, var(--accent-primary, #6366f1), color-mix(in srgb, var(--accent-primary, #6366f1) 66%, var(--accent-secondary, #38bdf8)));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent-primary, #6366f1) 22%, transparent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}

.wz-sub-modal__confirm:hover {
  filter: brightness(1.08);
  box-shadow: 0 13px 30px color-mix(in srgb, var(--accent-primary, #6366f1) 29%, transparent);
  transform: translateY(-1px);
}

[data-mode="light"] .wz-sub-modal {
  color: #334155;
  border-color: rgba(15, 23, 42, .1);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24), 0 0 0 1px rgba(255, 255, 255, .7);
}

[data-mode="light"] .wz-sub-modal__surface {
  background:
    radial-gradient(circle at 14% 0%, rgb(var(--accent-primary-rgb, 99 102 241) / .1), transparent 34%),
    radial-gradient(circle at 100% 88%, rgba(14, 165, 233, .07), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(247, 249, 252, .99));
}

[data-mode="light"] .wz-sub-modal__close { color: #64748b; border-color: rgba(15, 23, 42, .09); background: rgba(15, 23, 42, .025); }
[data-mode="light"] .wz-sub-modal__close:hover { color: #0f172a; background: rgba(15, 23, 42, .06); }
[data-mode="light"] .wz-sub-modal__icon { color: var(--accent-primary-readable, #6366f1); box-shadow: 0 14px 32px rgb(var(--accent-primary-rgb, 99 102 241) / .13), inset 0 1px 0 #fff; }
[data-mode="light"] .wz-sub-modal__icon-check { border-color: #f8fafc; }
[data-mode="light"] .wz-sub-modal__title { color: #111827; }
[data-mode="light"] .wz-sub-modal__message { color: #536176; }
[data-mode="light"] .wz-sub-modal__tip { color: #64748b; border-color: rgba(15, 23, 42, .07); background: rgba(15, 23, 42, .025); }

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

@keyframes wz-sub-modal-surface-in {
  from { opacity: 0; transform: translateY(18px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wz-sub-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 520px) {
  .wz-sub-modal { width: calc(100vw - 24px); border-radius: 22px; }
  .wz-sub-modal__surface { padding: 30px 22px 23px; }
  .wz-sub-modal__icon { width: 62px; height: 62px; margin-bottom: 19px; border-radius: 19px; }
  .wz-sub-modal__tip { align-items: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .wz-sub-modal__surface,
  .wz-sub-modal::backdrop,
  .wz-sub__spinner {
    animation-duration: .01ms;
    animation-iteration-count: 1;
  }
}
