/**
 * Auth pages — login, register, forgot password (responsive)
 */

.auth-page body,
body.auth-page {
  min-height: 100vh;
  height: auto;
  padding: 16px;
  align-items: flex-start;
}

@media (min-width: 769px) {
  body.auth-page {
    align-items: center;
    padding: 24px;
  }
}

.auth-page .container {
  width: 100%;
  max-width: 1000px;
  min-height: auto;
}

.auth-page .right {
  width: 55%;
  padding: 32px 28px;
  overflow-y: auto;
}

.auth-page .left {
  width: 45%;
  padding: 40px 32px;
}

.auth-page h2 {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-page h2 i {
  color: var(--navy, #003893);
}

/* Password field with toggle */
.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px !important;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
}

.password-toggle:hover {
  color: #0b3d91;
  background: #f1f5f9;
}

/* Inline field validation */
.field-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #b91c1c;
  line-height: 1.4;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.auth-page .input-invalid,
.auth-page input.input-invalid {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}

.auth-links-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.auth-links-row a {
  color: #2563eb;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.auth-links-row a:hover {
  text-decoration: underline;
}

/* Role notices (employer / registration messaging) */
.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.auth-notice i {
  margin-top: 2px;
  flex-shrink: 0;
}

.auth-notice-warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.auth-notice-info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.public-login-tagline {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 12px;
}

/* Internal admin login */
.auth-page-admin .container-admin-login {
  max-width: 900px;
}

.admin-login-sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 12px;
  max-width: 280px;
}

.admin-login-footer-note {
  margin-top: 20px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.credentials-card {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.credentials-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #166534;
}

.credentials-card code {
  background: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 14px;
}

.credentials-hint {
  font-size: 13px;
  color: #64748b;
  margin-top: 12px;
}

.forgot-password-wrap {
  max-width: 480px;
  margin: 0 auto;
}

.forgot-step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.forgot-step {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #e2e8f0;
  color: #64748b;
}

.forgot-step.active {
  background: #0b3d91;
  color: #fff;
}

.forgot-step.done {
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 768px) {
  body.auth-page {
    padding: 12px;
    display: block;
  }

  .auth-page .container {
    flex-direction: column;
    margin: 0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  .auth-page .left,
  .auth-page .right {
    width: 100%;
    padding: 28px 20px;
  }

  .auth-page .left {
    text-align: center;
    padding-bottom: 20px;
  }

  .auth-page .left h1 {
    font-size: 1.75rem;
  }

  .auth-page .left p {
    font-size: 0.95rem;
  }

  .auth-page .tabs {
    flex-direction: row;
    gap: 8px;
  }

  .auth-page .tab-btn {
    width: auto;
    flex: 1;
    font-size: 13px;
    padding: 10px 8px;
  }

  .auth-page .right {
    padding: 24px 20px 32px;
  }

  .login-btn {
    padding: 16px;
    font-size: 16px;
  }

  .input-group input {
    padding: 14px 12px;
    font-size: 16px;
  }

  .password-field input {
    font-size: 16px;
  }
}

@media (max-width: 400px) {
  .auth-page .tab-btn {
    font-size: 11px;
    padding: 8px 4px;
  }
}

/* Locked / Read-only registration inputs */
.auth-page input.readonly-field {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* Screen reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Flatten header and footer containers for auth pages */
body:not(.high-contrast) .grid-bg-container {
  background: #ffffff !important;
}
body:not(.high-contrast) .grid-bg-container::before {
  background-image: none !important;
}
body:not(.high-contrast) .accessibility-controls {
  background: #ffffff !important;
}
body:not(.high-contrast) footer.site-footer {
  background: #ffffff !important;
}

/* Reset header, footer, and accessibility containers to prevent card styling and layout breakage */
.site-footer .container,
.site-header .container,
.accessibility-controls .container {
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  margin: 0 auto !important;
  flex-direction: row !important;
}
