/* =============================================================
   HRMS Login / Forgot password / Reset password
   -------------------------------------------------------------
   UI/UX only - form actions, routes, CSRF, field names and
   validation messages are unchanged.
   Palette matches the dashboard: #2563eb / #1e293b / #f8fafc.
   Loaded after home.css, so it overrides the legacy teal theme.
   ============================================================= */

:root {
   --au-primary: #2563eb;
   --au-primary-dark: #1d4ed8;
   --au-ink: #0f172a;
   --au-text: #1e293b;
   --au-muted: #64748b;
   --au-faint: #94a3b8;
   --au-border: #cbd5e1;
   --au-border-soft: #e2e8f0;
   --au-bg: #f8fafc;
   --au-danger: #dc2626;
}

/* ------------------------------------------------------------
   Page canvas
   ------------------------------------------------------------ */
body.form-login-body {
   background: var(--au-bg) !important;
   background-attachment: fixed;
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
   color: var(--au-text);
}

.auth-page {
   min-height: 100vh;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   padding: 40px 24px 24px;
}

/* ------------------------------------------------------------
   Two-section layout
   ------------------------------------------------------------ */
.auth-shell {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 64px;
   width: 100%;
   max-width: 1080px;
   animation: auFadeIn .32s ease-out both;
}

@keyframes auFadeIn {
   from { opacity: 0; transform: translateY(10px); }
   to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
   .auth-shell { animation: none; }
}

/* ------------------------------------------------------------
   Left - branding
   ------------------------------------------------------------ */
.auth-brand {
   flex: 1 1 480px;
   max-width: 500px;
   min-width: 0;
}
.auth-brand__logo {
   display: block;
   height: 44px;
   width: auto;
   max-width: 100%;
   margin: 0 0 26px;
}
.auth-brand__app {
   font-size: 46px;
   font-weight: 800;
   letter-spacing: -.02em;
   line-height: 1.05;
   color: var(--au-ink);
   margin: 0 0 6px;
}
.auth-brand__sub {
   font-size: 15.5px;
   font-weight: 600;
   color: var(--au-muted);
   margin: 0 0 22px;
}
.auth-brand__quote {
   font-size: 18px;
   font-weight: 500;
   line-height: 1.55;
   color: #334155;
   margin: 0;
   padding-left: 16px;
   border-left: 3px solid var(--au-primary);
}
.auth-brand__art {
   margin-top: 30px;
}
.auth-brand__art img {
   display: block;
   max-width: 100%;
   height: auto;
   border-radius: 14px;
   border: 1px solid var(--au-border-soft);
}
.auth-brand__note {
   margin-top: 18px;
   font-size: 13.5px;
   line-height: 1.6;
   color: var(--au-muted);
   max-width: 46ch;
}

/* ------------------------------------------------------------
   Right - login card
   ------------------------------------------------------------ */
.auth-panel {
   flex: 0 1 420px;
   width: 100%;
   max-width: 420px;
   background: #ffffff;
   border: 1px solid var(--au-border-soft);
   border-radius: 18px;
   padding: 36px 34px;
   box-shadow: 0 12px 32px -20px rgba(15, 23, 42, .28);
}
.auth-panel__inner {
   width: 100%;
}
.auth-title {
   font-size: 24px;
   font-weight: 700;
   letter-spacing: -.02em;
   color: var(--au-ink);
   margin: 0 0 6px;
}
.auth-subtitle {
   font-size: 14.5px;
   color: var(--au-muted);
   margin: 0 0 26px;
}

/* ------------------------------------------------------------
   Fields
   ------------------------------------------------------------ */
.auth-field {
   margin-bottom: 18px;
}
.auth-field label {
   display: block;
   font-size: 13px;
   font-weight: 600;
   color: #334155;
   margin: 0 0 7px;
}
.auth-input {
   position: relative;
   display: block;
}
.auth-input__icon {
   position: absolute;
   left: 15px;
   top: 50%;
   transform: translateY(-50%);
   display: flex;
   color: var(--au-faint);
   pointer-events: none;
   z-index: 2;
}
.auth-input .form-control {
   display: block;
   width: 100%;
   height: 48px;
   line-height: normal;
   padding: 0 15px 0 43px;
   font-size: 14.5px;
   color: var(--au-text);
   background: #ffffff;
   border: 1px solid var(--au-border);
   border-radius: 10px;
   margin: 0;
   transition: border-color .15s ease, box-shadow .15s ease;
   -webkit-appearance: none;
   appearance: none;
}
.auth-input .form-control:hover {
   border-color: #94a3b8;
}
.auth-input .form-control:focus {
   outline: none;
   color: var(--au-text);
   border-color: var(--au-primary);
   box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
.auth-input .form-control[aria-invalid="true"] {
   border-color: var(--au-danger);
}
.auth-input .form-control[aria-invalid="true"]:focus {
   box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}
.auth-input--pass .form-control {
   padding-right: 48px;
}
.auth-error {
   display: block;
   margin: 7px 0 0;
   font-size: 12.5px;
   font-weight: 500;
   line-height: 1.5;
   color: var(--au-danger);
}

/* Password visibility toggle */
.pass-toggle {
   position: absolute;
   right: 6px;
   top: 50%;
   transform: translateY(-50%);
   width: 34px;
   height: 34px;
   padding: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   border: 0;
   border-radius: 8px;
   background: transparent;
   color: var(--au-faint);
   cursor: pointer;
   transition: background-color .15s ease, color .15s ease;
}
.pass-toggle:hover {
   background: #f1f5f9;
   color: var(--au-muted);
}
.pass-toggle:focus-visible {
   outline: 2px solid rgba(37, 99, 235, .55);
   outline-offset: 1px;
}
.pass-toggle .eye-off { display: none; }
.pass-toggle.is-visible .eye-on { display: none; }
.pass-toggle.is-visible .eye-off { display: block; }

/* ------------------------------------------------------------
   Forgot password row
   ------------------------------------------------------------ */
.auth-row {
   display: flex;
   align-items: center;
   justify-content: space-between;
   flex-wrap: wrap;
   gap: 10px;
   margin: -2px 0 20px;
}
.auth-remember {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   margin: 0;
   font-size: 13.5px;
   font-weight: 500;
   color: var(--au-faint);
   cursor: pointer;
   user-select: none;
}
.auth-remember input {
   width: 16px;
   height: 16px;
   margin: 0;
   accent-color: var(--au-primary);
   cursor: pointer;
}
.auth-forgot-link {
   font-size: 13.5px;
   font-weight: 500;
   color: var(--au-primary);
}
.auth-forgot-link:hover {
   color: var(--au-primary-dark);
   text-decoration: underline;
}
.auth-back {
   text-align: center;
   margin: 18px 0 0;
   font-size: 13.5px;
   color: var(--au-faint);
}
.auth-back a {
   color: var(--au-primary);
   font-weight: 500;
}
.auth-back a:hover {
   color: var(--au-primary-dark);
   text-decoration: underline;
}

/* ------------------------------------------------------------
   Submit button + loading state
   ------------------------------------------------------------ */
.auth-submit {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 9px;
   width: 100%;
   height: 50px;
   padding: 0 20px;
   background: var(--au-primary);
   color: #ffffff;
   border: 0;
   border-radius: 10px;
   font-size: 15px;
   font-weight: 600;
   letter-spacing: .01em;
   cursor: pointer;
   box-shadow: 0 14px 26px -16px rgba(37, 99, 235, .85);
   transition: background-color .15s ease, transform .12s ease, box-shadow .15s ease, opacity .15s ease;
}
.auth-submit:hover,
.auth-submit:focus {
   background: var(--au-primary-dark);
   color: #ffffff;
   text-decoration: none;
}
.auth-submit:active {
   transform: translateY(1px);
}
.auth-submit:focus-visible {
   outline: 2px solid rgba(37, 99, 235, .55);
   outline-offset: 2px;
}
.auth-submit.is-loading,
.auth-submit:disabled {
   opacity: .8;
   cursor: progress;
   box-shadow: none;
}
.auth-submit__arrow {
   transition: transform .15s ease;
}
.auth-submit:hover .auth-submit__arrow {
   transform: translateX(3px);
}
.btn-spinner {
   width: 15px;
   height: 15px;
   border: 2px solid rgba(255, 255, 255, .45);
   border-top-color: #ffffff;
   border-radius: 50%;
   display: inline-block;
   animation: auSpin .7s linear infinite;
}
@keyframes auSpin {
   to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
   .btn-spinner { animation-duration: 1.4s; }
}

/* ------------------------------------------------------------
   Security note + footer
   ------------------------------------------------------------ */
.auth-secure {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 7px;
   margin: 18px 0 0;
   font-size: 12.5px;
   color: var(--au-faint);
}
.auth-secure svg { flex: none; }
.auth-footer {
   margin: 28px 0 0;
   font-size: 12.5px;
   color: var(--au-faint);
   text-align: center;
}

/* ------------------------------------------------------------
   Placeholders (home.css forces white with !important).
   One rule per vendor pseudo so a selector unsupported by the
   browser only drops its own rule, never the others.
   ------------------------------------------------------------ */
.auth-panel .form-control::placeholder {
   color: #475569 !important;
   opacity: 1 !important;
   font-size: 14.5px;
   font-weight: 600;
}
.auth-panel .form-control::-webkit-input-placeholder {
   color: #475569 !important;
   opacity: 1 !important;
   font-size: 14.5px;
   font-weight: 600;
}
.auth-panel .form-control::-moz-placeholder {
   color: #475569 !important;
   opacity: 1 !important;
   font-size: 14.5px;
   font-weight: 600;
}
.auth-panel .form-control:-ms-input-placeholder {
   color: #475569 !important;
   opacity: 1 !important;
   font-size: 14.5px;
   font-weight: 600;
}

/* ------------------------------------------------------------
   Compact alerts (forgot / reset status messages)
   ------------------------------------------------------------ */
.auth-alert {
   display: block;
   border-radius: 10px;
   border: 1px solid #fecaca;
   background: #fef2f2;
   color: #b91c1c;
   font-size: 13.5px;
   font-weight: 500;
   line-height: 1.5;
   padding: 11px 14px;
   margin: 0 0 16px;
}
.auth-alert--ok {
   border-color: #bbf7d0;
   background: #f0fdf4;
   color: #15803d;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media screen and (max-width: 991px) {
   body.form-login-body {
      padding-left: 0;
      padding-right: 0;
   }
   .auth-page {
      padding: 28px 18px 20px;
   }
   .auth-shell {
      flex-direction: column;
      gap: 24px;
   }
   .auth-brand {
      flex: none;
      max-width: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      width: 100%;
      max-width: 460px;
   }
   .auth-brand__logo {
      height: 36px;
      margin-bottom: 12px;
   }
   .auth-brand__app {
      font-size: 30px;
      margin-bottom: 0;
   }
   .auth-brand__sub,
   .auth-brand__quote,
   .auth-brand__art,
   .auth-brand__note {
      display: none;
   }
   .auth-panel {
      flex: none;
      max-width: 460px;
      padding: 32px 28px;
   }
}
@media screen and (max-width: 480px) {
   .auth-page {
      padding: 20px 14px 16px;
   }
   .auth-brand__logo {
      height: 32px;
   }
   .auth-brand__app {
      font-size: 26px;
   }
   .auth-panel {
      padding: 26px 20px;
      border-radius: 16px;
   }
   .auth-title {
      font-size: 22px;
   }
   .auth-footer {
      margin-top: 20px;
   }
}
