/**
 * Custom Login Forms Styles
 */

/* Form Wrapper */
.clf-form-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* Form Container */
.clf-form {
    margin: 0 auto;
}

/* Form Title */
.clf-form-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333333;
    text-align: center;
}

/* Form Description */
.clf-form-description {
    margin: 0 0 20px 0;
    color: #666666;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* Form Groups */
.clf-form-group {
    margin-bottom: 20px;
}

.clf-form-group:last-of-type {
    margin-bottom: 0;
}

/* Form Controls */
.clf-form-control,
.clf-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #333333;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.clf-form-control:focus,
.clf-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Form Labels */
.clf-form label,
.clf-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333333;
}

/* Forgot Password Link */
.clf-forgot-password {
    text-align: center;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.clf-forgot-password-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: inline-block;
}

.clf-forgot-password-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Elementor Editor Support */
.elementor-editor-active .clf-forgot-password {
    opacity: 1;
    visibility: visible;
}

/* Already Registered Link */
.clf-already-registered {
    text-align: center;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.clf-already-registered-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: inline-block;
}

.clf-already-registered-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Elementor Editor Support */
.elementor-editor-active .clf-already-registered {
    opacity: 1;
    visibility: visible;
}

/* Profile Picture Container - Centered */
.clf-profile-picture-container {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
}

/* Override Elementor specific styles */
.elementor-widget-clf-profile .clf-profile-picture-container,
[class*="elementor-element"] .clf-profile-picture-container {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto 20px auto !important;
}

.clf-profile-picture-wrapper {
    display: inline-block !important;
    margin: 0 auto !important;
    text-align: center !important;
}

/* Gravatar Info Centering */
.clf-gravatar-info-fullwidth {
    text-align: center !important;
    width: 100% !important;
    margin: 15px 0 !important;
}

.clf-gravatar-status {
    text-align: center !important;
    margin-bottom: 10px !important;
}

/* Alert Messages */
.clf-alert {
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.clf-alert.clf-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.clf-alert.clf-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.clf-alert.clf-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.clf-alert.clf-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* Minimalistic Icons - Same color as text */
.clf-alert .clf-icon-minimalistic {
    color: inherit !important;
    font-weight: bold;
    margin-right: 5px;
}

/* Email Change Info */
.clf-email-change-info {
    transition: all 0.3s ease;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.clf-email-change-info[style*="block"] {
    opacity: 1;
    max-height: 100px;
}

/* Login Form Specific Styles */
.clf-login-form {
    /* Inherit all base form styles and add login-specific customizations */
    position: relative;
}

.clf-login-form .clf-form-title {
    /* Login form specific title styling */
    text-align: center;
    margin-bottom: 20px;
}

.clf-login-form .clf-form-group {
    /* Login form specific field styling */
    margin-bottom: 20px;
}

.clf-login-form .clf-input {
    /* Login form specific input styling */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.clf-login-form .clf-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.clf-login-form .clf-login-btn {
    /* Login form specific button styling */
    width: 100%;
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clf-login-form .clf-login-btn:hover {
    background-color: #005a87;
}

.clf-login-form .clf-forgot-password {
    /* Login form specific forgot password link styling */
    text-align: center;
    margin-top: 15px;
}

/* Forgot Password Form Specific Styles */
.clf-forgot-password-form {
    /* Inherit all base form styles and add forgot-password-specific customizations */
    position: relative;
}

.clf-forgot-password-form .clf-form-title {
    /* Forgot password form specific title styling */
    text-align: center;
    margin-bottom: 20px;
}

.clf-forgot-password-form .clf-form-description {
    /* Forgot password form specific description styling */
    text-align: center;
    margin-bottom: 25px;
    color: #666;
    line-height: 1.5;
}

.clf-forgot-password-form .clf-form-group {
    /* Forgot password form specific field styling */
    margin-bottom: 20px;
}

.clf-forgot-password-form .clf-input {
    /* Forgot password form specific input styling */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.clf-forgot-password-form .clf-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.clf-forgot-password-form .clf-forgot-password-btn {
    /* Forgot password form specific button styling */
    width: 100%;
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clf-forgot-password-form .clf-forgot-password-btn:hover {
    background-color: #005a87;
}

/* Reset Password Form Specific Styles */
.clf-reset-password-form {
    /* Inherit all base form styles and add reset-password-specific customizations */
    position: relative;
}

.clf-reset-password-form .clf-form-title {
    /* Reset password form specific title styling */
    text-align: center;
    margin-bottom: 20px;
}

.clf-reset-password-form .clf-form-group {
    /* Reset password form specific field styling */
    margin-bottom: 20px;
}

.clf-reset-password-form .clf-input {
    /* Reset password form specific input styling */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.clf-reset-password-form .clf-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.clf-reset-password-form .clf-reset-password-btn {
    /* Reset password form specific button styling */
    width: 100%;
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clf-reset-password-form .clf-reset-password-btn:hover {
    background-color: #005a87;
}

/* Register Form Specific Styles */
.clf-register-form {
    /* Inherit all base form styles and add register-specific customizations */
    position: relative;
}

.clf-register-form .clf-form-title {
    /* Register form specific title styling */
    text-align: center;
    margin-bottom: 20px;
}

.clf-register-form .clf-form-group {
    /* Register form specific field styling */
    margin-bottom: 20px;
}

.clf-register-form .clf-input {
    /* Register form specific input styling */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.clf-register-form .clf-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.clf-register-form .clf-register-btn {
    /* Register form specific button styling */
    width: 100%;
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clf-register-form .clf-register-btn:hover {
    background-color: #005a87;
}

.clf-register-form .clf-already-registered {
    /* Register form specific link styling */
    text-align: center;
    margin-top: 15px;
}

/* Profile Form Specific Styles */
.clf-profile-form {
    /* Inherit all base form styles and add profile-specific customizations */
    max-width: 100%;
    margin: 0 auto;
}


.clf-profile-form .clf-form-title {
    /* Profile form specific title styling */
    text-align: center;
    margin-bottom: 20px;
}

.clf-profile-form .clf-form-group {
    /* Profile form specific field styling */
    margin-bottom: 20px;
}

.clf-profile-form .clf-input {
    /* Profile form specific input styling */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.clf-profile-form .clf-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.clf-profile-form .clf-profile-picture-container {
    /* Profile picture container styling */
    text-align: center;
    margin-bottom: 25px;
}

.clf-profile-form .clf-profile-picture {
    /* Profile picture styling */
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ddd;
    margin-bottom: 15px;
}

.clf-profile-form .clf-submit-btn {
    /* Profile form specific button styling */
    width: 100%;
    padding: 12px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clf-profile-form .clf-submit-btn:hover {
    background-color: #005a87;
}

.clf-profile-form .clf-logout-btn {
    /* Profile form specific logout button styling */
    background-color: #dc3545;
    margin-top: 15px;
}

.clf-profile-form .clf-logout-btn:hover {
    background-color: #c82333;
}

/* Gravatar Buttons Container */
.clf-gravatar-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Gravatar Buttons - Common Styling */
.clf-gravatar-buttons .clf-btn,
.clf-gravatar-buttons a,
.clf-gravatar-buttons button {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    min-width: 120px;
}

/* Primary Button (Gravatar.com) */
.clf-gravatar-buttons .clf-btn-primary {
    background-color: #0073aa;
    color: white;
}

.clf-gravatar-buttons .clf-btn-primary:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
}

/* Secondary Button (Upload) */
.clf-gravatar-buttons .clf-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.clf-gravatar-buttons .clf-btn-secondary:hover {
    background-color: #545b62;
    color: white;
}

/* Responsive Gravatar Buttons */
@media (max-width: 768px) {
    .clf-gravatar-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .clf-gravatar-buttons .clf-btn,
    .clf-gravatar-buttons a,
    .clf-gravatar-buttons button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .clf-gravatar-buttons .clf-btn,
    .clf-gravatar-buttons a,
    .clf-gravatar-buttons button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Form Row for Address Fields */
.clf-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.clf-form-row .clf-form-group {
    margin-bottom: 0;
}

/* Responsive Form Rows */
@media (max-width: 768px) {
    .clf-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .clf-form-row .clf-form-group {
        margin-bottom: 20px;
    }
}

/* Labels */
.clf-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333333;
    font-size: 14px;
}

/* Input Fields */
.clf-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #333333;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.clf-input:focus {
    outline: none;
    border-color: #007cba;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.clf-input::placeholder {
    color: #999999;
}

/* Submit Button */
.clf-submit-btn {
    width: 100%;
    padding: 12px 24px;
    background-color: #007cba;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

/* Logout Button (inherits all submit button styles) */
.clf-logout-btn {
    text-decoration: none !important;
}

.clf-submit-btn:hover {
    background-color: #005a87;
    transform: translateY(-1px);
}

.clf-submit-btn:active {
    transform: translateY(0);
}

.clf-submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.clf-submit-btn.loading {
    position: relative;
    color: transparent;
}

.clf-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: clf-spin 1s linear infinite;
}

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

/* Messages */
.clf-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.clf-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.clf-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.clf-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .clf-form {
        padding: 20px;
        margin: 0 15px;
    }
    
    .clf-form-title {
        font-size: 20px;
    }
    
    .clf-input,
    .clf-submit-btn {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .clf-form {
        padding: 15px;
        margin: 0 10px;
    }
    
    .clf-form-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .clf-form-group {
        margin-bottom: 15px;
    }
}

/* Accessibility */
.clf-input:focus,
.clf-submit-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .clf-form {
        border: 2px solid #000000;
    }
    
    .clf-input {
        border: 2px solid #000000;
    }
    
    .clf-submit-btn {
        border: 2px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .clf-input,
    .clf-submit-btn {
        transition: none;
    }
    
    .clf-submit-btn:hover {
        transform: none;
    }
    
    .clf-submit-btn.loading::after {
        animation: none;
    }
}


/* Login Widget Specific Styles */
.clf-login-widget {
    width: 100%;
}

/* Checkbox Styles */
.clf-checkbox-group {
    margin: 15px 0;
}

.clf-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
    user-select: none;
}

.clf-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.clf-checkbox:checked {
    background-color: #007cba;
    border-color: #007cba;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7.5 7.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6 10.293l7.146-7.147a.5.5 0 0 1 .708.708z'/%3e%3c/svg%3e");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.clf-checkbox:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.clf-checkbox-text {
    line-height: 1.4;
}

/* reCAPTCHA Styles */
.clf-recaptcha-group {
    margin: 20px 0;
    text-align: center;
    overflow: hidden; /* Prevents horizontal scroll on mobile */
    display: flex;
    justify-content: center;
    align-items: center;
}

.clf-recaptcha-group .g-recaptcha {
    display: inline-block;
    max-width: 100%;
    transition: transform 0.3s ease;
}

/* Responsive reCAPTCHA Container */
.clf-recaptcha-responsive {
    width: 100%;
    max-width: 304px; /* Standard reCAPTCHA width */
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.clf-recaptcha-placeholder {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
    color: #666666;
    font-style: italic;
    text-align: center;
}

/* Button Loading States */
.clf-btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
}

.clf-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: clf-spin 1s linear infinite;
    margin-right: 8px;
}

.clf-submit-btn.loading .clf-btn-text {
    display: none;
}

.clf-submit-btn.loading .clf-btn-loading {
    display: flex;
}

/* Form Messages */
.clf-form-messages {
    margin-bottom: 20px;
    display: none;
}

.clf-form-messages.success,
.clf-form-messages.error,
.clf-form-messages.info {
    display: block;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.clf-form-messages.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.clf-form-messages.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.clf-form-messages.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* Responsive Adjustments for Login Widget */
@media (max-width: 768px) {
    .clf-recaptcha-group {
        margin: 15px 0;
        padding: 0 10px;
    }
    
    .clf-recaptcha-group .g-recaptcha {
        transform: scale(0.95);
        transform-origin: center center;
    }
    
    .clf-recaptcha-responsive {
        max-width: 290px;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .clf-recaptcha-group {
        margin: 15px 0;
        padding: 0 15px;
    }
    
    .clf-recaptcha-group .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center center;
    }
    
    .clf-recaptcha-responsive {
        max-width: 260px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .clf-checkbox-label {
        font-size: 13px;
    }
    
    .clf-recaptcha-group {
        margin: 15px 0;
        padding: 0 20px;
    }
    
    .clf-recaptcha-group .g-recaptcha {
        transform: scale(0.75);
        transform-origin: center center;
    }
    
    .clf-recaptcha-responsive {
        max-width: 230px;
        justify-content: center;
    }
    
    .clf-recaptcha-placeholder {
        padding: 15px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .clf-recaptcha-group {
        margin: 15px 0;
        padding: 0 25px;
    }
    
    .clf-recaptcha-group .g-recaptcha {
        transform: scale(0.65);
        transform-origin: center center;
    }
    
    .clf-recaptcha-responsive {
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 320px) {
    .clf-recaptcha-group {
        margin: 15px 0;
        padding: 0 30px;
    }
    
    .clf-recaptcha-group .g-recaptcha {
        transform: scale(0.6);
        transform-origin: center center;
    }
    
    .clf-recaptcha-responsive {
        max-width: 185px;
        justify-content: center;
    }
}
