:root {
  --seo-auth-pink: var(--pink-dark, #d72a87);
  --seo-auth-purple: var(--purple, #8d4ff4);
  --seo-auth-blue: var(--blue, #42a5f5);
  --seo-auth-accent: var(--seo-auth-purple);
  --seo-auth-brand-gradient: var(--brand-gradient, linear-gradient(105deg, #d72a87, #8d4ff4 56%, #42a5f5));
  --seo-auth-danger: #fca5a5;
}

body.seo-auth-open {
  overflow: hidden;
}

.seo-auth-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.seo-auth-trigger.is-authenticated {
  max-width: 152px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-auth-overlay[hidden],
.seo-auth-email-panel[hidden],
.seo-auth-field[hidden],
.seo-auth-account-menu[hidden],
.seo-upload-card[hidden],
.seo-toast-region:empty {
  display: none;
}

.seo-auth-overlay {
  align-items: center;
  background: rgb(11 8 17 / 76%);
  backdrop-filter: blur(18px);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
  position: fixed;
  z-index: 1000;
}

.seo-auth-dialog {
  background:
    radial-gradient(circle at 100% 0, rgb(66 165 245 / 12%), transparent 31%),
    radial-gradient(circle at 0 100%, rgb(215 42 135 / 10%), transparent 34%),
    rgb(18 15 24 / 98%);
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgb(6 4 10 / 58%), 0 0 0 1px rgb(141 79 244 / 8%);
  color: #fff;
  max-height: calc(100dvh - 32px);
  max-width: 440px;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  width: 100%;
}

.seo-auth-close {
  align-items: center;
  appearance: none;
  background: rgb(255 255 255 / 8%);
  border: 0;
  border-radius: 10px;
  color: rgb(255 255 255 / 70%);
  cursor: pointer;
  display: flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 20px;
  top: 20px;
  transition: 160ms ease;
  width: 34px;
}

.seo-auth-close:hover,
.seo-auth-close:focus-visible {
  background: rgb(255 255 255 / 14%);
  color: #fff;
}

.seo-auth-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.seo-auth-brand img {
  background: linear-gradient(145deg, rgb(215 42 135 / 18%), rgb(66 165 245 / 15%));
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgb(141 79 244 / 15%);
  height: 44px;
  object-fit: contain;
  padding: 6px;
  width: 44px;
}

.seo-auth-brand strong,
.seo-auth-brand span {
  display: block;
}

.seo-auth-brand strong {
  font-size: 18px;
}

.seo-auth-brand span {
  color: rgb(255 255 255 / 45%);
  font-size: 12px;
  margin-top: 3px;
}

.seo-auth-heading {
  font-size: 26px;
  letter-spacing: -0.025em;
  margin: 0;
}

.seo-auth-description {
  color: rgb(255 255 255 / 50%);
  font-size: 14px;
  line-height: 1.55;
  margin: 8px 0 18px;
}

.seo-auth-tabs {
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 13px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
  padding: 4px;
}

.seo-auth-tab,
.seo-auth-provider,
.seo-auth-email-button,
.seo-auth-submit,
.seo-auth-send-code {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.seo-auth-tab {
  background: transparent;
  border-radius: 9px;
  color: rgb(255 255 255 / 55%);
  height: 40px;
}

.seo-auth-tab.is-active {
  background: rgb(255 255 255 / 13%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%), 0 8px 20px rgb(0 0 0 / 18%);
  color: #fff;
}

.seo-auth-provider,
.seo-auth-email-button {
  align-items: center;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  color: #fff;
  display: flex;
  gap: 9px;
  height: 46px;
  justify-content: center;
  margin-top: 10px;
  transition: 160ms ease;
  width: 100%;
}

.seo-auth-provider:hover,
.seo-auth-email-button:hover {
  background: rgb(255 255 255 / 12%);
  border-color: rgb(255 255 255 / 20%);
}

.seo-auth-google-mark {
  align-items: center;
  background: #fff;
  border-radius: 50%;
  color: #4285f4;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.seo-auth-email-panel {
  margin-top: 14px;
}

.seo-auth-email-header {
  align-items: center;
  color: rgb(255 255 255 / 38%);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.seo-auth-other-methods {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgb(255 255 255 / 62%);
  cursor: pointer;
  font: inherit;
  padding: 4px 0;
}

.seo-auth-form {
  display: grid;
  gap: 11px;
}

.seo-auth-input-wrap {
  position: relative;
}

.seo-auth-input {
  appearance: none;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  color: #fff;
  font: inherit;
  height: 48px;
  outline: none;
  padding: 0 15px;
  transition: 160ms ease;
  width: 100%;
}

.seo-auth-input::placeholder {
  color: rgb(255 255 255 / 35%);
}

.seo-auth-input:focus {
  border-color: var(--seo-auth-accent);
  box-shadow: 0 0 0 3px rgb(141 79 244 / 16%);
}

.seo-auth-password-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgb(255 255 255 / 48%);
  cursor: pointer;
  padding: 7px;
  position: absolute;
  right: 9px;
  top: 7px;
}

.seo-auth-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 116px;
}

.seo-auth-captcha {
  align-items: center;
  background: #fff;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
  color: #111;
  cursor: pointer;
  display: flex;
  font-size: 11px;
  height: 48px;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.seo-auth-captcha img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.seo-auth-captcha img[hidden],
.seo-auth-captcha span[hidden] {
  display: none;
}

.seo-auth-captcha:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.seo-auth-send-code {
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  color: #fff;
  min-width: 116px;
  padding: 0 10px;
}

.seo-auth-submit {
  background: var(--seo-auth-brand-gradient);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgb(141 79 244 / 25%);
  color: #fff;
  font-weight: 700;
  height: 48px;
  margin-top: 2px;
  transition: 160ms ease;
  width: 100%;
}

.seo-auth-submit:hover,
.seo-auth-submit:focus-visible {
  box-shadow: 0 16px 34px rgb(141 79 244 / 34%);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.seo-auth-submit:disabled,
.seo-auth-send-code:disabled,
.seo-auth-provider:disabled,
.seo-auth-email-button:disabled,
.seo-auth-tab:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.seo-auth-error {
  color: var(--seo-auth-danger);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.seo-auth-terms {
  color: rgb(255 255 255 / 38%);
  font-size: 12px;
  line-height: 1.6;
  margin: 18px 0 0;
  text-align: center;
}

.seo-auth-terms a {
  color: rgb(255 255 255 / 72%);
}

.seo-auth-loading {
  align-items: center;
  background: rgb(12 12 15 / 86%);
  backdrop-filter: blur(8px);
  border-radius: inherit;
  display: none;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  padding: 32px;
  position: absolute;
  text-align: center;
  z-index: 3;
}

.seo-auth-dialog.is-loading .seo-auth-loading {
  display: flex;
}

.seo-auth-spinner {
  animation: seo-auth-spin 0.9s linear infinite;
  border: 3px solid rgb(141 79 244 / 22%);
  border-radius: 50%;
  border-right-color: var(--seo-auth-blue);
  border-top-color: var(--seo-auth-pink);
  height: 38px;
  margin-bottom: 16px;
  width: 38px;
}

.seo-auth-loading strong {
  font-size: 16px;
}

.seo-auth-loading span {
  color: rgb(255 255 255 / 52%);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 7px;
}

.seo-auth-account-menu {
  background:
    radial-gradient(circle at 100% 0, rgb(141 79 244 / 12%), transparent 42%),
    rgb(18 15 24 / 98%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 15px;
  box-shadow: 0 18px 45px rgb(0 0 0 / 42%);
  color: #fff;
  min-width: 220px;
  padding: 8px;
  position: fixed;
  z-index: 950;
}

.seo-auth-account-summary {
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  margin-bottom: 6px;
  padding: 7px 8px 11px;
}

.seo-auth-account-summary strong,
.seo-auth-account-summary small {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-auth-account-summary strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
}

.seo-auth-account-summary small {
  color: rgb(255 255 255 / 45%);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
}

.seo-auth-account-menu a,
.seo-auth-account-menu button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 9px;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.seo-auth-account-menu a:hover,
.seo-auth-account-menu button:hover {
  background: rgb(255 255 255 / 9%);
}

.seo-auth-account-menu a svg,
.seo-auth-account-menu button svg {
  color: rgb(255 255 255 / 58%);
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.seo-toast-region {
  display: grid;
  gap: 10px;
  max-width: min(360px, calc(100vw - 28px));
  position: fixed;
  right: 18px;
  top: 92px;
  z-index: 1100;
}

.seo-toast {
  animation: seo-toast-in 180ms ease-out;
  background:
    radial-gradient(circle at 100% 0, rgb(141 79 244 / 12%), transparent 42%),
    rgb(18 15 24 / 97%);
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgb(0 0 0 / 36%);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 15px;
}

.seo-toast.is-error {
  border-color: rgb(252 165 165 / 45%);
}

.seo-toast.is-success {
  border-color: rgb(134 239 172 / 42%);
}

.seo-upload-card {
  align-items: center;
  background: linear-gradient(100deg, rgb(215 42 135 / 5%), rgb(66 165 245 / 5%)), rgb(255 255 255 / 82%);
  border: 1px solid rgb(141 79 244 / 12%);
  border-radius: 14px;
  color: #282536;
  display: grid;
  gap: 11px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  margin: 10px 14px 8px;
  padding: 9px;
  transition: background 180ms ease, border-color 180ms ease;
}

.seo-upload-card.is-complete {
  border-color: rgb(141 79 244 / 20%);
}

.seo-upload-card.is-error {
  background: rgb(255 247 247 / 88%);
  border-color: rgb(220 38 38 / 18%);
}

.seo-upload-preview {
  background: #e8e6ee;
  border-radius: 10px;
  height: 54px;
  overflow: hidden;
  position: relative;
  width: 54px;
}

.seo-upload-card.is-complete .seo-upload-preview::after {
  align-items: center;
  background: #22a06b;
  border: 2px solid #fff;
  border-radius: 999px;
  bottom: 3px;
  color: #fff;
  content: "✓";
  display: flex;
  font-size: 10px;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  position: absolute;
  right: 3px;
  width: 18px;
}

.seo-upload-preview img,
.seo-upload-preview video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.seo-upload-meta {
  min-width: 0;
}

.seo-upload-meta strong,
.seo-upload-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-upload-card.is-complete .seo-upload-meta > span {
  color: #4f6f61;
}

.seo-upload-card.is-error .seo-upload-meta > span {
  color: #b42318;
}

.seo-upload-meta strong {
  font-size: 13px;
}

.seo-upload-meta span {
  color: #777282;
  font-size: 11px;
  margin-top: 4px;
}

.seo-upload-progress {
  background: rgb(45 39 69 / 12%);
  border-radius: 999px;
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
}

.seo-upload-progress span {
  background: linear-gradient(90deg, #d428b4, #4d9cff);
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.seo-upload-card.is-complete .seo-upload-progress,
.seo-upload-card.is-error .seo-upload-progress {
  display: none;
}

.seo-upload-remove {
  align-items: center;
  appearance: none;
  background: rgb(45 39 69 / 8%);
  border: 0;
  border-radius: 999px;
  color: #4a4557;
  cursor: pointer;
  display: flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.seo-upload-remove:hover,
.seo-upload-remove:focus-visible {
  background: rgb(45 39 69 / 14%);
}

.hero-tool-button.is-uploading svg {
  animation: seo-auth-spin 0.9s linear infinite;
}

@keyframes seo-auth-spin {
  to { transform: rotate(360deg); }
}

@keyframes seo-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

@media (max-width: 640px) {
  .seo-auth-dialog {
    border-radius: 20px;
    padding: 24px 20px;
  }

  .seo-auth-overlay {
    align-items: flex-start;
    padding-top: 12px;
  }

  .seo-toast-region {
    left: 14px;
    right: 14px;
    top: 76px;
  }

  .seo-upload-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    margin-inline: 8px;
  }

  .seo-upload-preview {
    height: 46px;
    width: 46px;
  }
}
