:root {
  --dg-welcome-ink: #170728;
  --dg-welcome-surface: rgba(35, 14, 58, 0.88);
  --dg-welcome-purple: #9257ff;
  --dg-welcome-purple-light: #bda0ff;
  --dg-welcome-text: #fbf9ff;
  --dg-welcome-muted: #c2b4d7;
}

#dg-auth-welcome {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 32px 20px;
  color: var(--dg-welcome-text);
  background:
    radial-gradient(ellipse at 50% 22%, rgba(103, 49, 162, 0.2), transparent 38%),
    radial-gradient(ellipse at 90% 90%, rgba(96, 41, 151, 0.16), transparent 34%),
    var(--dg-welcome-ink);
  font-family: InterVariable, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
}

#dg-auth-welcome:focus {
  outline: none;
}

#dg-auth-welcome *,
#dg-auth-welcome *::before,
#dg-auth-welcome *::after {
  box-sizing: border-box;
}

#dg-auth-welcome .dg-welcome-shell {
  width: min(100%, 424px);
  padding: clamp(30px, 6vw, 48px);
  border: 1px solid rgba(226, 207, 255, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(78, 37, 119, 0.26), transparent 54%),
    var(--dg-welcome-surface);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.34), 0 0 70px rgba(107, 48, 169, 0.12);
  text-align: center;
  animation: dg-welcome-arrive 620ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

#dg-auth-welcome .dg-welcome-mark {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin: 0 auto 22px;
  filter: drop-shadow(0 0 28px rgba(193, 156, 255, 0.28));
}

#dg-auth-welcome .dg-welcome-eyebrow {
  margin: 0 0 10px;
  color: var(--dg-welcome-purple-light);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#dg-auth-welcome h1 {
  margin: 0;
  color: var(--dg-welcome-text);
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

#dg-auth-welcome .dg-welcome-copy {
  max-width: 290px;
  margin: 14px auto 30px;
  color: var(--dg-welcome-muted);
  font-size: 14px;
  line-height: 1.6;
}

#dg-auth-welcome .dg-welcome-actions {
  display: grid;
  gap: 12px;
}

#dg-auth-welcome .dg-account-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  text-align: left;
}

#dg-auth-welcome .dg-account-form label {
  display: grid;
  gap: 6px;
  color: var(--dg-welcome-muted);
  font-size: 12px;
  font-weight: 650;
}

#dg-auth-welcome .dg-account-form label span {
  font-weight: 450;
}

#dg-auth-welcome .dg-account-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(224, 203, 255, 0.25);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--dg-welcome-text);
  background: rgba(11, 3, 25, 0.5);
  font: inherit;
}

#dg-auth-welcome .dg-account-form input:focus-visible {
  outline: 3px solid rgba(189, 160, 255, 0.55);
  outline-offset: 1px;
}

#dg-auth-welcome button {
  min-height: 52px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 22px;
  color: var(--dg-welcome-text);
  font: inherit;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

#dg-auth-welcome button:hover {
  transform: translateY(-1px);
}

#dg-auth-welcome button:focus-visible {
  outline: 3px solid #d4c0ff;
  outline-offset: 3px;
}

#dg-auth-welcome .dg-welcome-primary {
  color: #211038;
  background: linear-gradient(105deg, #fff 5%, #efe6ff 100%);
  box-shadow: 0 9px 26px rgba(213, 193, 255, 0.16);
}

#dg-auth-welcome .dg-welcome-primary:hover {
  box-shadow: 0 12px 32px rgba(213, 193, 255, 0.25);
}

#dg-auth-welcome .dg-welcome-secondary {
  border-color: rgba(224, 203, 255, 0.25);
  background: rgba(255, 255, 255, 0.055);
}

#dg-auth-welcome .dg-welcome-secondary:hover {
  border-color: rgba(224, 203, 255, 0.48);
  background: rgba(255, 255, 255, 0.09);
}

#dg-auth-welcome .dg-welcome-guest {
  min-height: 40px;
  margin-top: 7px;
  color: var(--dg-welcome-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

#dg-auth-welcome .dg-welcome-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #ffd2d2;
  font-size: 12px;
}

#dg-auth-welcome .dg-welcome-footer {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(22px, env(safe-area-inset-left));
  display: flex;
  justify-content: center;
  color: rgba(214, 201, 231, 0.66);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: center;
}

body.dg-auth-entry-active [role="dialog"],
body.dg-auth-entry-active dialog,
body.dg-auth-entry-active [aria-modal="true"]:not(#dg-auth-welcome) {
  width: min(calc(100vw - 32px), 440px) !important;
  max-width: 440px !important;
  padding: clamp(24px, 5vw, 36px) !important;
  border: 1px solid rgba(218, 194, 255, 0.2) !important;
  border-radius: 24px !important;
  color: var(--dg-welcome-text) !important;
  background: #211035 !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48), 0 0 60px rgba(146, 87, 255, 0.12) !important;
}

body.dg-auth-entry-active [role="dialog"] h1,
body.dg-auth-entry-active [role="dialog"] h2,
body.dg-auth-entry-active dialog h1,
body.dg-auth-entry-active dialog h2 {
  color: var(--dg-welcome-text) !important;
  letter-spacing: -0.035em;
}

body.dg-auth-entry-active [role="dialog"] p,
body.dg-auth-entry-active [role="dialog"] label,
body.dg-auth-entry-active dialog p,
body.dg-auth-entry-active dialog label {
  color: var(--dg-welcome-muted) !important;
}

body.dg-auth-entry-active [role="dialog"] a,
body.dg-auth-entry-active dialog a {
  color: var(--dg-welcome-purple-light) !important;
}

body.dg-auth-entry-active [role="dialog"] input,
body.dg-auth-entry-active dialog input {
  min-height: 48px;
  border: 1px solid rgba(222, 204, 245, 0.22) !important;
  border-radius: 12px !important;
  color: var(--dg-welcome-text) !important;
  background: rgba(11, 4, 19, 0.5) !important;
}

body.dg-auth-entry-active [role="dialog"] input:focus,
body.dg-auth-entry-active dialog input:focus {
  border-color: var(--dg-welcome-purple-light) !important;
  box-shadow: 0 0 0 3px rgba(146, 87, 255, 0.2) !important;
}

body.dg-auth-entry-active [role="dialog"] button:not([aria-label]),
body.dg-auth-entry-active dialog button:not([aria-label]) {
  min-height: 44px;
  border: 1px solid rgba(224, 203, 255, 0.22);
  border-radius: 999px !important;
  color: var(--dg-welcome-text);
  background: rgba(255, 255, 255, 0.055);
  font-weight: 700;
}

body.dg-auth-entry-active [role="dialog"] button[type="submit"],
body.dg-auth-entry-active dialog button[type="submit"] {
  border-color: transparent;
  color: #211038;
  background: linear-gradient(105deg, #fff 5%, #efe6ff 100%);
  box-shadow: 0 9px 26px rgba(213, 193, 255, 0.16);
}

@keyframes dg-welcome-arrive {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 560px) {
  #dg-auth-welcome {
    padding: 20px 16px calc(76px + env(safe-area-inset-bottom));
  }

  #dg-auth-welcome .dg-welcome-shell {
    padding: 34px 25px 27px;
    border-radius: 24px;
  }

  #dg-auth-welcome .dg-welcome-mark {
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
  }

  #dg-auth-welcome .dg-welcome-footer {
    bottom: max(16px, env(safe-area-inset-bottom));
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dg-auth-welcome .dg-welcome-shell {
    animation: none;
  }

  #dg-auth-welcome button {
    transition: none;
  }
}
