body.is-visitor {
  --auth-font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --auth-card-bg: rgba(20, 30, 45, 0.45);
  --auth-card-border: rgba(255, 255, 255, 0.16);
  --auth-card-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
  --auth-card-radius: 18px;
  --auth-text: #e9edf2;
  --auth-text-muted: #b7c0cc;
  --auth-placeholder: rgba(231, 237, 244, 0.55);
  --auth-input-bg: rgba(255, 255, 255, 0.08);
  --auth-input-border: rgba(255, 255, 255, 0.14);
  --auth-accent: #d98a3b;
  --auth-accent-dark: #b86a22;
  --auth-focus: rgba(243, 150, 70, 0.18);
  color-scheme: dark;
  background: url("../img/OPSCOPE_BACKGROUND.png") center / cover no-repeat fixed;
  font-family: var(--auth-font);
  color: var(--auth-text);
}

body.is-visitor::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(135deg, rgba(6, 10, 18, 0.85), rgba(12, 18, 28, 0.6));
  z-index: -2;
}

body.is-visitor::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 75% 15%, rgba(255, 255, 255, 0.08), transparent 55%);
  z-index: -1;
}

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-panels {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.auth-panels--dual .auth-tabs {
  display: none;
}

.auth-panels--single .auth-tabs {
  display: none;
}

.auth-shell {
  width: min(1080px, 100%);
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 32px;
}

.auth-panels--single .auth-shell {
  width: min(560px, 100%);
  gap: 0;
}

.auth-panels--single .auth-card {
  max-width: 100%;
}

.auth-card {
  flex: 1 1 0;
  max-width: 520px;
  padding: 30px 28px 24px;
  border-radius: var(--auth-card-radius);
  background: linear-gradient(
    180deg,
    rgba(28, 40, 58, 0.58) 0%,
    rgba(16, 24, 36, 0.42) 55%,
    rgba(12, 18, 28, 0.34) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  display: grid;
  align-content: start;
  gap: 18px;
  position: relative;
  color-scheme: dark;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.10) 30%,
    rgba(217, 138, 59, 0.18) 60%,
    rgba(255, 255, 255, 0.14) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: calc(var(--auth-card-radius) + 10px);
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(217, 138, 59, 0.14), transparent 60%);
  filter: blur(14px);
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
}

.auth-panel--left,
.auth-panel--right {
  color: var(--auth-text);
}

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

body.is-visitor .auth-brand {
  width: 100%;
  justify-content: center;
  text-align: center;
}

body.is-visitor .auth-brand__row {
  width: 100%;
  justify-content: center;
}

body.is-visitor .auth-brand__logo {
  margin-left: 0;
}

body.is-visitor .auth-brand__logo-img {
  height: clamp(240px, 32vw, 320px);
  width: auto;
  max-width: 100%;
  display: block;
  animation: authLogoFloat 4s ease-in-out infinite;
}

body.is-visitor .auth-brand__tagline {
  text-align: center;
}

@keyframes authLogoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-visitor .auth-brand__logo-img {
    animation: none;
  }
}

.auth-brand__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  position: relative;
}

.auth-brand__icon::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.auth-brand__logo {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.auth-brand__tagline {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--auth-text-muted);
}

.auth-kicker {
  margin: 0;
  font-size: 0.95rem;
  color: var(--auth-text-muted);
}

.auth-form h3 {
  margin: 6px 0 4px;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.auth-form .field {
  margin-bottom: 12px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--auth-text);
  letter-spacing: 0.04em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input,
.input-wrap textarea {
  width: 100%;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: 10px;
  color: var(--auth-text);
  font-size: 0.95rem;
  padding: 0 14px;
  height: 44px;
}

.input-wrap textarea {
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  resize: none;
  line-height: 44px;
  overflow: hidden;
}

.input-wrap.has-icon-left input,
.input-wrap.has-icon-left textarea {
  padding-left: 42px;
}

.input-wrap.has-icon-right input,
.input-wrap.has-icon-right textarea {
  padding-right: 46px;
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder {
  color: var(--auth-placeholder);
  opacity: 1;
}

.input-wrap input:focus,
.input-wrap textarea:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.auth-card input,
.auth-card textarea {
  background: var(--auth-input-bg) !important;
  background-color: var(--auth-input-bg) !important;
  color: var(--auth-text) !important;
  border: 1px solid var(--auth-input-border) !important;
  -webkit-appearance: none;
  appearance: none;
}

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus,
.auth-card input:-webkit-autofill:active,
.auth-card textarea:-webkit-autofill,
.auth-card textarea:-webkit-autofill:hover,
.auth-card textarea:-webkit-autofill:focus,
.auth-card textarea:-webkit-autofill:active,
.auth-card input:autofill,
.auth-card textarea:autofill {
  -webkit-text-fill-color: var(--auth-text) !important;
  caret-color: var(--auth-text) !important;
  transition: background-color 9999s ease-in-out 0s;
  background-color: var(--auth-input-bg) !important;
  background-image: none !important;
  -webkit-box-shadow: 0 0 0 1000px var(--auth-input-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--auth-input-bg) inset !important;
  border: 1px solid var(--auth-input-border) !important;
}

.auth-card input:-internal-autofill-selected,
.auth-card textarea:-internal-autofill-selected {
  background-color: var(--auth-input-bg) !important;
  color: var(--auth-text) !important;
  -webkit-text-fill-color: var(--auth-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--auth-input-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--auth-input-bg) inset !important;
}

.auth-card input:-moz-autofill,
.auth-card textarea:-moz-autofill {
  background-color: var(--auth-input-bg) !important;
  color: var(--auth-text) !important;
  box-shadow: 0 0 0 1000px var(--auth-input-bg) inset !important;
}

.input-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: rgba(231, 237, 244, 0.65);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.input-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-btn.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(231, 237, 244, 0.7);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn.toggle-password svg {
  width: 18px;
  height: 18px;
}

.icon-btn.toggle-password .eye-closed {
  display: none;
}

.icon-btn.toggle-password[aria-pressed="true"] .eye-open {
  display: none;
}

.icon-btn.toggle-password[aria-pressed="true"] .eye-closed {
  display: block;
}

.icon-btn.toggle-password:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.icon-btn.toggle-password:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--auth-focus);
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.auth-help {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.auth-link--help {
  color: rgba(231, 237, 244, 0.72);
  font-size: 0.82rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.auth-link--help:hover {
  color: #ffffff;
}

.auth-panel .btn--primary {
  background: linear-gradient(180deg, #d98a3b 0%, #b86a22 100%);
  color: #fff7ef;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  height: 42px;
  padding: 0 20px;
  box-shadow: 0 10px 24px rgba(184, 106, 34, 0.35);
}

.auth-panel .btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(184, 106, 34, 0.4);
}

.auth-panel .btn--primary:active {
  transform: translateY(0);
}

.auth-link {
  font-size: 0.88rem;
  color: var(--auth-text-muted);
  text-decoration: none;
}

.auth-link:hover {
  color: #f1f4f7;
  text-decoration: underline;
}

.auth-helper {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--auth-text-muted);
}

.auth-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--auth-text-muted);
  margin-top: auto;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ac66a;
  box-shadow: 0 0 0 4px rgba(90, 198, 106, 0.15);
}

.password-rules {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--auth-text-muted);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
}

.password-rules li.is-valid {
  color: #9fd7b0;
}

.caps-hint {
  font-size: 0.75rem;
  color: #f0b46b;
}

.auth-footer-global {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--auth-text-muted);
  text-align: center;
}

.auth-footer-global .auth-link {
  color: var(--auth-text-muted);
}

.auth-footer-global .auth-link:hover {
  color: #f1f4f7;
}

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(12, 20, 30, 0.92);
  color: #f1f6fb;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  z-index: 200;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.auth-modal .modal__content {
  background: rgba(12, 20, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--auth-text);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
}

.auth-modal__content {
  width: min(520px, 92vw);
}

.auth-modal .hint {
  color: var(--auth-text-muted);
}

.auth-help-list {
  margin: 6px 0 0;
  padding-left: 20px;
  color: var(--auth-text-muted);
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}

.auth-modal__actions {
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .auth-shell {
    flex-direction: column;
    gap: 24px;
  }

  .auth-card {
    max-width: 100%;
  }
}
