/* ERP SaaS — Guest / Auth pages (login, forgot password, …) */
:root {
  --auth-fg: #0f172a;
  --auth-fg-muted: #64748b;
  --auth-border: rgba(148, 163, 184, 0.35);
  --auth-border-strong: #cbd5e1;
  --auth-surface: #ffffff;
  --auth-surface-glass: rgba(255, 255, 255, 0.72);
  --auth-primary: #4f46e5;
  --auth-primary-2: #4338ca;
  --auth-primary-soft: #eef2ff;
  --auth-accent: #06b6d4;
  --auth-accent-2: #8b5cf6;
  --auth-hero-bg: #0b1020;
  --auth-radius: 20px;
  --auth-radius-sm: 12px;
  --auth-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --auth-shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.14), 0 8px 20px rgba(15, 23, 42, 0.06);
  --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body.auth-page {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--auth-fg);
  letter-spacing: -0.01em;
  min-height: 100dvh;
  background: #0f172a;
  overflow-x: hidden;
}

/* Ambient background */
.auth-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(79, 70, 229, 0.45), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(6, 182, 212, 0.28), transparent 50%),
    radial-gradient(700px 400px at 50% 100%, rgba(139, 92, 246, 0.22), transparent 55%),
    linear-gradient(165deg, #0f172a 0%, #1e1b4b 42%, #0f172a 100%);
}

.auth-grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: auth-orb-float 18s ease-in-out infinite;
}
.auth-orb-1 {
  width: 420px;
  height: 420px;
  top: -8%;
  left: -6%;
  background: rgba(99, 102, 241, 0.55);
}
.auth-orb-2 {
  width: 360px;
  height: 360px;
  bottom: -10%;
  right: -4%;
  background: rgba(6, 182, 212, 0.4);
  animation-delay: -6s;
}
.auth-orb-3 {
  width: 280px;
  height: 280px;
  top: 42%;
  left: 38%;
  background: rgba(139, 92, 246, 0.35);
  animation-delay: -12s;
}

@keyframes auth-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.05); }
  66% { transform: translate(-16px, 12px) scale(0.96); }
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

/* Panel */
.auth-panel {
  width: 100%;
  max-width: 1040px;
  border-radius: var(--auth-radius);
  overflow: hidden;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: auth-in 0.55s var(--auth-ease) both;
}

@keyframes auth-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-panel > .row { min-height: 0; }

.auth-panel--login > .row {
  align-items: stretch;
}

.auth-panel--login .auth-hero {
  padding: 1.75rem 1.85rem;
}

.auth-panel--login .auth-hero-body {
  padding: 1rem 0;
}

.auth-panel--login .auth-hero h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  margin-bottom: 0.5rem;
}

.auth-panel--login .auth-hero p {
  font-size: 0.875rem;
  line-height: 1.55;
}

.auth-panel--login .auth-stat {
  padding: 0.55rem 0.7rem;
}

.auth-panel--login .auth-stat-value {
  font-size: 0.95rem;
}

.auth-panel--login .auth-form-wrap {
  padding: 1.5rem 1.85rem 1.35rem;
}

.auth-panel--login .auth-form-header {
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.auth-panel--login .auth-form-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 1.1rem;
}

.auth-panel--login .auth-form-wrap h1 {
  font-size: 1.2rem;
}

.auth-panel--login .auth-caption {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-panel--login .auth-form-wrap .form-label {
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
}

.auth-panel--login .auth-form-wrap .form-control {
  padding: 0.58rem 0.85rem;
  font-size: 0.875rem;
}

.auth-panel--login .auth-input-icon > .form-control {
  padding-left: 2.45rem;
}

.auth-panel--login .auth-input-totp .form-control {
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.auth-panel--login #authLoginForm {
  gap: 0.65rem !important;
}

.auth-panel--login .auth-btn {
  padding: 0.62rem 1rem;
  font-size: 0.875rem;
  margin-top: 0.15rem !important;
}

.auth-panel--login .auth-divider {
  margin: 0.85rem 0 0.65rem;
  font-size: 0.68rem;
}

.auth-panel--login .auth-footer-links {
  gap: 0.45rem;
}

.auth-panel--login .auth-footer-card {
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  gap: 0.6rem;
}

.auth-panel--login .auth-footer-card i:first-child {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.auth-panel--login .auth-footer-card small {
  font-size: 0.6875rem;
  margin-top: 0;
}

.auth-panel--login .auth-footer-card .bi-chevron-right {
  font-size: 0.75rem;
}

.auth-panel--login .auth-trust {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-size: 0.6875rem;
}

.auth-panel--login .alert {
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}

/* Hero (left) */
.auth-hero {
  background: var(--auth-hero-bg);
  color: #fff;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-height: 100%;
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(500px 280px at 0% 0%, rgba(99, 102, 241, 0.35), transparent 60%),
    radial-gradient(400px 240px at 100% 100%, rgba(6, 182, 212, 0.25), transparent 55%);
  pointer-events: none;
}

.auth-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 60px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.auth-hero > * { position: relative; z-index: 1; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}

.auth-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.auth-brand-text {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
}

.auth-brand .opacity-75,
.auth-brand-text span:last-child {
  color: rgba(255, 255, 255, 0.55) !important;
  font-weight: 700;
}

.auth-hero-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 1.5rem 0; }

.auth-hero h2 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.auth-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
  font-size: 0.95rem;
  max-width: 36ch;
}

.auth-point-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.auth-point-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--auth-radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-point-list li::before {
  content: "\F26B";
  font-family: "bootstrap-icons";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 6px;
}

.auth-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: auto;
}

.auth-stat {
  padding: 0.75rem 0.85rem;
  border-radius: var(--auth-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.auth-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.15rem;
}

/* Mobile brand strip */
.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1.35rem 0;
}

/* Form side */
.auth-form-wrap {
  padding: clamp(1.5rem, 4vw, 2.75rem);
  background: var(--auth-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.auth-form-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.auth-form-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--auth-primary-soft), #f0f9ff);
  color: var(--auth-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  border: 1px solid rgba(79, 70, 229, 0.12);
}

.auth-form-wrap h1 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.auth-caption {
  color: var(--auth-fg-muted);
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-form-wrap .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--auth-fg);
  margin-bottom: 0.4rem;
}

.auth-field { margin-bottom: 0.15rem; }

.auth-input-icon { position: relative; }

.auth-input-icon > .bi {
  position: absolute;
  top: 50%;
  left: 0.95rem;
  transform: translateY(-50%);
  color: var(--auth-fg-muted);
  pointer-events: none;
  font-size: 1rem;
  transition: color 0.15s ease;
}

.auth-input-icon:focus-within > .bi { color: var(--auth-primary); }

.auth-form-wrap .form-control {
  border-radius: var(--auth-radius-sm);
  border: 1.5px solid var(--auth-border-strong);
  padding: 0.72rem 0.95rem;
  font-size: 0.925rem;
  background: #f8fafc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input-icon > .form-control { padding-left: 2.65rem; }

.auth-form-wrap .form-control:hover {
  border-color: #94a3b8;
  background: #fff;
}

.auth-form-wrap .form-control:focus {
  border-color: var(--auth-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.auth-input-totp .form-control {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-align: center;
  padding-left: 0.95rem !important;
}

.auth-input-totp .bi { display: none; }

.auth-btn {
  border: none;
  border-radius: var(--auth-radius-sm);
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  color: #fff;
  padding: 0.78rem 1.15rem;
  font-weight: 700;
  font-size: 0.925rem;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.auth-btn:hover {
  color: #fff;
  filter: brightness(1.06);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.42);
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.auth-btn:disabled {
  opacity: 0.55;
  transform: none;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--auth-fg-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.5rem 0 1rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--auth-border-strong), transparent);
}

.auth-link {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

.auth-link:hover {
  color: var(--auth-primary-2);
  text-decoration: underline;
}

.auth-footer-links {
  display: grid;
  gap: 0.6rem;
}

.auth-footer-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--auth-radius-sm);
  border: 1.5px solid var(--auth-border);
  background: #f8fafc;
  color: var(--auth-fg);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.auth-footer-card i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--auth-primary-soft);
  color: var(--auth-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.auth-footer-card span { flex: 1; line-height: 1.35; }

.auth-footer-card small {
  display: block;
  font-weight: 500;
  color: var(--auth-fg-muted);
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

.auth-footer-card:hover {
  border-color: rgba(79, 70, 229, 0.35);
  background: #fff;
  color: var(--auth-fg);
  transform: translateX(3px);
}

.auth-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--auth-border);
  font-size: 0.75rem;
  color: var(--auth-fg-muted);
}

.auth-trust i { color: #10b981; font-size: 0.9rem; }

/* Alerts */
.alert {
  border-radius: var(--auth-radius-sm);
  font-size: 0.875rem;
  border: 1px solid transparent;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe; }

/* Responsive */
@media (max-width: 991.98px) {
  .auth-panel { max-width: 480px; }
  .auth-panel > .row { min-height: auto; }
  .auth-mobile-brand { display: flex; }
  .auth-form-wrap { padding: 1.35rem 1.35rem 1.75rem; }
  .auth-hero-stats { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .auth-shell { padding: 0.75rem; align-items: flex-start; padding-top: 1.25rem; }
  .auth-form-header { margin-bottom: 1.25rem; }
  .auth-form-wrap h1 { font-size: 1.25rem; }
  .auth-form-icon { width: 42px; height: 42px; font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel,
  .auth-orb { animation: none; }
  .auth-btn:hover { transform: none; }
}
