/**
 * Checkout Page Enhancements
 *
 * @package Elessi-VD-Child
 * @version 1.0.0
 * @since 2025-11-05
 */

/**
 * ============================================================================
 * PASSWORD VISIBILITY TOGGLE BUTTON FIX
 * ============================================================================
 *
 * ROOT CAUSE:
 * WordPress 6.3+ automatically adds password toggle button with class .show-password-input
 * Button is created but has no visible icon content
 *
 * FIX:
 * Add dashicons eye icon using ::before pseudo-element with proper sizing
 *
 * @since 2025-11-05
 * @version 1.2.0 - Back to icon with proper sizing per user request
 */

/* Password toggle button - Default state (show password) */
.woocommerce-form-login .show-password-input,
.woocommerce form .show-password-input {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 0.5rem;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f7f7f7;
    cursor: pointer;
    transition: all 0.3s ease;
}

.woocommerce-form-login .show-password-input:hover,
.woocommerce form .show-password-input:hover {
    background: #fff;
    border-color: #999;
}

/* Add eye icon using ::before pseudo-element */
.woocommerce-form-login .show-password-input::before,
.woocommerce form .show-password-input::before {
    content: "\f177"; /* dashicons-visibility (eye open) */
    font-family: dashicons;
    font-size: 20px;
    line-height: 1;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

/* Hide password state - change to closed eye icon */
.woocommerce-form-login .show-password-input[data-toggle="1"]::before,
.woocommerce form .show-password-input[data-toggle="1"]::before {
    content: "\f530"; /* dashicons-hidden (eye closed) */
}

/* Position button next to password field */
.woocommerce-form-login .form-row-last,
.woocommerce form .form-row-last {
    position: relative;
}

/* Make password field wrapper flex to align button */
.woocommerce-form-login .form-row-last,
.woocommerce form .form-row-last {
    display: flex;
    flex-direction: column;
}

/* Password field + button container */
.woocommerce-form-login .form-row-last > label,
.woocommerce form .form-row-last > label {
    display: block;
    margin-bottom: 0.5rem;
}

/* Focus state */
.woocommerce-form-login .show-password-input:focus,
.woocommerce form .show-password-input:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Active state */
.woocommerce-form-login .show-password-input:active,
.woocommerce form .show-password-input:active {
    transform: scale(0.95);
}
