/*
 * Login Page Specific Styles
 * Auth container layout, password toggle, mobile optimizations, accessibility
 */

/* ================================
 * PAGE LAYOUT
 * ================================ */

/* Full-height auth container with reduced top gap */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--space-6) 0;
}

/* Reduce the gap between navbar and content */
.auth-container.login-bg {
  padding-top: var(--space-3);
  align-items: flex-start;
}

/* Override base template mt-5 for login page */
main:has(.login-bg) {
  margin-top: var(--space-5) !important;
}

/* Orange accent bar on the page header to complement steel */
.login-bg .pk-card:first-of-type .pk-card-header-steel {
  border-bottom: 3px solid var(--cf-citrine);
}

/* ================================
 * HEADING OVERRIDES
 * ================================ */

/* Login page heading sizing - overrides global rules */
.login-bg .main-heading {
  font-size: var(--text-4xl) !important;
  line-height: var(--leading-tight) !important;
}

/* Subtitle text within steel header */
.login-bg .pk-card-header-steel .login-subtitle {
  color: var(--cf-text-on-dark);
  font-size: var(--text-base);
  margin: 0;
}

/* ================================
 * PASSWORD TOGGLE
 * ================================ */

.password-input-group {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--cf-text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.password-toggle:hover {
  color: var(--cf-citrine);
  background: var(--cf-citrine-subtle);
}

/* ================================
 * AUTH LINKS
 * ================================ */

.auth-links {
  border-top: 1px solid var(--cf-mist);
  padding-top: var(--space-4);
}

/* Orange link styling (replaces inline style attributes) */
.auth-link {
  color: var(--cf-citrine);
  text-decoration: none;
  font-weight: var(--font-medium);
  transition: color var(--transition-fast);
}

.auth-link:hover {
  color: var(--cf-citrine-dark);
  text-decoration: underline;
}

/* ================================
 * HELP SECTION
 * ================================ */

.login-help-card {
  border: 1px solid var(--cf-mist);
  box-shadow: none;
}

.login-help-card:hover {
  box-shadow: var(--shadow-sm);
}

/* Email link styling (replaces inline style attributes) */
.email-link-styled {
  color: var(--cf-citrine);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.email-link-styled:hover {
  color: var(--cf-citrine-dark);
  text-decoration: underline;
}

/* ================================
 * FORM FIELD FOCUS STYLES
 * ================================ */

.login-bg .pk-form-control:focus,
.login-bg .form-control:focus {
  outline: none !important;
  border-color: var(--cf-citrine-muted) !important;
  box-shadow: 0 0 0 2px var(--cf-citrine-subtle) !important;
  background-color: var(--cf-surface) !important;
}

/* ================================
 * MOBILE RESPONSIVE - 991px
 * Tablet text reduction
 * ================================ */

@media (max-width: 991.98px) {
  .login-bg .main-heading {
    font-size: var(--text-3xl) !important;
  }
}

/* ================================
 * MOBILE RESPONSIVE - 767px
 * Compact text, reduced padding
 * ================================ */

@media (max-width: 767px) {
  .auth-container {
    padding: var(--space-4) 0;
  }

  .login-bg .pk-card {
    margin: 0 var(--space-3);
  }

  /* Page header text reduction */
  .login-bg .pk-card-header .main-heading {
    font-size: var(--text-lg) !important;
  }

  .login-bg .pk-card-header .login-subtitle {
    font-size: var(--text-sm);
  }

  /* Section heading text reduction */
  .login-bg .pk-card-header h2,
  .login-bg .pk-card-header .h4 {
    font-size: var(--text-base);
  }

  /* Form label and control reduction */
  .login-bg .pk-form-label {
    font-size: var(--text-xs);
  }

  .login-bg .pk-form-control {
    font-size: var(--text-sm);
  }

  .login-bg .pk-form-help {
    font-size: var(--text-2xs);
  }

  /* Button size reduction */
  .login-bg .pk-btn {
    min-height: var(--btn-height-sm);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  /* Help section text reduction */
  .login-bg .login-help-card h5,
  .login-bg .login-help-card .h6 {
    font-size: var(--text-sm);
  }

  .login-bg .login-help-card p {
    font-size: var(--text-xs);
  }

  .login-bg .login-help-card .icon-lg {
    font-size: var(--text-xl) !important;
  }
}

/* ================================
 * MOBILE RESPONSIVE - 575px
 * Extra-small screen compaction
 * ================================ */

@media (max-width: 575px) {
  /* Even smaller header text */
  .login-bg .pk-card-header .main-heading {
    font-size: var(--text-base) !important;
  }

  .login-bg .pk-card-header .login-subtitle {
    font-size: var(--text-xs);
  }

  .login-bg .pk-card-header h2,
  .login-bg .pk-card-header .h4 {
    font-size: var(--text-sm);
  }

  /* Form controls */
  .login-bg .pk-form-label {
    font-size: var(--text-2xs);
  }

  .login-bg .pk-form-control {
    font-size: var(--text-xs);
  }

  /* Even smaller buttons */
  .login-bg .pk-btn {
    min-height: 28px;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-2xs);
  }

  /* Help section further reduction */
  .login-bg .login-help-card h5,
  .login-bg .login-help-card .h6 {
    font-size: var(--text-xs);
  }

  .login-bg .login-help-card p {
    font-size: var(--text-2xs);
  }

  .login-bg .login-help-card .icon-lg {
    font-size: var(--text-md) !important;
  }

  /* Reduce card spacing */
  .login-bg .pk-card {
    margin-bottom: var(--space-3);
  }
}

/* ================================
 * ACCESSIBILITY
 * ================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .login-bg .pk-form-control:focus {
    outline: 3px solid var(--cf-citrine);
    outline-offset: 2px;
  }

  .password-toggle:focus {
    outline: 3px solid var(--cf-citrine);
    outline-offset: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .password-toggle,
  .auth-link,
  .email-link-styled {
    transition: none;
  }
}
