/* ═══════════════════════════════════════════════════
   nSmarTrac Auth — Login & account pages
   Matches landing design system (assets/rest/css/shadcn-bootstrap.css)
   ═══════════════════════════════════════════════════ */

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  touch-action: manipulation;
}

/* Shared horizontal rhythm */
.auth-wrap {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .auth-wrap {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ─── Brand ─── */
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
  color: inherit;
}

.auth-brand__icon {
  display: block;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.auth-brand__text {
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
  font-size: 1.0625rem;
}

.auth-brand__n,
.auth-brand__t {
  color: hsl(var(--primary));
}

.auth-brand__mid {
  color: hsl(var(--foreground));
}

/* Font Awesome 5 Pro Solid (.fas) — page chrome only (not body-level overlays) */
.auth-body .auth-header i.fas,
.auth-body .auth-page i.fas,
.auth-body .auth-footer i.fas,
.auth-body .nsm-legal-modal i.fas {
  color: hsl(var(--primary));
}

.auth-body .btn-primary .fas {
  color: hsl(var(--primary-foreground));
}

.auth-body .auth-nav__actions .btn-ghost .fas {
  color: hsl(var(--primary));
}

.auth-input-wrap__toggle .fas {
  color: hsl(var(--muted-foreground));
}

.auth-input-wrap__toggle:hover .fas,
.auth-input-wrap__toggle:focus .fas {
  color: hsl(var(--foreground));
}

.auth-forget-success__icon .fas {
  color: hsl(142 71% 40%);
}

/* ─── Header — floating nav (matches landing) ─── */
.auth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  padding: 0.75rem 0;
  pointer-events: none;
}

.auth-header .auth-wrap {
  pointer-events: auto;
}

.auth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid hsl(var(--border) / 0.9);
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.08);
}

.auth-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 0.625rem;
  border-left: 1px solid hsl(var(--border));
}

.auth-nav__actions .btn {
  white-space: nowrap;
}

.auth-nav__home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 2.25rem;
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}

.auth-nav__home-label {
  display: none;
}

@media (min-width: 576px) {
  .auth-header {
    padding: 1rem 0;
  }

  .auth-nav {
    gap: 1rem;
    padding: 0.5rem 1rem;
  }

  .auth-brand__icon {
    width: 36px;
    height: 36px;
  }

  .auth-brand__text {
    font-size: 1.1875rem;
  }

  .auth-nav__actions {
    gap: 0.375rem;
    padding-left: 0.75rem;
  }

  .auth-nav__home-label {
    display: inline;
  }

  .auth-nav__home {
    min-width: auto;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 768px) {
  .auth-brand__icon {
    width: 40px;
    height: 40px;
  }

  .auth-brand__text {
    font-size: 1.3125rem;
  }
}

/* ─── Page layout ─── */
.auth-page {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 4.75rem 0 1.5rem;
}

@media (min-width: 576px) {
  .auth-page {
    padding: 5.5rem 0 2rem;
  }
}

@media (min-width: 992px) {
  .auth-page {
    padding: 6rem 0 3rem;
  }
}

.auth-page__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(hsl(var(--border) / 0.35) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.35) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 15%, transparent 75%);
  pointer-events: none;
}

.auth-page__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.45;
}

.auth-page__glow--1 {
  width: 520px;
  height: 360px;
  top: -80px;
  left: 10%;
  background: hsl(var(--primary) / 0.14);
}

.auth-page__glow--2 {
  width: 400px;
  height: 300px;
  bottom: 10%;
  right: 5%;
  background: hsl(280 55% 55% / 0.1);
}

.auth-layout {
  position: relative;
  z-index: 1;
  align-items: center;
  --bs-gutter-x: 0;
  margin-left: 0;
  margin-right: 0;
}

@media (min-width: 992px) {
  .auth-layout {
    --bs-gutter-x: 2rem;
    margin-left: calc(var(--bs-gutter-x) * -0.5);
    margin-right: calc(var(--bs-gutter-x) * -0.5);
  }
}

/* ─── Branding panel (left) ─── */
.auth-panel {
  display: none;
}

@media (min-width: 992px) {
  .auth-panel {
    display: block;
    padding-right: 2rem;
  }
}

.auth-panel__inner {
  max-width: 28rem;
}

.auth-panel__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
  border: 1px solid hsl(var(--primary) / 0.15);
  border-radius: 999px;
}

.auth-panel__badge i {
  font-size: 0.75rem;
}

.auth-panel__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.auth-panel__lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
}

.auth-panel__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-panel__feature {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.auth-panel__feature-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.12), hsl(280 55% 55% / 0.08));
  color: hsl(var(--primary));
  font-size: 1rem;
}

.auth-panel__feature strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.125rem;
}

.auth-panel__feature span {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
}

/* ─── Login card ─── */
.auth-form-col {
  display: flex;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 992px) {
  .auth-form-col {
    justify-content: flex-end;
  }
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 6px);
  box-shadow:
    0 1px 2px hsl(var(--foreground) / 0.04),
    0 8px 32px -8px hsl(var(--foreground) / 0.08);
}

@media (max-width: 991.98px) {
  .auth-card {
    max-width: none;
  }
}

@media (min-width: 576px) {
  .auth-card {
    padding: 2rem;
  }
}

@media (min-width: 768px) {
  .auth-card {
    padding: 2.25rem 2.5rem;
  }
}

.auth-card__title {
  font-size: clamp(1.375rem, 4vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.375rem;
  text-align: center;
}

.auth-card__subtitle {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin-bottom: 1.5rem;
}

@media (min-width: 576px) {
  .auth-card__subtitle {
    font-size: 0.9375rem;
    margin-bottom: 1.75rem;
  }
}

.auth-card .alert {
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.auth-card .alert p {
  margin: 0;
}

/* Form fields — shared: assets/rest/css/forms.css */

.auth-card .form-check {
  padding-left: 1.625rem;
  min-height: 1.25rem;
}

.auth-card .form-check-input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  margin-left: -1.625rem;
  border-color: hsl(var(--border));
}

.auth-card .form-check-input:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}

.auth-card .form-check-input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

.auth-card .form-check-label {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

@media (min-width: 576px) {
  .auth-card .form-check-label {
    font-size: 0.875rem;
  }
}

.auth-card__options {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-card__options .form-check {
  margin-bottom: 0;
}

.auth-card .d-flex a,
.auth-card__options a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--primary));
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 576px) {
  .auth-card .d-flex a,
  .auth-card__options a {
    font-size: 0.875rem;
  }
}

.auth-card .d-flex a:hover,
.auth-card__options a:hover {
  text-decoration: underline;
}

@media (max-width: 359.98px) {
  .auth-card__options {
    flex-direction: column;
    align-items: flex-start;
  }
}

.auth-card__submit {
  width: 100%;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-card__submit .fas,
.auth-card__submit .fas {
  color: hsl(var(--primary-foreground));
}

.auth-card__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
}

.auth-card__links a {
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 500;
}

.auth-card__links a:hover {
  text-decoration: underline;
}

.auth-card__signup {
  padding-top: 1.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.auth-card__signup a {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: none;
}

.auth-card__signup a:hover {
  text-decoration: underline;
}

.auth-card .g-recaptcha {
  transform-origin: left top;
}

@media (max-width: 400px) {
  .auth-card .g-recaptcha {
    transform: scale(0.88);
  }
}

/* ─── Footer ─── */
.auth-footer {
  position: relative;
  z-index: 10;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background));
}

.auth-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
}

@media (min-width: 576px) {
  .auth-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.auth-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
}

@media (min-width: 576px) {
  .auth-footer__links {
    gap: 0.75rem 1.25rem;
  }
}

.auth-footer__links a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  padding: 0.125rem 0;
}

.auth-footer__links a:hover {
  color: hsl(var(--primary));
}

.auth-footer__links .fa-phone {
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

@media (max-width: 575.98px) {
  .auth-page__glow--1 {
    width: 280px;
    height: 200px;
    left: -10%;
  }

  .auth-page__glow--2 {
    width: 220px;
    height: 180px;
    right: -5%;
  }
}

/* Password field toggle — shared: assets/rest/css/forms.css */

.auth-forget-panel[hidden] {
  display: none !important;
}

/* ─── Forgot password success state ─── */
.auth-forget-success {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-forget-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: hsl(142 71% 45% / 0.12);
  color: hsl(142 71% 40%);
}

.auth-forget-success__icon .fas {
  font-size: 1.5rem;
}

.auth-forget-success .auth-card__title {
  margin-bottom: 0.375rem;
}

.auth-forget-success .auth-card__subtitle {
  margin-bottom: 0;
}

/* ─── Auth sections (login / forgot / signup) ─── */
.auth-sections {
  position: relative;
}

.auth-section {
  width: 100%;
}

.auth-deferred {
  text-align: center;
  padding: 0.5rem 0;
}

.auth-deferred__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 1.375rem;
}

.auth-deferred__icon .fas {
  color: hsl(var(--primary));
}
