/* ============================================================
   Auth pages — NexLink-style CRM theme (themed rebuild)
   Shared by: login / forgot-password / reset-password
   Palette + type derived from the NexLink admin template:
     primary #5955D1 · ink #29294B · body #696981 · border #EEEEF3
     font: Instrument Sans
   ============================================================ */

:root {
  --nx-primary:      #5955D1;   /* --bs-primary */
  --nx-primary-600:  #4b47c4;
  --nx-primary-700:  #403cae;
  --nx-primary-soft: #ecebfb;
  --nx-ink:          #0C243C;   /* --bs-heading-color */
  --nx-body:         #696981;   /* --bs-body-color */
  --nx-muted:        #8e8ea1;   /* --bs-secondary-color */
  --nx-border:       #EEEEF3;   /* --bs-border-color */
  --nx-bg:           #F8F8F8;
  --nx-radius:       12px;
}

.auth-page {
  min-height: 100vh;
  background: #fff;
  color: var(--nx-body);
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  font-size: .875rem;
  font-weight: 500;
}

/* ---- Split layout --------------------------------------- */
.auth-row { min-height: 100vh; }

/* Left cover (illustration / brand) */
.auth-cover {
  position: relative;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% 10%, #7b62ff 0%, transparent 55%),
    radial-gradient(100% 90% at 10% 90%, #4b47c4 0%, transparent 50%),
    linear-gradient(135deg, #5955D1, #3d39ad);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}
.auth-cover__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(120% 100% at 50% 40%, #000 40%, transparent 80%);
}
.auth-cover__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.5;
}
.auth-cover__orb--1 { width: 160px; height: 160px; top: 12%; left: 14%; background: radial-gradient(circle at 30% 30%, #a99bff, transparent 70%); }
.auth-cover__orb--2 { width: 230px; height: 230px; bottom: 8%; right: 10%; background: radial-gradient(circle at 30% 30%, #c4b8ff, transparent 70%); }

.auth-cover__inner {
  position: relative; z-index: 2;
  max-width: 420px;
  color: #fff;
  text-align: left;
}
.auth-cover__badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .8rem;
  border-radius: 50rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  font-size: .8rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.auth-cover__title { font-size: 2.1rem; font-weight: 700; line-height: 1.2; margin-bottom: .9rem; }
.auth-cover__text  { font-size: 1rem; color: rgba(255,255,255,0.82); margin-bottom: 2rem; }
.auth-cover__stats { display: flex; gap: 2rem; }
.auth-cover__stat b { display: block; font-size: 1.4rem; font-weight: 700; }
.auth-cover__stat span { font-size: .8rem; color: rgba(255,255,255,0.7); }

/* Right form panel */
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
  background: #fff;
}
.auth-box { width: 100%; max-width: 410px; }

/* ---- Brand + heading ------------------------------------ */
.auth-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.25rem; color: var(--nx-ink);
  text-decoration: none;
}
.auth-brand__logo {
  height: 40px;
  width: auto;
}
.auth-title { font-size: 1.55rem; font-weight: 700; color: var(--nx-ink); margin: 0 0 .35rem; }
.auth-sub   { color: var(--nx-body); margin: 0; }

/* ---- Form ----------------------------------------------- */
.auth-form .form-label {
  font-size: .85rem; font-weight: 600; color: var(--nx-ink);
  margin-bottom: .4rem;
}
.auth-form .form-control {
  height: 48px;
  padding: .6rem .9rem;
  font-size: .92rem;
  color: var(--nx-ink);
  background: #fff;
  border: 1px solid var(--nx-border);
  border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.auth-form .form-control::placeholder { color: var(--nx-muted); }
.auth-form .form-control:focus {
  border-color: var(--nx-primary);
  box-shadow: 0 0 0 4px rgba(89, 85, 209, 0.12);
}
.auth-form .form-control:-webkit-autofill {
  -webkit-text-fill-color: var(--nx-ink);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s;
}

.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 2.8rem; }
.toggle-password {
  position: absolute; top: 50%; right: .4rem; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--nx-muted);
  border-radius: 8px;
}
.toggle-password:hover { color: var(--nx-primary); background: var(--nx-primary-soft); }

/* Check + links */
.auth-form .form-check-input { border-color: #cfcfe0; }
.auth-form .form-check-input:checked { background-color: var(--nx-primary); border-color: var(--nx-primary); }
.auth-form .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(89,85,209,.2); }
.auth-form .form-check-label { color: var(--nx-body); font-size: .9rem; }
.auth-link { color: var(--nx-primary); font-weight: 600; text-decoration: none; font-size: .9rem; }
.auth-link:hover { color: var(--nx-primary-700); text-decoration: underline; }

/* ---- Primary button ------------------------------------- */
.btn-nx {
  width: 100%;
  height: 48px;
  border: 0; border-radius: 10px;
  background: var(--nx-primary);
  color: #fff; font-weight: 600; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  transition: background .2s ease, box-shadow .2s ease, transform .1s ease;
}
.btn-nx:hover { background: var(--nx-primary-600); box-shadow: 0 10px 24px rgba(89,85,209,.3); }
.btn-nx:active { transform: translateY(1px); }
.btn-nx:disabled { opacity: .65; }

/* ---- Alerts --------------------------------------------- */
.auth-alert {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem .9rem; border-radius: 10px; font-size: .88rem;
  border: 1px solid transparent;
}
.auth-alert--error   { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.auth-alert--success { color: #027548; background: #ecfdf3; border-color: #abefc6; }

/* ---- Responsive ----------------------------------------- */
@media (max-width: 767.98px) {
  .auth-cover { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-nx, .auth-form .form-control, .toggle-password { transition: none; }
}
