/**
 * Tecology Password Toggle Styles
 * 
 * Styles for password visibility toggle functionality on RCP forms
 */

.tecology-password-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.tecology-password-wrapper input[type='password'],
.tecology-password-wrapper input[type='text'] {
  padding-right: 45px !important; /* Make room for the toggle button */
  width: 100%;
  box-sizing: border-box;
}

.tecology-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wp--preset--color--contrast, #666);
  transition: color 0.2s ease;
  z-index: 10;
}

.tecology-password-toggle:hover {
  color: var(--wp--preset--color--contrast, #333);
}

.tecology-password-toggle:focus {
  outline: 2px solid var(--wp--preset--color--accent, #007cba);
  outline-offset: 2px;
  border-radius: 2px;
}

.tecology-password-toggle .eye-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* Dark theme support */
.is-style-dark .tecology-password-toggle {
  color: #ccc;
}

.is-style-dark .tecology-password-toggle:hover {
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tecology-password-toggle {
    right: 8px;
    padding: 8px;
  }

  .tecology-password-wrapper input[type='password'],
  .tecology-password-wrapper input[type='text'] {
    padding-right: 50px !important;
  }
}

/* Ensure proper positioning in RCP forms */
.rcp_form .tecology-password-wrapper {
  width: 100%;
}

/* Fix for any conflicting styles */
.tecology-password-wrapper input:focus {
  outline: 2px solid var(--wp--preset--color--accent, #007cba);
  outline-offset: 2px;
}

/* Accessibility improvements */
.tecology-password-toggle:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent, #007cba);
  outline-offset: 2px;
  border-radius: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .tecology-password-toggle {
    color: #000;
    border: 1px solid #000;
    background: #fff;
  }

  .tecology-password-toggle:hover {
    background: #f0f0f0;
  }
}
