/**
 * COEM Login Base Styles
 *
 * Neutral, minimal styles for the custom login page.
 * Theme-specific styling should be added in the theme's CSS.
 *
 * @package COEM_Base
 */

/* ==========================================================================
   Reset & Base
   ========================================================================== */

.coem-login-page {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #2c3e50;
  background-color: #f5f5f5;
}

.coem-login-page * {
  box-sizing: border-box;
}

/* ==========================================================================
   Container Layout
   ========================================================================== */

.coem-login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

/* ==========================================================================
   Header
   ========================================================================== */

.coem-login-header {
  margin-bottom: 2rem;
  text-align: center;
}

.coem-login-logo img {
  max-width: 200px;
  height: auto;
}

.coem-login-site-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}

.coem-login-site-title a {
  color: inherit;
  text-decoration: none;
}

.coem-login-site-title a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Login Box
   ========================================================================== */

.coem-login-box {
  width: 100%;
  max-width: 600px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.coem-login-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: #2c3e50;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.coem-login-message {
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  border-left: 4px solid;
}

.coem-login-message p {
  margin: 0;
  font-size: 0.9rem;
}

.coem-login-message-success {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.coem-login-message-error {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.coem-login-message-warning {
  background-color: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.coem-login-form {
  /* Form container */
}

.coem-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: #2c3e50;
}

.coem-required {
  color: #dc3545;
  margin-left: 0.25rem;
}

.coem-form-control {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #2c3e50;
  background-color: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.coem-form-control:focus {
  outline: 0;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.coem-form-control:disabled {
  background-color: #e9ecef;
  opacity: 0.7;
  cursor: not-allowed;
}

/* ==========================================================================
   Password Field
   ========================================================================== */

.coem-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

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

.coem-password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  padding: 0 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #6c757d;
  transition: color 0.15s ease-in-out;
}

.coem-password-toggle:hover {
  color: #3498db;
}

.coem-password-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.coem-password-toggle-text {
  /* Text for toggle button */
}

/* ==========================================================================
   Form Row (Remember & Forgot Password)
   ========================================================================== */

.coem-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.coem-form-remember {
  flex: 1;
}

.coem-form-links {
  flex: 1;
  text-align: right;
}

.coem-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0;
}

.coem-checkbox {
  width: auto;
  margin: 0;
  cursor: pointer;
}

/* ==========================================================================
   Links
   ========================================================================== */

.coem-link {
  color: #3498db;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease-in-out;
}

.coem-link:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.coem-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.coem-btn-primary {
  color: #ffffff;
  background-color: #3498db;
  border-color: #3498db;
}

.coem-btn-primary:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

.coem-btn-primary:focus {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.coem-btn-primary:disabled {
  background-color: #95a5a6;
  border-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.65;
}

.coem-btn-block {
  display: block;
  width: 100%;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.coem-login-register {
  /* Register link paragraph */
}

.coem-login-help {
  /* Help link paragraph */
}

/* ==========================================================================
   Back Link
   ========================================================================== */

.coem-login-back {
  margin-top: 2rem;
  text-align: center;
}

.coem-login-back .coem-link {
  font-size: 0.95rem;
}

/* ==========================================================================
   Countdown Timer
   ========================================================================== */

.coem-lockout-countdown {
  font-weight: 600;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 576px) {
  .coem-login-container {
    padding: 1rem 0.5rem;
  }

  .coem-login-box {
    padding: 1.5rem;
  }

  .coem-login-title {
    font-size: 1.25rem;
  }

  .coem-form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .coem-form-links {
    text-align: left;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.coem-form-control:focus,
.coem-btn:focus,
.coem-checkbox:focus,
.coem-password-toggle:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
