/* Prevent blue flash before CSS loads */
button.btn,
.btn-login {
  background-color: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
}

html, body { height: 100%; overflow-x: hidden; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #111827;
  background: #f4f5f7;
}

/* Layout */
.login-shell{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px 16px;
}

/* Card */
.login-card{
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(17,24,39,.10);
  padding: 28px 22px;
}

/* Brand */
.brand{ text-align:center; margin-bottom: 18px; }
.brand-logo{
  height: 72px;
  width: auto;
  margin: 0 auto 6px;
  background-image: var(--sidebar-logo-bg);
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
}

.brand-logo-text {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: #111827;
  padding: 8px 0 4px;
  line-height: 1.2;
}

.login-subtitle{
  text-align:center;
  color: rgba(17,24,39,.55);
  font-size: 13px;
  margin-top: 6px;
}

/* Labels */
.form-underline label{
  color: rgba(17,24,39,.70);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Field wrapper */
.field{ position:relative; }

/* Left icon */
.field .input-icon{
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(17,24,39,.45);
  pointer-events:none;
}

/* Password toggle */
.field .toggle-pass{
  position:absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  width: 40px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: rgba(17,24,39,.55);
  cursor:pointer;
  transition: background .12s ease, color .12s ease;
}
.field .toggle-pass:hover{
  background: rgba(17,24,39,0.06);
  color: rgba(17,24,39,0.85);
}
.field .toggle-pass:focus,
.field .toggle-pass:focus-visible{
  outline:none;
  box-shadow: 0 0 0 .18rem rgba(17,24,39,.14);
}

/* ✅ INPUTS: true vertical centering (padding-based, no line-height hacks) */
.form-underline .form-control{
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 12px;

  height: 50px;                 /* slightly taller = easier to center */
  padding: 14px 14px 12px 42px; /* top/bottom tuned so text sits centered */

  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif !important;
  font-size: 16px !important;   /* prevent zoom + lock size */
  font-weight: 500 !important;
  line-height: 20px !important; /* consistent glyph metrics */

  background: #fff !important;
  color: #111827 !important;

  box-shadow: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-text-size-adjust: 100%;
  appearance: none;
  -webkit-appearance: none;
}

/* room for eye toggle */
.form-underline .form-control.has-toggle{
  padding-right: 56px;
}

.form-underline .form-control::placeholder{
  color: rgba(17,24,39,.35);
}

.form-underline .form-control:focus{
  border-color: rgba(17,24,39,.55);
  box-shadow: 0 0 0 .20rem rgba(17,24,39,.10) !important;
  outline: none;
}

/* ✅ AUTOFILL: lock typography + prevent size shift on click/focus */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active{
  -webkit-text-fill-color: #111827 !important;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 20px !important;

  /* keep background white (no weird tint) */
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
          box-shadow: 0 0 0 1000px #fff inset !important;

  /* stop webkit from animating styles on focus */
  transition: background-color 9999s ease-in-out 0s !important;
}

/* Keep row */
.keep-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin: 16px 0 18px;
  color: rgba(17,24,39,.65);
  font-size: 13px;
}

/* Switch */
.form-check-input{
  background-color: #d1d5db;
  border-color: #d1d5db;
  cursor: pointer;
  transition: all .18s ease;
}
.form-check-input:checked{
  background-color: #111827 !important;
  border-color: #111827 !important;
}
.form-check-input:focus{
  box-shadow: 0 0 0 .18rem rgba(17,24,39,.18);
}

/* Button */
.btn-login{
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 10px 18px rgba(17,24,39,.12);
  transition: transform .08s ease, box-shadow .15s ease, background .2s ease;
}
.btn-login:hover{
  background:#0b1220 !important;
  border-color:#0b1220 !important;
}
.btn-login:active{
  transform: translateY(1px);
  box-shadow: 0 6px 12px rgba(17,24,39,.12);
}
.btn-login:focus,
.btn-login:focus-visible{
  outline:none !important;
  box-shadow: 0 0 0 .22rem rgba(17,24,39,.16), 0 10px 18px rgba(17,24,39,.12);
}

/* Alerts */
.alert{
  border-radius: 12px;
  font-size: 14px;
}

/* Footer */
.login-footer{
  margin-top: 18px;
  text-align:center;
  color: rgba(17,24,39,.55);
  font-size: 12px;
}

/* Mobile */
@media (max-width: 420px){
  .login-shell{ padding: 18px 14px; }
  .login-card{ padding: 24px 18px; }
  .brand-logo{ height: 64px; }
}
