/**
 * @file
 * Styles for the login status block.
 */

.login-status-block {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin: 15px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Logged in state - both template and standalone */
.login-status-logged-in,
.login-status-content.logged-in {
  text-align: left;
}

.login-status-logged-in h3,
.login-status-content.logged-in h3 {
  color: var(--color-primary, #7b2952);
  margin: 0 0 10px 0;
  font-size: 1.2em;
  font-weight: 600;
}

.login-status-logged-in .username,
.login-status-content.logged-in .login-confirmation {
  color: #6c757d;
  margin: 0 0 15px 0;
  font-style: italic;
}

.login-status-actions,
.logout-section {
  margin-top: 15px;
}

.logout-link,
.logout-btn {
  display: inline-block;
  padding: 8px 16px;
  background-color: #6c757d;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.logout-link:hover,
.logout-btn:hover {
  background-color: #5a6268;
  color: white;
  text-decoration: none;
}

/* NBvT membership info section */
.nbvt-membership-info {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
}

.nbvt-membership-info h2 {
  color: #7b2952;
  margin: 0 0 15px 0;
  font-size: 1.4em;
  font-weight: 600;
  text-align: left;
}

.nbvt-membership-info p {
  color: #495057;
  margin: 0;
  font-size: 0.95em;
  line-height: 1.5;
  text-align: left;
}

/* Login form state - both template and standalone */
.login-status-form h3,
.login-form-container h3 {
  color: #495057;
  margin: 0 0 10px 0;
  font-size: 1.2em;
  font-weight: 600;
}

.login-description {
  color: #6c757d;
  margin: 0 0 20px 0;
  font-size: 0.9em;
}

/* Standalone form styling */
.login-form-container .login-form {
  max-width: 300px;
  margin: 0 auto;
}

.login-form-container .form-group {
  margin-bottom: 15px;
}

.login-form-container .form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #495057;
}

.login-form-container .form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-form-container .form-group input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.login-form-container .form-group.has-error input {
  border-color: #dc3545;
}

.login-form-container .form-actions {
  margin-top: 20px;
  text-align: left;
}

.login-form-container .login-submit-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-width: 120px;
}

.login-form-container .login-submit-btn:hover {
  background-color: #0056b3;
}

.login-form-container .login-submit-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.login-form-container .login-messages {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
}

.login-form-container .error-message {
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Form styling */
.login-status-form .form-item {
  margin-bottom: 15px;
}

.login-status-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #495057;
}

.login-status-form input[type="text"],
.login-status-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-status-form input[type="text"]:focus,
.login-status-form input[type="password"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.login-status-form .form-actions {
  margin-top: 20px;
  text-align: left;
}

.login-status-form .login-submit {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  min-width: 120px;
}

.login-status-form .login-submit:hover {
  background-color: #0056b3;
}

.login-status-form .login-submit:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Error messages */
.login-status-form .form-item--error input {
  border-color: #dc3545;
}

.login-status-form .form-item--error-message {
  color: #dc3545;
  font-size: 0.875em;
  margin-top: 5px;
}

/* Loading state */
.login-status-form.ajax-progress .login-submit {
  position: relative;
  color: transparent;
}

.login-status-form.ajax-progress .login-submit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .login-status-block {
    padding: 15px;
    margin: 10px 0;
  }
  
  .nbvt-membership-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }
  
  .nbvt-membership-info h2 {
    font-size: 1.2em;
    margin-bottom: 12px;
  }
  
  .nbvt-membership-info p {
    font-size: 0.9em;
  }
  
  .login-status-form input[type="text"],
  .login-status-form input[type="password"] {
    padding: 8px 10px;
  }
  
  .login-status-form .login-submit {
    width: 100%;
    padding: 12px;
  }
}
