/* EBD native signup/signin. Uses the same design tokens as the rest of the site.
   Billing/paid-tier management remains in Ghost Portal; no iframe CSS injection. */
html.ebd-auth-open { overflow: hidden; }
.ebd-site .ebd-member-dialog {
  position: fixed; inset: 0; width: min(520px, calc(100% - 36px));
  max-width: calc(100% - 36px); max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px); margin: auto; padding: 0;
  border: 1px solid var(--ebd-line); border-top: 4px solid var(--ebd-accent);
  border-radius: 12px; background: var(--ebd-paper); color: var(--ebd-ink);
  box-shadow: 0 28px 90px rgba(14, 29, 37, .24); overflow: auto;
  overscroll-behavior: contain; scrollbar-width: thin; font-family: var(--ebd-body);
  font-size: 15px; line-height: 1.65; letter-spacing: 0;
}
.ebd-site .ebd-member-dialog:not([open]) { display: none; }
.ebd-member-dialog::backdrop { background: rgba(19, 32, 40, .36); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ebd-auth-shell { position: relative; padding: 34px 38px 30px; }
.ebd-site .ebd-auth-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px;
  padding: 10px; display: flex; justify-content: center; align-items: center;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--ebd-muted);
}
.ebd-site .ebd-auth-close:hover { background: var(--ebd-surface); color: var(--ebd-accent-ink); }
.ebd-auth-brand { display: flex; align-items: center; gap: 16px; padding-right: 38px; margin-bottom: 30px; }
.ebd-auth-brand .ebd-wordmark { font-size: 36px; }
.ebd-auth-brand .ebd-brand-name { font-size: 9px; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; }
.ebd-site .ebd-auth-title { margin: 0 0 14px; font: 780 34px/1.15 var(--ebd-heading); letter-spacing: -1.25px; color: var(--ebd-ink); }
.ebd-auth-title > span { color: var(--ebd-accent-ink); }
.ebd-site .ebd-auth-intro { margin: 0 0 24px; font-size: 14px; line-height: 1.75; color: var(--ebd-muted); }
.ebd-auth-intro a { text-decoration: underline; text-underline-offset: 3px; }
.ebd-auth-field { margin-bottom: 16px; }
.ebd-auth-field label { display: block; margin: 0 0 6px; font-size: 12px; line-height: 1.6; font-weight: 650; color: var(--ebd-ink); }
.ebd-auth-field label span { margin-left: 3px; color: var(--ebd-muted); font-weight: 400; }
.ebd-site .ebd-auth-field input[type='text'],.ebd-site .ebd-auth-field input[type='email'] {
  display: block; width: 100%; min-width: 0; height: 48px; min-height: 48px;
  padding: 11px 13px; border: 1px solid var(--ebd-line); border-radius: 5px;
  background: var(--ebd-paper); color: var(--ebd-ink); font-size: 16px;
  font-weight: 400; line-height: 1.5; box-shadow: none;
}
.ebd-auth-field input::placeholder { color: var(--ebd-muted); opacity: .85; }
.ebd-site .ebd-auth-field input:focus { border-color: var(--ebd-accent); outline: 2px solid var(--ebd-accent); outline-offset: 2px; }
.ebd-site .ebd-auth-submit { width: 100%; min-height: 48px; margin-top: 4px; padding: 12px 16px; font-size: 14px; border-radius: 5px; justify-content: space-between; }
.ebd-auth-submit svg { width: 19px; height: 19px; }
.ebd-site .ebd-auth-note { margin: 12px 0 0; font-size: 11px; line-height: 1.75; color: var(--ebd-muted); }
.ebd-auth-loading-label { display: none; }
.ebd-auth-form.loading .ebd-auth-submit-label { display: none; }
.ebd-auth-form.loading .ebd-auth-loading-label { display: inline; }
.ebd-auth-form.loading .ebd-auth-submit { cursor: wait; opacity: .8; }
.ebd-site .ebd-auth-error { display: none; margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--ebd-accent); border-radius: 5px; background: var(--ebd-soft-accent); color: var(--ebd-ink); font-size: 13px; line-height: 1.6; }
.ebd-auth-form.error .ebd-auth-error:not(:empty) { display: block; }
.ebd-auth-success { display: none; }
.ebd-auth-form.success .ebd-auth-fields,.ebd-auth-form.success .ebd-auth-error { display: none; }
.ebd-auth-form.success .ebd-auth-success { display: block; padding: 22px; border: 1px solid var(--ebd-line); border-radius: 7px; background: var(--ebd-surface); }
.ebd-auth-success-mark { display: flex; width: 36px; height: 36px; margin-bottom: 15px; justify-content: center; align-items: center; border: 1px solid var(--ebd-accent); color: var(--ebd-accent-ink); border-radius: 50%; }
.ebd-auth-success-mark svg { width: 19px; height: 19px; }
.ebd-site .ebd-auth-success h3 { margin: 0 0 8px; font-size: 23px; line-height: 1.25; letter-spacing: -.6px; font-weight: 750; }
.ebd-site .ebd-auth-success p { margin: 0 0 8px; font-size: 13px; color: var(--ebd-muted); }
.ebd-site .ebd-auth-success .ebd-auth-sent-email { color: var(--ebd-ink); font-weight: 600; overflow-wrap: anywhere; }
.ebd-site .ebd-auth-reset { border: 0; padding: 10px 0; min-height: 44px; background: transparent; color: var(--ebd-accent-ink); font-size: 12px; font-weight: 650; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.ebd-auth-switch { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ebd-line); color: var(--ebd-muted); font-size: 12px; text-align: center; }
.ebd-auth-switch:empty { display: none; }
.ebd-site .ebd-auth-switch a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 3px; color: var(--ebd-accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ebd-auth-page { max-width: 480px; margin: 0 auto; padding: 30px; background: var(--ebd-rail); border: 1px solid var(--ebd-line); border-top: 3px solid var(--ebd-accent); border-radius: 8px; }
/* Also exclude old Code Injection/default footer links without hiding the newsletter card. */
.ebd-sidebar-footer a[href*='/signup'],.ebd-sidebar-footer a[href*='/sign-up'],.ebd-sidebar-footer [data-ebd-auth='signup'] { display: none !important; }
@media (max-width: 540px) {
  .ebd-site .ebd-member-dialog { width: calc(100% - 24px); max-width: calc(100% - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 9px; }
  .ebd-auth-shell { padding: 26px 23px 20px; }
  .ebd-auth-brand { margin-bottom: 24px; }
  .ebd-site .ebd-auth-title { font-size: 30px; letter-spacing: -1px; }
  .ebd-site .ebd-auth-intro { font-size: 13px; margin-bottom: 22px; }
  .ebd-auth-page { padding: 22px 18px; }
  .ebd-auth-switch { margin-top: 18px; padding-top: 12px; }
}
@media (prefers-reduced-motion: no-preference) { .ebd-member-dialog[open] { animation: ebd-auth-appear .18s ease-out; } }
@keyframes ebd-auth-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media print { .ebd-member-dialog,.ebd-member-dialog::backdrop { display: none !important; } }
