/* Login Widget CSS - Extracted from login-widget.js */

/* HIGH SPECIFICITY SELECTORS - Override Elementor without !important */
/* This allows customization from the integrating page */

/* Login Form Styles */
.lms-login-wrapper {
  font-family: sans-serif;
  color: #333;
  max-width: 100%;
  padding-left: 20px;
}

.lms-login-wrapper .lms-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

/* Input Styles - Mimic Angular Material */
.lms-login-wrapper .lms-input-wrapper {
  position: relative;
  width: 100%;
}

.lms-login-wrapper .lms-input-wrapper .lms-input {
  border: 1px solid #e0e0e0;
  padding: 10px 16px 10px 45px;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  background: #fff;
  box-sizing: border-box;
}

.lms-login-wrapper .lms-input-wrapper .lms-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
  outline: 0;
}

.lms-login-wrapper .lms-input-wrapper .lms-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #666;
  pointer-events: none;
}

/* MAXIMUM SPECIFICITY: Override Elementor button styles */
/* These selectors have higher specificity than Elementor's generic button styles */
.lms-login-wrapper .lms-input-wrapper .lms-password-toggle,
.lms-login-wrapper .lms-input-wrapper button.lms-password-toggle,
.lms-login-wrapper .lms-input-wrapper #password-toggle.lms-password-toggle,
.lms-login-wrapper .lms-input-wrapper button[type="button"].lms-password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #666;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color .2s;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  /* Override Elementor's button styles with specificity */
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
}

.lms-login-wrapper .lms-input-wrapper .lms-password-toggle:hover,
.lms-login-wrapper .lms-input-wrapper button.lms-password-toggle:hover {
  color: #007bff;
}

/* Button Styles - Match Angular Material with MAXIMUM SPECIFICITY */
.lms-login-wrapper .lms-button,
.lms-login-wrapper button.lms-button,
.lms-login-wrapper .lms-login-form .lms-button,
.lms-login-wrapper .lms-login-form button.lms-button,
.lms-login-wrapper .lms-login-form input[type="submit"].lms-button,
.lms-login-wrapper .lms-login-form button[type="submit"].lms-button {
  background: linear-gradient(to right, #007bff, #0056b3);
  color: white;
  padding: 12px 25px;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background .3s, transform .1s;
  width: 100%;
  box-shadow: 0 8px 20px rgba(0,123,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Override Elementor's button styles with specificity */
  font-family: inherit;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  line-height: 1.2;
}

.lms-login-wrapper .lms-button:hover,
.lms-login-wrapper button.lms-button:hover,
.lms-login-wrapper .lms-login-form .lms-button:hover,
.lms-login-wrapper .lms-login-form button.lms-button:hover {
  background: linear-gradient(to right, #0056b3, #004999);
  transform: translateY(-3px);
}

.lms-login-wrapper .lms-button:active,
.lms-login-wrapper button.lms-button:active,
.lms-login-wrapper .lms-login-form .lms-button:active,
.lms-login-wrapper .lms-login-form button.lms-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.lms-login-wrapper .lms-button:disabled,
.lms-login-wrapper button.lms-button:disabled,
.lms-login-wrapper .lms-login-form .lms-button:disabled,
.lms-login-wrapper .lms-login-form button.lms-button:disabled {
  background: rgba(0,123,255,0.3);
  color: rgba(255,255,255,0.7);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Status Messages */
.lms-login-wrapper .lms-status {
  margin-top: 10px;
  color: #d32f2f;
  background: #fff0f0;
  border: 1px solid #f8bbd0;
  border-radius: 6px;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(211,47,47,0.06);
  display: none;
  width: 100%;
  box-sizing: border-box;
}

.lms-login-wrapper .lms-status:not(:empty) {
  display: block;
}

/* Modal Styles - Match Angular Material */
.lms-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.lms-modal .lms-modal-box {
  background: #fff;
  padding: 18px 18px 22px 18px;
  border-radius: 12px;
  max-width: 370px;
  width: 90%;
  color: #333;
  text-align: left;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  display: block;
  position: relative;
}

/* Modal Title - Match Angular Material */
.lms-modal .lms-modal-box .lms-modal-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #007bff;
  text-align: center;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

/* LC Selector Modal Styles */
.lms-modal .lms-modal-box .lms-modal-search-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 12px;
  background: #f8f8f8;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.lms-modal .lms-modal-box .lms-modal-search-icon {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  flex-shrink: 0;
  stroke: #757575;
  display: block;
}

.lms-modal .lms-modal-box .lms-modal-search {
  border: 0;
  padding: 5px 0;
  font-size: 1rem;
  flex: 1;
  outline: 0;
  background: transparent;
  width: 100%;
  font-family: inherit;
  color: #333;
}

.lms-modal .lms-modal-box .lms-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.lms-modal .lms-modal-box .lms-modal-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  font-size: 1.1rem;
  color: #444;
  cursor: pointer;
  transition: background-color .2s;
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
}

.lms-modal .lms-modal-box .lms-modal-list li:last-child {
  border-bottom: none;
}

.lms-modal .lms-modal-box .lms-modal-list li:hover {
  background-color: #f0f0f0;
}

.lms-modal .lms-modal-box .lms-modal-list li.no-results {
  text-align: center;
  color: #999;
  cursor: default;
  background: none;
  font-style: italic;
}

.lms-modal .lms-modal-box .lms-modal-arrow {
  color: #007bff;
  font-size: 20px;
  flex-shrink: 0;
}

/* MAXIMUM SPECIFICITY: Override Elementor modal button styles */
.lms-modal .lms-modal-box .lms-modal-cancel,
.lms-modal .lms-modal-box button.lms-modal-cancel,
.lms-modal .lms-modal-box input[type="button"].lms-modal-cancel {
  background-color: #f0f0f0;
  color: #555;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color .2s, color .2s;
  margin-top: 25px;
  /* Override Elementor's button styles with specificity */
  background: #f0f0f0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  line-height: 1.2;
  display: block;
  width: auto;
}

.lms-modal .lms-modal-box .lms-modal-cancel:hover,
.lms-modal .lms-modal-box button.lms-modal-cancel:hover {
  background-color: #e0e0e0;
  color: #333;
}

/* OTP Modal Styles */
.lms-modal .lms-modal-box .lms-otp-container {
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.lms-modal .lms-modal-box .lms-otp-boxes {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin: 20px 0;
  width: 100%;
  box-sizing: border-box;
}

.lms-modal .lms-modal-box .lms-otp-input {
  width: 45px;
  height: 55px;
  font-size: 24px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding-bottom: 2px;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  box-sizing: border-box;
  font-family: inherit;
  color: #333;
  outline: none;
}

.lms-modal .lms-modal-box .lms-otp-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
  outline: none;
}

.lms-modal .lms-modal-box .lms-otp-input[type='number']::-webkit-outer-spin-button,
.lms-modal .lms-modal-box .lms-otp-input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lms-modal .lms-modal-box .lms-otp-input[type='number'] {
  -moz-appearance: textfield;
}

/* TOTP Setup Modal Styles */
.lms-modal .lms-modal-box .lms-totp-qr {
  display: block;
  margin: 12px auto 16px auto;
  border: 3px solid rgba(0,123,255,0.18);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,123,255,0.13);
  max-width: 100%;
  height: auto;
}

.lms-modal .lms-modal-box .lms-totp-secret {
  font-family: monospace;
  background: #f9f9f9;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 1rem;
  text-align: center;
  color: #222;
  margin-bottom: 14px;
  border: 1px solid #ddd;
  word-break: break-all;
  user-select: all;
  width: 100%;
  box-sizing: border-box;
}

.lms-modal .lms-modal-box .lms-totp-instructions {
  font-size: 0.97rem;
  color: #555;
  margin-bottom: 8px;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}

/* Checkbox and Form Elements */
.lms-login-wrapper .lms-checkbox-wrapper {
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.lms-login-wrapper .lms-checkbox-wrapper .lms-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

.lms-login-wrapper .lms-remember-me {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

.lms-login-wrapper .lms-remember-me .lms-remember-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lms-login-wrapper .lms-remember-me .lms-forgot-password {
  text-align: right;
}

.lms-login-wrapper .lms-remember-me .lms-forgot-password .lms-forgot-link {
  color: #007bff;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: color .2s;
  font-family: inherit;
}

.lms-login-wrapper .lms-remember-me .lms-forgot-password .lms-forgot-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.lms-login-wrapper .lms-back-link {
  color: #007bff;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: color .2s;
  margin-bottom: 20px;
  display: block;
  font-weight: 500;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.lms-login-wrapper .lms-back-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Modal Actions - Match Angular Material with MAXIMUM SPECIFICITY */
.lms-modal .lms-modal-box .lms-modal-actions,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* MAXIMUM SPECIFICITY: Override Elementor modal action button styles */
.lms-modal .lms-modal-box .lms-modal-actions button,
.lms-modal .lms-modal-box .lms-modal-actions .lms-button,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions button,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions .lms-button {
  flex: 1 1 0;
  min-width: 100px;
  max-width: 180px;
  padding: 10px 0;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .1s;
  box-sizing: border-box;
  /* Override Elementor's button styles with specificity */
  background-color: transparent;
  font-family: inherit;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  margin: 0;
  line-height: 1.2;
}

.lms-modal .lms-modal-box .lms-modal-actions .lms-button-primary,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions .lms-button-primary {
  background: linear-gradient(to right, #007bff, #0056b3);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,123,255,0.10);
}

.lms-modal .lms-modal-box .lms-modal-actions .lms-button-primary:hover:not(:disabled),
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions .lms-button-primary:hover:not(:disabled) {
  background: linear-gradient(to right, #0056b3, #004999);
  transform: translateY(-1px);
}

.lms-modal .lms-modal-box .lms-modal-actions .lms-button-primary:active,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions .lms-button-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.lms-modal .lms-modal-box .lms-modal-actions .lms-button-primary:disabled,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions .lms-button-primary:disabled {
  background: rgba(0,123,255,0.3);
  color: rgba(255,255,255,0.7);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.lms-modal .lms-modal-box .lms-modal-actions .lms-button-secondary,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions .lms-button-secondary {
  background-color: #f0f0f0;
  color: #555;
  font-weight: 500;
}

.lms-modal .lms-modal-box .lms-modal-actions .lms-button-secondary:hover,
.lms-modal .lms-modal-box .lms-otp-container .lms-modal-actions .lms-button-secondary:hover {
  background-color: #e0e0e0;
  color: #333;
}

/* Spinner */
.lms-login-wrapper .lms-login-form .lms-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  margin-left: 10px;
  display: none;
  vertical-align: middle;
}

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

/* Error Message Styles */
.lms-login-wrapper .lms-error-message {
  color: #d32f2f;
  background: #fff0f0;
  border: 1px solid #f8bbd0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 0.97rem;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(211,47,47,0.06);
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
  box-sizing: border-box;
}

/* Success Message Styles */
.lms-login-wrapper .lms-success-message {
  color: #2e7d32;
  background: #f1f8e9;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.97rem;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(46,125,50,0.06);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
  box-sizing: border-box;
}

/* Success message list styling */
.lms-login-wrapper .lms-success-message ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.lms-login-wrapper .lms-success-message li {
  margin-bottom: 4px;
}

/* Override any conflicting styles */
.lms-login-wrapper .lms-success-message.lms-status {
  color: #2e7d32;
  background: #f1f8e9;
  border-color: #c8e6c9;
}

/* WordPress/Elementor Override Prevention - Enhanced specificity */
.lms-login-wrapper *,
.lms-modal * {
  box-sizing: border-box;
}

.lms-login-wrapper input,
.lms-login-wrapper button,
.lms-login-wrapper select,
.lms-login-wrapper textarea {
  font-family: inherit;
}

/* CSS Custom Properties for easy customization */
:root {
  --lms-primary-color: #007bff;
  --lms-secondary-color: #0056b3;
  --lms-error-color: #d32f2f;
  --lms-border-color: #e0e0e0;
  --lms-background-color: #fff;
  --lms-text-color: #333;
  --lms-button-radius: 8px;
  --lms-input-radius: 8px;
  --lms-shadow: 0 8px 20px rgba(0,123,255,0.4);
}

/* Override with custom properties */
.lms-login-wrapper .lms-button,
.lms-login-wrapper .lms-login-form .lms-button {
  background: linear-gradient(to right, var(--lms-primary-color), var(--lms-secondary-color));
}

.lms-login-wrapper .lms-button:hover,
.lms-login-wrapper .lms-login-form .lms-button:hover {
  background: linear-gradient(to right, var(--lms-secondary-color), #004999);
}

.lms-login-wrapper .lms-input-wrapper .lms-input {
  border-color: var(--lms-border-color);
}

.lms-login-wrapper .lms-input-wrapper .lms-input:focus {
  border-color: var(--lms-primary-color);
}

.lms-login-wrapper .lms-status {
  color: var(--lms-error-color);
}

.lms-modal .lms-modal-box .lms-modal-title {
  color: var(--lms-primary-color);
}

.lms-login-wrapper .lms-remember-me .lms-forgot-password .lms-forgot-link {
  color: var(--lms-primary-color);
}

.lms-login-wrapper .lms-remember-me .lms-forgot-password .lms-forgot-link:hover {
  color: var(--lms-secondary-color);
}

/* NUCLEAR OPTION: Use attribute selectors for maximum specificity */
.lms-login-wrapper[id] .lms-input-wrapper .lms-password-toggle,
.lms-login-wrapper[class*="lms"] .lms-input-wrapper .lms-password-toggle {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
}

/* Override Elementor's global button styles with maximum specificity */
.lms-login-wrapper .lms-input-wrapper button[type="button"].lms-password-toggle,
.lms-login-wrapper .lms-login-form button[type="submit"].lms-button,
.lms-login-wrapper .lms-login-form input[type="submit"].lms-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
}

/* FALLBACK: Ensure button is always visible */
.lms-login-wrapper .lms-button {
  background: #007bff;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ULTRA-SPECIFIC: Target the exact HTML structure */
#login-widget.lms-login-wrapper .lms-login-form .lms-button,
#login-widget.lms-login-wrapper .lms-login-form button.lms-button,
#login-widget.lms-login-wrapper .lms-login-form button[type="submit"].lms-button {
  background: #007bff;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* NUCLEAR OPTION: Use ID + multiple classes for maximum specificity */
#login-widget.lms-login-wrapper .lms-login-form .lms-button:hover,
#login-widget.lms-login-wrapper .lms-login-form button.lms-button:hover {
  background: #0056b3;
}

#login-widget.lms-login-wrapper .lms-login-form .lms-button:disabled,
#login-widget.lms-login-wrapper .lms-login-form button.lms-button:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* OVERRIDE ANY ELEMENTOR STYLES */
#login-widget.lms-login-wrapper .lms-login-form button,
#login-widget.lms-login-wrapper .lms-login-form input[type="submit"],
#login-widget.lms-login-wrapper .lms-login-form .elementor-button {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 25px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  line-height: 1.2;
  box-shadow: none;
} 