/**
 * Plugin Name:       Brands Directory Access
 * Plugin URI:        https://coderexperts.com/
 * Description:       Restricts access to the target page and handles custom login/registration forms using AJAX for seamless submission.
 * Requires at least: 6.1
 * Requires PHP:      7.0
 * Version:           1.0
 * Author:            Sayfur Rahman (CoderExperts)
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 */
 
/* --- Custom Access Gate Styling --- */
.ce-access-gate {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.ce-form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-around;
}

.ce-form {
    flex: 1 1 45%; 
    padding: 20px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
}

.ce-form h2 {
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-top: 0;
}

.ce-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.ce-form input[type="text"],
.ce-form input[type="email"],
.ce-form input[type="password"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.ce-remember label {
    display: inline-block;
    margin-left: 5px;
}

.ce-form button {
    background-color: #000;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.ce-form button:hover {
    background-color: #dbc67f;
}

.ce-form span {
    color: red; 
}

.ce-toggle-link {
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.ce-toggle-link a {
    color: #dbc67f;
    text-decoration: underline;
}

/* Messages */
.ce-message-wrapper {
    max-width: 900px;
    margin: 0 auto 20px auto;
}
.ce-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: none; 
}
.ce-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: none; 
}
.ce-error-message ul {
    list-style-type: disc;
    margin-left: 20px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .ce-form-container {
        flex-direction: column;
    }
    .ce-form {
        flex: 1 1 100%;
    }
}

/* --- Password Toggle Styling (Updated for SVG Color Toggle) --- */

.ce-password-field-wrap {
    position: relative;
    /* Ensure the input field takes up the full width */
}

.ce-password-toggle {
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    
    /* Positioning above the input */
    position: absolute;
    top: 7px; 
    right: 5px;
    z-index: 10;
    padding: 0; 
    
    transition: color 0.2s;
}

/* Default state: Password Hidden (Icon Color: Muted/Gray) */
.ce-password-toggle.is-hidden {
    color: #dbc67f; 
}

/* Active state: Password Visible (Icon Color: Theme Highlight) */
.ce-password-toggle.is-visible {
    color: #666; /* Theme color when password is shown */
}

/* Hover state on any toggle */
.ce-password-toggle:hover {
    color: #000; /* Darker color on hover */
}

/* Style the SVG icon itself */
.ce-password-toggle svg {
    width: 18px; 
    height: 18px;
    display: block; 
    vertical-align: middle;
    /* The SVG uses fill="currentColor", so the parent's color property controls the fill. */
}

/* Ensure the input field takes up the full width below the toggle */
.ce-password-field-wrap input[type="text"],
.ce-password-field-wrap input[type="password"] {
    margin-bottom: 0; /* Clear margin from the input inside the wrapper */
}

.ce-password-requirements {
    font-size: 12px;
    margin-top: 0;
}