/* ==========================================================================
   Ontech Dev Portal — Auth Pages Stylesheet
   Covers: Login, Register, Forgot Password
   ========================================================================== */

/* ── Body / Background ──────────────────────────────────────────────────── */
body.auth-page {
  background-color: #f0f2f5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* ── Auth Container ─────────────────────────────────────────────────────── */
.auth-container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* ── Auth Card ──────────────────────────────────────────────────────────── */
.auth-card {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
  border: 1px solid #adb5bd;
  overflow: hidden;
}

/* ── Auth Card Body ─────────────────────────────────────────────────────── */
.auth-card-body {
  padding: 2rem;
}

/* ── Form Styles ────────────────────────────────────────────────────────── */
.auth-form .form-label {
  font-weight: 500;
  font-size: 0.8125rem;
  color: #6c757d;
  margin-bottom: 0.4rem;
}

.auth-form .form-control {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #ced4da;
  font-size: 0.9375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.auth-form .form-control::placeholder {
  color: #adb5bd;
}

.auth-form .form-control:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 0.2rem rgba(0, 40, 104, 0.15);
}

.auth-form .input-group .input-group-text {
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  border-right: none;
  border-radius: 0.5rem 0 0 0.5rem;
  color: #6c757d;
  padding: 0.75rem 0.85rem;
}

.auth-form .input-group .form-control {
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
}

.auth-form .input-group:focus-within .input-group-text {
  border-color: #0056b3;
  color: #0056b3;
}

/* ── Password Toggle ────────────────────────────────────────────────────── */
.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  background: transparent;
  border: none;
  color: #6c757d;
  cursor: pointer;
  z-index: 4;
  font-size: 0.9rem;
}

.password-toggle:hover {
  color: #002868;
}

.password-wrapper .form-control {
  padding-right: 2.75rem;
}

/* ── Password Strength ──────────────────────────────────────────────────── */
.password-strength {
  margin-top: 0.5rem;
}

.password-strength-bar {
  height: 4px;
  background-color: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
  width: 0;
}

.password-strength[data-strength="weak"] .password-strength-fill { width: 25%; background-color: #dc3545; }
.password-strength[data-strength="fair"] .password-strength-fill { width: 50%; background-color: #fd7e14; }
.password-strength[data-strength="good"] .password-strength-fill { width: 75%; background-color: #ffc107; }
.password-strength[data-strength="strong"] .password-strength-fill { width: 100%; background-color: #28a745; }

.password-strength-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6c757d;
}

/* ── Submit Button ──────────────────────────────────────────────────────── */
.btn-auth {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #002868;
  border: 1px solid #002868;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-auth:hover {
  background-color: #001d4d;
  border-color: #001d4d;
  color: #ffffff;
}

.btn-auth:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 40, 104, 0.35);
}

.btn-auth:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-auth .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
  margin-right: 0.5rem;
  vertical-align: -0.125em;
}

/* ── Auth Footer ────────────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  padding: 1.25rem 0 0.5rem;
}

.auth-footer a {
  color: #0056b3;
  font-size: 0.875rem;
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  color: #002868;
  text-decoration: underline;
}

.auth-footer-copyright {
  font-size: 0.75rem;
  color: #adb5bd;
  margin: 0.75rem 0 0;
}

/* ── Security Notice ────────────────────────────────────────────────────── */
.auth-security-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.auth-security-notice .notice-icon {
  color: #6c757d;
  font-size: 0.85rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.auth-security-notice .notice-text {
  font-size: 0.75rem;
  color: #6c757d;
  line-height: 1.5;
  margin: 0;
}

/* ── Alert Overrides ────────────────────────────────────────────────────── */
.auth-card-body .alert {
  border-radius: 0.5rem;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border: none;
}

.auth-card-body .alert-danger {
  background-color: #fff5f5;
  color: #842029;
  border-left: 3px solid #dc3545;
}

.auth-card-body .alert-success {
  background-color: #f0fdf4;
  color: #0f5132;
  border-left: 3px solid #28a745;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  body.auth-page {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 1.5rem;
  }

  .auth-container {
    max-width: 100%;
  }

  .auth-card {
    border-radius: 0.5rem;
  }

  .auth-card-header {
    padding: 1.5rem 1.25rem;
  }

  .auth-card-header h4 {
    font-size: 1.2rem;
  }

  .auth-card-body {
    padding: 1.5rem 1.25rem;
  }

  .btn-auth {
    padding: 0.7rem 1.25rem;
  }
}
