/*
 * Styles for the User Profile plugin form.
 *
 * We import the Montserrat font via the `wp_enqueue_style` call in PHP,
 * so there is no need to import it again here.  The stylesheet focuses
 * on layout, typography and visual cues such as the eye icons for
 * password fields.
 */

/*
 * Define CSS custom properties for label and button colours.  These
 * variables are overridden inline on the form element via the style
 * attribute in PHP.  Defaults here ensure that if the inline values
 * aren’t present (e.g. when the plugin is not initialised), the form
 * still looks acceptable.
 */
:root {
    --user-profile-label-color: #333333;
    --user-profile-button-bg-color: #007cba;
    --user-profile-button-text-color: #ffffff;
}

.user-profile-form {
    font-family: 'Montserrat', sans-serif;
    max-width: 600px;
    margin: 30px auto;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.user-profile-field {
    margin-bottom: 20px;
}

.user-profile-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--user-profile-label-color);
}

.user-profile-field input[type="text"],
.user-profile-field input[type="email"],
.user-profile-field input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 40px 10px 12px;
    font-size: 16px;
    line-height: 1.5;
    border: 1px solid #cccccc;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.user-profile-field input[type="text"]:focus,
.user-profile-field input[type="email"]:focus,
.user-profile-field input[type="password"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.user-profile-password-wrapper {
    position: relative;
}

.user-profile-password-wrapper input {
    padding-right: 44px;
}

.user-profile-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666666;
}

.user-profile-password-toggle:before {
    /* default eye (dashicons-visibility) */
    font-family: dashicons;
    content: "\f530";
    font-size: 20px;
    line-height: 1;
}

.user-profile-password-toggle.active:before {
    /* eye with slash (dashicons-hidden) */
    content: "\f531";
}

.user-profile-submit {
    text-align: right;
}

/* Style the submit button using the custom colour variables.  We
 * explicitly target the button within our plugin’s container to avoid
 * interfering with other buttons on the page. */
.user-profile-submit .button,
.user-profile-submit .button.button-primary {
    background-color: var(--user-profile-button-bg-color);
    border-color: var(--user-profile-button-bg-color);
    color: var(--user-profile-button-text-color);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.user-profile-submit .button:hover,
.user-profile-submit .button.button-primary:hover,
.user-profile-submit .button:focus,
.user-profile-submit .button.button-primary:focus {
    background-color: var(--user-profile-button-bg-color);
    border-color: var(--user-profile-button-bg-color);
    color: var(--user-profile-button-text-color);
    filter: brightness(0.95);
}

.user-profile-message {
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 15px;
}

.user-profile-message.notice-success {
    background-color: #e7f7ed;
    border: 1px solid #c3e6cb;
    color: #256029;
}

.user-profile-message.notice-error {
    background-color: #fdecea;
    border: 1px solid #f5c6cb;
    color: #a1121a;
}