/**
 * Auth shell critical CSS — loaded from <head> so login never FOUCs on refresh.
 * Kept in /public so production static HTML paints correctly on first request.
 */

html,
body {
  margin: 0;
  background: #fff;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
}

body.crm-auth-body {
  margin: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.crm-auth {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  background: #ffffff !important;
  z-index: 1040;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
}

.crm-auth__frame {
  display: grid !important;
  grid-template-columns: 50% 50% !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100dvh !important;
}

.crm-auth__panel {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  overflow-y: auto;
}

.crm-auth__card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
  position: relative;
}

.crm-auth__card-accent {
  height: 4px;
  background: linear-gradient(90deg, #071e4f, #4fb6ff);
}

.crm-auth__card-body {
  padding: 1.5rem 1.5rem 1rem;
}

.crm-auth__card-footer {
  padding: 0 1.5rem 1.35rem;
}

.crm-auth__steps {
  margin-bottom: 1.25rem;
}

.crm-auth__steps-list {
  list-style: none !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0 0 0.7rem !important;
  padding: 0 !important;
  counter-reset: none;
}

.crm-auth__steps-list > li {
  list-style: none !important;
}

.crm-auth__steps-list > li::marker {
  content: "" !important;
  display: none !important;
}

.crm-auth__step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
}

.crm-auth__step-index {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.crm-auth__step.is-active {
  color: #071e4f;
}

.crm-auth__step.is-active .crm-auth__step-index {
  background: #071e4f;
  color: #fff;
}

.crm-auth__step.is-done {
  color: #4fb6ff;
}

.crm-auth__step.is-done .crm-auth__step-index {
  background: #4fb6ff;
  color: #071e4f;
}

.crm-auth__steps-bar {
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.crm-auth__steps-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #071e4f, #4fb6ff);
}

.crm-auth__title {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: #071e4f !important;
}

.crm-auth__subtitle {
  margin: 0 0 1.15rem;
  color: #64748b !important;
  font-size: 0.92rem;
  line-height: 1.5;
}

.crm-auth__portal-list {
  display: grid;
  gap: 0.75rem;
}

.crm-auth__portal-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.crm-auth__portal-btn:hover,
.crm-auth__portal-btn:focus-visible {
  border-color: #4fb6ff;
  box-shadow: 0 10px 24px rgba(7, 30, 79, 0.08);
  transform: translateY(-1px);
}

.crm-auth__portal-btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 30, 79, 0.06);
  color: #071e4f;
  flex-shrink: 0;
}

.crm-auth__portal-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.crm-auth__portal-btn-text strong {
  color: #071e4f;
  font-size: 0.95rem;
}

.crm-auth__portal-btn-text small {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.crm-auth__portal-btn-arrow {
  color: #94a3b8;
}

.crm-auth__nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.crm-auth__nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #071e4f;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.crm-auth__nav-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.crm-auth__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
}

.crm-auth__legal a {
  color: #94a3b8;
  font-size: 0.78rem;
  text-decoration: none;
}

.crm-auth__legal a:hover {
  color: #071e4f;
}

/* Brand panel (left) */
.ag-brand-panel,
.crm-auth__brand-panel {
  position: relative;
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.75rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  color: #fff !important;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    #071e4f 0%,
    #0d3a7a 28%,
    #1b78d8 58%,
    #7eb6ef 100%
  ) !important;
  min-height: 100%;
  height: 100%;
}

.ag-brand-panel__sparkle {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  color: rgba(7, 30, 79, 0.35);
}

.ag-brand-panel__sparkle--lg {
  width: 18rem;
  height: 18rem;
  top: 8%;
  right: 6%;
  opacity: 0.45;
}

.ag-brand-panel__sparkle--sm {
  width: 7rem;
  height: 7rem;
  top: 18%;
  right: 28%;
  opacity: 0.55;
  color: rgba(255, 255, 255, 0.22);
}

.ag-brand-panel__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.ag-brand-panel__glow--a {
  width: 22rem;
  height: 22rem;
  top: -5rem;
  right: -6rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 42% 58% 55% 45%;
}

.ag-brand-panel__glow--b {
  width: 16rem;
  height: 16rem;
  bottom: 8%;
  left: -5rem;
  background: rgba(126, 182, 239, 0.25);
}

.ag-brand-panel__top,
.ag-brand-panel__copy,
.ag-brand-panel__features {
  position: relative;
  z-index: 1;
}

.ag-brand-panel__logo {
  height: 3.5rem;
  width: auto;
  filter: brightness(0) invert(1);
  object-fit: contain;
  margin-bottom: 0.85rem;
  display: block;
}

.ag-brand-panel__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.ag-brand-panel__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  line-height: 1.12;
  font-weight: 800;
  color: #ffffff !important;
}

.ag-brand-panel__title span {
  display: block;
  color: #ffffff !important;
}

.ag-brand-panel__lead {
  margin: 0;
  max-width: 30rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.95) !important;
}

.ag-brand-panel__features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.ag-brand-panel__feature {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.95rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  min-height: 100%;
  height: 100%;
}

.ag-brand-panel__feature i,
.ag-brand-panel__feature span,
.ag-brand-panel__badge,
.ag-brand-panel__title,
.ag-brand-panel__title span,
.ag-brand-panel__lead {
  color: #ffffff !important;
}

.ag-brand-panel__feature span {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
}

@media (max-width: 1399.98px) {
  .ag-brand-panel__features {
    grid-template-columns: 1fr;
  }

  .ag-brand-panel__feature {
    min-height: auto;
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 991.98px) {
  .crm-auth__frame {
    grid-template-columns: 1fr !important;
  }

  .ag-brand-panel,
  .crm-auth__brand-panel {
    display: none !important;
  }

  .ag-brand-panel__features {
    grid-template-columns: 1fr;
  }
}
