/* The CMS owns the login destinations; this file only controls presentation. */
html:has(#modal[open]), body:has(#modal[open]) { overflow: hidden; }
#modal {
  box-sizing: border-box;
  width: min(40rem, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 52px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 24px 80px #10071d40;
}
#modal[open] { display: flex; flex-direction: column; }
#modal::backdrop { background: #10071d85; backdrop-filter: blur(7px); }
#modal .close-modal {
  position: absolute;
  top: 10px;
  inset-inline-end: 12px;
  inset-inline-start: auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
}
#modal .close-modal .taz-icon { width: 21px; height: 21px; }
#modal .close-modal:hover { background: color-mix(in srgb, var(--purple) 12%, var(--cream)); }
#modal :is(a, button):focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
#modal-body {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0 24px 24px;
  scroll-padding: 16px;
}
#modal-body:has(.login-option) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}
#modal-body > :not(.login-option) { grid-column: 1 / -1; }
#modal .modal-logo { display: flex; justify-content: center; margin: 0; }
#modal .modal-logo .logo { width: 52px; height: 52px; }
#modal h2 { margin: 0; text-align: center; font-size: 1.5rem; line-height: 1.5; }
#modal p { margin: 0 0 6px; text-align: center; font-size: 1rem; line-height: 1.6; color: var(--muted); }
#modal .login-option {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 96px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: start;
  text-decoration: none;
  background: color-mix(in srgb, var(--purple) 7%, var(--cream));
  color: var(--ink);
  transition: background .18s ease, border-color .18s ease;
}
#modal .login-option > span:first-child { min-width: 0; }
#modal .login-option > span:last-child:not(:first-child) { display: none; }
#modal .login-option b { display: block; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
#modal .login-option small { display: block; margin-top: 5px; font-size: .875rem; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
#modal .login-option:hover { border-color: var(--purple); background: color-mix(in srgb, var(--purple) 14%, var(--cream)); }
#modal p.small { margin: 4px 0 0; font-size: .875rem; }
@media (max-width: 559px) {
  #modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); border-radius: 20px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  #modal-body { padding: 0 16px 20px; }
  #modal-body:has(.login-option) { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #modal .login-option { min-height: 76px; padding: 12px 14px; border-radius: 14px; }
  #modal .modal-logo .logo { width: 44px; height: 44px; }
  #modal h2 { font-size: 1.375rem; }
}
@media (max-height: 480px) {
  #modal .modal-logo { display: none; }
  #modal .login-option { min-height: 72px; padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) { #modal .login-option { transition: none; } }
