/* =========================================================
   DoorForce shared authentication design tokens + layout
   Used by Office, Customer (Office SPA), and Technician portals.
   ========================================================= */

:root,
.df-auth-overlay {
  --df-auth-navy: #0a2342;
  --df-auth-navy-deep: #06182f;
  --df-auth-red: #bf0a30;
  --df-auth-white: #ffffff;
  --df-auth-muted: #475569;
  --df-auth-border: #cbd5e1;
  --df-auth-focus: rgba(10, 35, 66, 0.28);
  --df-auth-error-bg: #fef2f2;
  --df-auth-error-text: #991b1b;
  --df-auth-ok-bg: #ecfdf5;
  --df-auth-ok-text: #065f46;
  --df-auth-radius: 12px;
  --df-auth-input-radius: 10px;
  --df-auth-font: "Montserrat", "Segoe UI", system-ui, sans-serif;
}

.df-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  overflow: auto;
  font-family: var(--df-auth-font);
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(191, 10, 48, 0.16), transparent 55%),
    linear-gradient(160deg, var(--df-auth-navy-deep) 0%, var(--df-auth-navy) 48%, #132a4a 100%);
  color: var(--df-auth-navy);
}

.df-auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 32px 28px 26px;
  background: var(--df-auth-white);
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(6, 24, 47, 0.4);
  box-sizing: border-box;
}

.df-auth-brand {
  text-align: center;
  margin-bottom: 18px;
}

.df-auth-logo {
  display: block;
  width: min(120px, 42%);
  height: auto;
  margin: 0 auto 10px;
  object-fit: contain;
}

.df-auth-product {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--df-auth-navy);
  line-height: 1.15;
}

.df-auth-product .df-auth-force {
  color: var(--df-auth-red);
}

.df-auth-tagline {
  margin: 6px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--df-auth-muted);
  line-height: 1.35;
}

.df-auth-portal {
  margin: 14px 0 0;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 35, 66, 0.08);
  color: var(--df-auth-navy);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.df-auth-welcome {
  margin: 18px 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--df-auth-navy);
  text-align: center;
}

.df-auth-lead {
  margin: 0 0 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--df-auth-muted);
  text-align: center;
  line-height: 1.45;
}

.df-auth-error {
  display: none;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--df-auth-error-bg);
  color: var(--df-auth-error-text);
  border: 1px solid rgba(153, 27, 27, 0.18);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.df-auth-error.is-visible,
.df-auth-error[style*="block"] {
  display: block;
}

.df-auth-error.is-success {
  background: var(--df-auth-ok-bg);
  color: var(--df-auth-ok-text);
  border-color: rgba(6, 95, 70, 0.2);
}

.df-auth-portal-redirect {
  display: none;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(10, 35, 66, 0.06);
  border: 1px solid rgba(10, 35, 66, 0.12);
}

.df-auth-portal-redirect.is-visible {
  display: block;
}

.df-auth-portal-redirect p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--df-auth-navy);
  line-height: 1.4;
}

.df-auth-field {
  margin-bottom: 14px;
}

.df-auth-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--df-auth-navy);
}

.df-auth-input-wrap {
  position: relative;
  display: block;
}

.df-auth-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--df-auth-border);
  border-radius: var(--df-auth-input-radius);
  background: #fff;
  color: var(--df-auth-navy);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.df-auth-input-wrap .df-auth-input {
  padding-right: 46px;
}

.df-auth-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.df-auth-input:focus {
  outline: none;
  border-color: var(--df-auth-navy);
  box-shadow: 0 0 0 3px var(--df-auth-focus);
}

.df-auth-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--df-auth-muted);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.df-auth-eye:hover,
.df-auth-eye:focus-visible {
  color: var(--df-auth-navy);
  background: rgba(10, 35, 66, 0.06);
  outline: none;
}

.df-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--df-auth-input-radius);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.df-auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.df-auth-btn:focus-visible {
  outline: 3px solid var(--df-auth-focus);
  outline-offset: 2px;
}

.df-auth-btn-primary {
  background: var(--df-auth-navy);
  color: #fff;
}

.df-auth-btn-primary:hover:not(:disabled) {
  background: #132a4a;
}

.df-auth-btn-secondary {
  background: #fff;
  color: var(--df-auth-navy);
  border: 1px solid var(--df-auth-border);
}

.df-auth-btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
}

.df-auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin-top: 14px;
}

.df-auth-link {
  border: 0;
  background: none;
  padding: 6px 4px;
  min-height: 44px;
  color: var(--df-auth-navy);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.df-auth-link:hover,
.df-auth-link:focus-visible {
  color: var(--df-auth-red);
  outline: none;
}

.df-auth-footer {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--df-auth-muted);
}

.df-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 16px;
  padding: 4px;
  background: rgba(10, 35, 66, 0.06);
  border-radius: 10px;
}

.df-auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--df-auth-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.df-auth-tab.active,
.df-auth-tab[aria-selected="true"] {
  background: #fff;
  color: var(--df-auth-navy);
  box-shadow: 0 1px 3px rgba(6, 24, 47, 0.12);
}

.df-auth-scroll {
  max-height: min(58vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Compact toast (replaces browser alert for access messages) */
.df-auth-toast-host {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  width: min(440px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.df-auth-toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--df-auth-navy);
  color: #fff;
  font-family: var(--df-auth-font);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(6, 24, 47, 0.35);
  animation: df-auth-toast-in 0.22s ease;
}

.df-auth-toast.is-warning {
  background: #7f1d1d;
}

.df-auth-toast.is-info {
  background: var(--df-auth-navy);
}

@keyframes df-auth-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

#login-overlay .df-login-input.has-icon-padding,
#login-overlay .df-login-input {
  padding-left: 14px;
}

/* Technician login uses shared auth tokens on top of legacy tech classes */
.df-tech-login-overlay.df-auth-overlay {
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(191, 10, 48, 0.16), transparent 55%),
    linear-gradient(160deg, var(--df-auth-navy-deep) 0%, var(--df-auth-navy) 48%, #132a4a 100%);
}

.df-tech-login-card.df-auth-card {
  background: #fff;
  box-shadow: 0 22px 50px rgba(6, 24, 47, 0.4);
}

@media (max-width: 480px) {
  .df-auth-card {
    padding: 26px 18px 22px;
    border-radius: 14px;
  }
  .df-auth-product {
    font-size: 1.2rem;
  }
  .df-auth-welcome {
    font-size: 1.1rem;
  }
}

/* Signed-in but no permitted Office tabs */
.df-no-office-access {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(191, 10, 48, 0.16), transparent 55%),
    linear-gradient(160deg, #06182f 0%, #0a2342 48%, #132a4a 100%);
}

.df-no-office-access-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 22px 50px rgba(6, 24, 47, 0.4);
  color: #0a2342;
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
}

.df-no-office-access-card h1 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
}

.df-no-office-access-card p {
  margin: 0 0 18px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 500;
}
