/* Publisher entry points reuse the panel's semantic light/dark tokens. */
.publisher-auth {
  margin: 0;
  background: var(--theme-bg);
  color: var(--theme-text);
  font:
    15px/1.6 var(--panel-font),
    sans-serif;
}
.publisher-auth * {
  box-sizing: border-box;
}
.publisher-auth [hidden] {
  display: none !important;
}
.publisher-auth a {
  color: var(--theme-link);
}
.publisher-auth button,
.publisher-auth input,
.publisher-auth select,
.publisher-auth textarea {
  font: inherit;
}
.publisher-auth button,
.publisher-auth a,
.publisher-auth input,
.publisher-auth select,
.publisher-auth textarea {
  -webkit-tap-highlight-color: transparent;
}
.publisher-auth :focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 3px;
}
.auth-header {
  max-width: 1240px;
  margin: auto;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-brand {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -1.4px;
  color: var(
    --theme-heading,
    var(--text-primary, var(--theme-text))
  ) !important;
  text-decoration: none;
}
.auth-brand span {
  color: var(--theme-link);
}
.auth-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.auth-header-right > a {
  font-weight: 700;
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: 1176px;
  margin: 12px auto 50px;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border-subtle);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--panel-card-shadow);
}
.auth-main {
  padding: 44px;
  min-width: 0;
}
.auth-eyebrow {
  display: block;
  color: var(--theme-link);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  margin-bottom: 12px;
}
.publisher-auth h1,
.publisher-auth h2,
.publisher-auth h3 {
  color: var(--theme-heading, var(--text-primary, var(--theme-text)));
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1px;
  text-wrap: balance;
  margin: 0 0 14px;
}
.publisher-auth h1 {
  font-size: clamp(28px, 3vw, 36px);
}
.publisher-auth h2 {
  font-size: 29px;
}
.publisher-auth h3 {
  font-size: 20px;
}
.publisher-auth p {
  margin: 0 0 24px;
  color: var(--theme-secondary);
}
.publisher-auth small,
.auth-helper {
  color: var(--theme-muted);
  font-size: 12px;
  line-height: 1.6;
}
.auth-field {
  display: grid;
  gap: 6px;
  font-weight: 700;
  margin-bottom: 18px;
  min-width: 0;
}
.auth-field > small {
  font-weight: 400;
}
.auth-field input,
.auth-field select,
.auth-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--theme-control-border);
  border-radius: 9px;
  background: var(--theme-input);
  color: var(--theme-text);
  padding: 11px 13px;
  font-weight: 400;
}
.auth-field input::placeholder,
.auth-field textarea::placeholder {
  color: var(--theme-muted);
  opacity: 1;
}
.auth-field textarea {
  resize: vertical;
  min-height: 110px;
}
.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
  border-color: var(--theme-focus);
  box-shadow: var(--theme-focus-ring);
}
.auth-field [aria-invalid="true"] {
  border-color: var(--theme-error);
}
.auth-field-error {
  color: var(--theme-error);
  font-size: 13px;
  font-weight: 600;
}
.auth-field-error:empty {
  display: none;
}
.auth-password {
  display: flex;
  position: relative;
}
.auth-password input {
  padding-right: 66px;
}
.auth-password button {
  position: absolute;
  right: 3px;
  top: 3px;
  bottom: 3px;
  padding: 0 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--theme-link);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.auth-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  margin: 16px 0;
  cursor: pointer;
}
.auth-checkbox input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--theme-primary);
}
.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--theme-primary);
  color: var(--theme-on-primary) !important;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.auth-button:hover {
  background: var(--theme-primary-hover);
  box-shadow: var(--theme-shadow);
}
.auth-button:active {
  transform: translateY(1px);
}
.auth-button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.auth-full {
  width: 100%;
}
.auth-secondary {
  background: var(--theme-surface);
  color: var(--theme-text) !important;
  border-color: var(--theme-border);
}
.auth-secondary:hover {
  background: var(--theme-hover);
}
.auth-text-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 10px 0;
  min-height: 44px;
  font-weight: 700;
  color: var(--theme-link);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.auth-note {
  border-top: 1px solid var(--theme-border-subtle);
  padding-top: 24px;
  margin-top: 28px;
}
.auth-notice {
  padding: 16px;
  border: 1px solid var(--theme-border);
  background: var(--theme-raised);
  border-radius: 10px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.auth-notice p {
  margin: 6px 0 14px;
}
.auth-notice[data-tone='warning'] { background: #fff8db; border-color: #d6aa2a; color: #705000; }
.auth-notice[data-tone='danger'] { background: #fff0f0; border-color: #e6a1a1; color: #9b2525; }
.auth-notice[data-tone='success'] { background: #eaf8ef; border-color: #78ba91; color: #17683c; }
html[data-theme='dark'] .auth-notice[data-tone='warning'] { background: #302713; border-color: #8e702c; color: #f5d779; }
html[data-theme='dark'] .auth-notice[data-tone='danger'] { background: #321a21; border-color: #8b3f50; color: #ffb4bd; }
html[data-theme='dark'] .auth-notice[data-tone='success'] { background: #142d24; border-color: #337454; color: #9ce0b7; }
.auth-notice:empty {
  display: none;
}
.auth-notice ul {
  margin-bottom: 0;
  padding-left: 20px;
}
.auth-story {
  padding: 44px;
  background: var(--theme-active);
  border-left: 1px solid var(--theme-border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.auth-story h2 {
  font-size: clamp(28px, 3vw, 36px);
}
.auth-story h2 em {
  font-style: normal;
  color: var(--theme-link);
}
.auth-hero {
  display: block;
  width: 100%;
  height: auto;
  max-height: 275px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
}
.auth-benefits {
  display: flex;
  gap: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 24px;
}
.auth-benefits span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-manager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.auth-manager strong,
.auth-manager small,
.auth-manager span:not(.auth-avatar) {
  display: block;
}
.auth-manager strong {
  font-size: 16px;
  color: var(--theme-heading, var(--text-primary, var(--theme-text)));
}
.auth-manager div > span {
  font-size: 12px;
  color: var(--theme-muted);
}
.auth-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-link);
  border-radius: 50%;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}
.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.auth-story > small {
  margin-top: 10px;
}
.auth-story .auth-text-button {
  align-self: flex-start;
}
.auth-footer {
  text-align: center;
  padding: 0 24px 26px;
  color: var(--theme-muted);
  font-size: 12px;
}
.auth-steps {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 22px 0 30px;
  gap: 14px;
  font-size: 12px;
}
.auth-steps li {
  flex: 1;
  border-top: 3px solid var(--theme-border);
  padding-top: 8px;
  color: var(--theme-muted);
}
.auth-steps [aria-current="step"] {
  border-color: var(--theme-primary);
  color: var(--theme-link);
  font-weight: 800;
}
.publisher-auth fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
  margin: 0 0 20px;
}
.publisher-auth legend {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 12px;
}
.auth-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
  padding: 14px;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--theme-surface);
  min-width: 0;
}
.auth-choice:has(input:checked) {
  border-color: var(--theme-primary);
  background: var(--theme-active);
}
.auth-choice input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--theme-primary);
  margin: 3px 0 0;
}
.auth-choice strong {
  display: block;
  font-size: 13px;
}
.auth-choice small {
  display: block;
  margin-top: 3px;
  font-weight: 400;
}
.auth-choice svg {
  width: 24px;
  height: 24px;
  display: block;
  margin-bottom: 8px;
  color: var(--theme-link);
}
.auth-chip-choices {
  grid-template-columns: 1fr 1fr;
}
.auth-chip-choices .auth-choice {
  padding: 10px;
  font-size: 12px;
}
.auth-review {
  margin-bottom: 22px;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  padding: 18px;
}
.auth-review dt {
  font-size: 12px;
  color: var(--theme-muted);
  margin-top: 12px;
}
.auth-review dt:first-child {
  margin-top: 0;
}
.auth-review dd {
  margin: 3px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.auth-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: 90dvh;
  padding: 28px;
  background: var(--theme-surface);
  color: var(--theme-text);
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  box-shadow: var(--panel-elevation);
}
.auth-dialog::backdrop {
  background: var(--theme-overlay);
}
.auth-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.auth-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--theme-border);
  border-radius: 50%;
  background: var(--theme-raised);
  color: var(--theme-text);
  font-size: 26px !important;
}
.auth-search {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 24px;
}
.auth-search .auth-field {
  flex: 1;
  margin: 0;
}
.auth-campaign-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.auth-campaign {
  border: 1px solid var(--theme-border);
  padding: 14px;
  border-radius: 12px;
  min-width: 0;
}
.auth-campaign img,
.auth-logo-fallback {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  display: grid;
  place-items: center;
  color: var(--theme-link);
  font-weight: 800;
  margin-bottom: 12px;
}
.auth-campaign h3 {
  font-size: 14px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  margin-bottom: 4px;
}
.auth-campaign p {
  font-size: 12px;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.auth-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 22px 0;
  font-size: 12px;
}
.auth-empty {
  grid-column: 1 / -1;
  padding: 26px;
  text-align: center;
  background: var(--theme-raised);
  border-radius: 12px;
}
@media (max-width: 1000px) {
  .auth-layout {
    margin: 12px 24px 40px;
  }
  .auth-main,
  .auth-story {
    padding: 28px;
  }
}
@media (max-width: 760px) {
  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 570px;
    margin: 4px auto 30px;
  }
  .auth-story {
    border-left: 0;
    border-top: 1px solid var(--theme-border-subtle);
  }
  .auth-hero {
    max-height: 230px;
  }
  .auth-campaign-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 580px) {
  .auth-header {
    padding: 20px;
  }
  .auth-header-right {
    gap: 12px;
  }
  .auth-header-right > a {
    font-size: 12px;
  }
  .auth-header .theme-toggle {
    min-width: 44px;
    padding: 10px;
  }
  .auth-header [data-theme-label] {
    display: none;
  }
  .auth-layout {
    margin: 0 12px 24px;
    border-radius: 18px;
  }
  .auth-main,
  .auth-story {
    padding: 24px 20px;
  }
  .auth-two {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .auth-choices {
    gap: 8px;
  }
  .auth-choice {
    padding: 10px;
  }
  .auth-dialog {
    padding: 18px;
    width: calc(100% - 20px);
  }
  .auth-brand {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .publisher-auth * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.auth-logo-fallback {
  background: var(--theme-active);
}
