/**
 * SALSA God Mode auth barrier — visual parity with WESTO client login (login.html / panel.css light auth).
 * Scoped to #salsa-auth-barrier so godmode dark workspace styles stay isolated.
 */

#salsa-auth-barrier {
  --salsa-auth-bg: #ebe4d6;
  --salsa-auth-text: #1a1714;
  --salsa-auth-text-dim: #6b645c;
  --salsa-auth-border: rgba(26, 23, 20, 0.12);
  --salsa-auth-accent: #2a7a86;
  --salsa-auth-danger: #c0392b;
  --salsa-auth-ok: #2d6a4f;
  --salsa-auth-radius: 18px;

  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  direction: rtl;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--salsa-auth-text);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(42, 122, 134, 0.14) 0%, transparent 70%),
    linear-gradient(165deg, #f3ede2 0%, var(--salsa-auth-bg) 50%, #e3d9c8 100%);
}

#salsa-auth-barrier .auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0;
  min-height: auto;
  display: block;
  background: transparent;
}

#salsa-auth-barrier .auth-card {
  width: 100%;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(248, 243, 234, 0.92) 42%,
      rgba(236, 228, 214, 0.95) 100%
    );
  border: 1px solid rgba(26, 23, 20, 0.1);
  border-radius: var(--salsa-auth-radius);
  padding: 2.25rem 2rem;
  box-shadow:
    0 1.2rem 2.8rem rgba(26, 23, 20, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#salsa-auth-barrier .auth-logo {
  display: block;
  margin: 0 auto 1.5rem;
  height: 48px;
  width: auto;
  max-width: 14rem;
  object-fit: contain;
  border-radius: 8px;
}

#salsa-auth-barrier .auth-title {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--salsa-auth-text);
}

#salsa-auth-barrier .auth-sub {
  margin: 0 0 1.75rem;
  color: #4a453e;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.55;
}

#salsa-auth-barrier .auth-sub-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--salsa-auth-text-dim);
}

#salsa-auth-barrier .field {
  margin-bottom: 1rem;
}

#salsa-auth-barrier .field label {
  display: block;
  font-size: 0.8rem;
  color: var(--salsa-auth-text-dim);
  margin-bottom: 0.4rem;
}

#salsa-auth-barrier .field input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(26, 23, 20, 0.14);
  color: var(--salsa-auth-text);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

#salsa-auth-barrier .field input:focus {
  background: #fffcf7;
  border-color: rgba(42, 122, 134, 0.45);
}

#salsa-auth-barrier .field input::placeholder {
  color: rgba(26, 23, 20, 0.4);
}

#salsa-auth-barrier .field input[dir='ltr'] {
  text-align: left;
}

#salsa-auth-barrier .field-mfa input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.45rem;
  padding: 0.85rem 1rem;
}

#salsa-auth-barrier .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: #1a1714;
  color: #f7f2ea;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.55rem 1.25rem rgba(26, 23, 20, 0.16);
  transition: background 0.15s, opacity 0.15s;
}

#salsa-auth-barrier .btn:hover:not(:disabled) {
  background: #2a2521;
}

#salsa-auth-barrier .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#salsa-auth-barrier .btn.btn-ghost {
  width: auto;
  margin-top: 0;
  background: rgba(26, 23, 20, 0.06);
  color: var(--salsa-auth-text);
  border: 1px dashed rgba(42, 122, 134, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
}

#salsa-auth-barrier .btn.btn-ghost:hover:not(:disabled) {
  background: rgba(26, 23, 20, 0.1);
}

#salsa-auth-barrier .msg {
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
  text-align: center;
  min-height: 1.2em;
  line-height: 1.5;
}

#salsa-auth-barrier .msg.error {
  color: var(--salsa-auth-danger);
}

#salsa-auth-barrier .msg.ok {
  color: var(--salsa-auth-ok);
}

#salsa-auth-barrier .msg.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  text-align: right;
  padding: 0.65rem 0.75rem;
  background: rgba(26, 23, 20, 0.06);
  border-radius: 8px;
  margin-bottom: 1rem;
}

#salsa-auth-barrier .auth-foot {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(26, 23, 20, 0.08);
  text-align: center;
}

#salsa-auth-barrier .hidden {
  display: none !important;
}

#salsa-auth-barrier .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#salsa-auth-barrier .salsa-auth-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-top: 0.5rem;
  border: 3px solid rgba(42, 122, 134, 0.2);
  border-top-color: var(--salsa-auth-accent);
  border-radius: 50%;
  animation: salsa-auth-spin 0.8s linear infinite;
}

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

#salsa-auth-barrier .salsa-auth-status-icon {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.75rem;
  line-height: 1;
}
