.login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}
.login-button .icon {
  width: 19px;
  height: 19px;
}

.auth-dialog {
  color: var(--text);
  background:
    radial-gradient(
      ellipse at 50% 0,
      rgba(249, 177, 4, 0.055),
      transparent 48%
    ),
    var(--dialog-bg);
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 40px);
  padding: 25px 36px 26px;
  border: 1px solid rgba(var(--surface-rgb), 0.14);
  border-radius: 30px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
  overflow: auto;
  overscroll-behavior: contain;
}
:root[data-theme="light"] .auth-dialog {
  box-shadow: 0 30px 100px rgba(21, 27, 31, 0.16);
}
.auth-dialog::backdrop {
  background: rgba(7, 12, 16, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
:root[data-theme="light"] .auth-dialog::backdrop {
  background: rgba(237, 241, 245, 0.68);
}
.auth-dialog[open] {
  animation: auth-appear 0.22s ease-out;
}
@keyframes auth-appear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.auth-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}
.auth-brand {
  margin-right: auto;
}
.auth-brand img {
  display: block;
  width: 105px;
  height: 36px;
  object-fit: contain;
}
.auth-brand .brand-logo-light {
  display: none;
}
:root[data-theme="light"] .auth-brand .brand-logo-dark {
  display: none;
}
:root[data-theme="light"] .auth-brand .brand-logo-light {
  display: block;
}
.auth-header .icon-button {
  margin-right: -12px;
}
.auth-heading {
  text-align: center;
}
.auth-heading .section-eyebrow {
  color: var(--accent-ink);
  font-size: 9px;
  letter-spacing: 2px;
}
.auth-heading h2 {
  margin: 12px 0 13px;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1.2px;
}
/* The heading receives initial focus; interactive controls keep their ring. */
#auth-title:focus {
  outline: none;
}
.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.auth-qr-stage {
  display: flex;
  justify-content: center;
  padding: 25px 0 18px;
}
.auth-qr-frame {
  padding: 10px;
  border: 1px solid rgba(249, 177, 4, 0.6);
  border-radius: 25px;
  background: #ffffff;
  box-shadow:
    0 0 0 7px rgba(249, 177, 4, 0.055),
    0 12px 35px rgba(0, 0, 0, 0.12);
}
.auth-qr-frame img {
  display: block;
  width: 224px;
  height: 224px;
  max-width: 100%;
}
.auth-scan-hint {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.auth-scan-hint .icon {
  width: 17px;
  height: 17px;
  color: var(--accent-ink);
}
.auth-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 23px 0;
  color: var(--subtle);
  font-size: 11px;
}
.auth-separator::before,
.auth-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}
.auth-alternative {
  width: 100%;
  min-height: 56px;
  gap: 11px;
  color: var(--text-soft);
}
.auth-alternative span {
  flex: 1;
  text-align: left;
}
.auth-alternative .icon {
  width: 19px;
  height: 19px;
}
.auth-alternative .icon:first-child {
  color: var(--accent-ink);
}
.auth-alternative .icon:last-child {
  width: 17px;
  height: 17px;
}
.auth-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: var(--subtle);
}
.auth-footnote .icon {
  width: 14px;
  height: 14px;
}

#auth-password-form {
  margin-top: 27px;
}
.auth-field {
  margin-bottom: 19px;
}
.auth-field label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}
.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--input-bg);
  padding: 0 15px;
}
.auth-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 177, 4, 0.08);
}
.auth-input-wrap > .icon {
  width: 19px;
  height: 19px;
  color: var(--subtle);
}
.auth-field input {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.auth-field input::placeholder {
  color: var(--subtle);
  font-size: 13px;
}
.auth-password-toggle {
  min-width: 44px;
  min-height: 44px;
  margin-right: -9px;
}
.auth-password-toggle .icon {
  width: 20px;
  height: 20px;
}
.auth-submit {
  margin-top: 26px;
  font-size: 13px;
}
.auth-feedback {
  padding: 13px 15px;
  border: 1px solid rgba(249, 177, 4, 0.3);
  border-radius: 12px;
  background: rgba(249, 177, 4, 0.06);
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 1.7;
}
.auth-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 9px;
  min-height: 48px;
  margin-top: 17px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
}
.auth-back .icon {
  width: 19px;
  height: 19px;
}

@media (max-width: 760px) {
  .app-header {
    gap: 10px;
  }
  .header-actions {
    gap: 6px;
  }
  .fullscreen-button {
    display: none;
  }
  .login-button {
    padding: 0 12px;
    gap: 7px;
    font-size: 11px;
  }
  .login-button .icon {
    width: 18px;
    height: 18px;
  }
  .auth-dialog {
    padding: 21px;
    border-radius: 25px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }
  .auth-header {
    gap: 9px;
    margin-bottom: 22px;
  }
  .auth-header .icon-button {
    margin-right: -9px;
  }
  .auth-brand img {
    width: 90px;
    height: 32px;
  }
  .auth-heading h2 {
    font-size: 29px;
  }
  .auth-heading p {
    font-size: 12px;
  }
  .auth-alternative {
    font-size: 11px;
    padding: 12px 13px;
    gap: 8px;
  }
}
@media (max-width: 360px) {
  .brand img {
    width: 100px;
  }
  .help-button {
    display: none;
  }
  .auth-alternative .icon:last-child {
    display: none;
  }
}
@media (max-height: 700px) {
  .auth-header {
    margin-bottom: 12px;
  }
  .auth-heading h2 {
    margin-top: 8px;
    margin-bottom: 10px;
  }
  .auth-qr-stage {
    padding-top: 16px;
    padding-bottom: 12px;
  }
  .auth-qr-frame img {
    width: 160px;
    height: 160px;
  }
  .auth-separator {
    margin: 14px 0;
  }
  .auth-footnote {
    margin-top: 14px;
    padding-top: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-dialog[open] {
    animation: none;
  }
}
