/* Login page — uses body.login-body class (set in template + JS fallback) */



.login-page {

  max-width: none !important;

  width: 100% !important;

  padding: 0 !important;

  margin: 0 !important;

}



body.login-body {

  margin: 0;

  font-family: 'Inter', system-ui, sans-serif;

  background: #f4f6f8 !important;

  display: block !important;

  min-height: 0 !important;

  height: auto !important;

  overflow-y: visible !important;

}



body.login-body .container-fluid {

  padding: 0 !important;

  max-width: none !important;

  height: auto !important;

  min-height: 0 !important;

  overflow: visible !important;

}



body.login-body .container-fluid > .row:first-child {

  display: none !important;

}



body.login-body .container-fluid > .row:nth-child(2),

body.login-body main,

body.login-body .col-12 {

  margin: 0;

  padding: 0;

  height: auto !important;

  min-height: 0 !important;

  overflow: visible !important;

}



.login-wrap {

  box-sizing: border-box;

  padding: 1.5rem;

}



/* Desktop: centred card */

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {

  body.login-body {

    min-height: 100vh;

  }



  .login-wrap {

    min-height: 100vh;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

  }

}



/* Mobile: block layout — page scrolls naturally */

@media (max-width: 1023.98px) {

  html:has(body.login-body),

  html.ampleage-touch-scroll {

    height: auto !important;

    overflow-y: scroll !important;

    -webkit-overflow-scrolling: touch;

  }



  body.login-body {

    height: auto !important;

    min-height: 0 !important;

    overflow-y: visible !important;

    position: static !important;

  }



  .login-wrap {

    display: block !important;

    min-height: 0 !important;

    height: auto !important;

    padding:

      max(1rem, env(safe-area-inset-top, 0px))

      max(1rem, env(safe-area-inset-right, 0px))

      max(3rem, env(safe-area-inset-bottom, 0px))

      max(1rem, env(safe-area-inset-left, 0px)) !important;

  }



  .login-card {

    margin-left: auto;

    margin-right: auto;

  }

}



.login-card {

  width: 100%;

  max-width: 380px;

  background: #fff;

  border-radius: 12px;

  padding: 2rem 1.75rem;

  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);

  border: 1px solid #e8eaed;

}



.login-logo {

  display: block;

  width: min(100%, 160px);

  height: auto;

  margin: 0 auto 1.5rem;

}



.login-title {

  font-size: 1.375rem;

  font-weight: 700;

  color: #1a1a1a;

  margin: 0 0 0.35rem;

  text-align: center;

}



.login-subtitle {

  font-size: 0.875rem;

  color: #6b7280;

  margin: 0 0 1.5rem;

  text-align: center;

  line-height: 1.45;

}



.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.login-alert__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.95rem;
  opacity: 0.9;
}



.login-alert--error,

.login-alert--danger {

  background: #fef2f2;

  color: #b91c1c;

  border: 1px solid #fecaca;

}



.login-alert--success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}



.login-alert--warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}



.login-alert--info {

  background: #eff6ff;

  color: #1d4ed8;

}



.login-form {

  display: flex;

  flex-direction: column;

  gap: 1rem;

}



.login-field label {

  display: block;

  font-size: 0.8125rem;

  font-weight: 600;

  color: #374151;

  margin-bottom: 0.35rem;

}



.login-input {

  width: 100%;

  padding: 0.7rem 0.85rem;

  font-size: 16px;

  font-family: inherit;

  color: #111;

  background: #fff;

  border: 1px solid #d1d5db;

  border-radius: 8px;

  box-sizing: border-box;

  transition: border-color 0.15s, box-shadow 0.15s;

}



.login-input::placeholder {

  color: #9ca3af;

}



.login-input:focus {

  outline: none;

  border-color: #4f46e5;

  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);

}



.login-input.is-error {

  border-color: #ef4444;

}



.login-error {

  display: block;

  font-size: 0.78rem;

  color: #dc2626;

  margin-top: 0.3rem;

}



.login-btn {

  width: 100%;

  margin-top: 0.25rem;

  padding: 0.75rem 1rem;

  font-size: 0.9375rem;

  font-weight: 600;

  font-family: inherit;

  color: #fff;

  background: #4f46e5;

  border: none;

  border-radius: 8px;

  cursor: pointer;

  transition: background 0.15s;

}



.login-btn:hover {

  background: #4338ca;

}



.login-btn:active {

  background: #3730a3;

}



.login-forgot {

  margin: 1.25rem 0 0;

  text-align: center;

  font-size: 0.875rem;

}



.login-forgot a {

  color: #4f46e5;

  text-decoration: none;

  font-weight: 500;

}



.login-forgot a:hover {

  text-decoration: underline;

}



/* —— Two-factor verification (/verify-2fa/) —— */

.login-card--2fa {
  max-width: 400px;
}

.login-email-mask {
  font-weight: 600;
  color: #334155;
  word-break: break-all;
}

.login-field--otp label {
  text-align: center;
}

.login-input--otp {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.login-2fa-actions {
  margin-top: 1rem;
  text-align: center;
}

.login-resend-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-resend-btn:hover {
  color: #1d4ed8;
}

.login-resend-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: none;
}

.login-2fa-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
}

.login-footnote {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
}

.login-footnote a {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
}

.login-footnote a:hover {
  text-decoration: underline;
}

.login-btn__busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.login-alert.d-none {
  display: none !important;
}

.login-btn__label.d-none,
.login-btn__busy.d-none {
  display: none !important;
}



@media (max-width: 400px) {

  .login-card {

    padding: 1.5rem 1.25rem;

  }

}


