/**
 * Campaigner Authentication Form Styles
 */

/* Input field styling */
.campaigner-input-wrapper {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    max-width: 430px; /* Set a fixed max-width for all input wrappers */
    transition: all 0.3s ease;
}

.campaigner-input-field {
    width: 100%;
    padding: 10px 40px 10px 35px; /* Increased padding for better spacing */
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.campaigner-input-field:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.campaigner-input-field::placeholder {
    font-style: italic;
    color: #999;
    opacity: 0.8;
}

/* Consistent styling for input fields */
.campaigner-settings-form input[type="text"], 
.campaigner-settings-form input[type="password"] {
    width: 100%;
    padding: 10px 40px 10px 31px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.campaigner-settings-form input[type="text"]:focus, 
.campaigner-settings-form input[type="password"]:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Icon styling */
.campaigner-field-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.campaigner-input-field:focus ~ .campaigner-field-icon,
.campaigner-input-field:focus ~ .campaigner-info-icon {
    opacity: 1;
}

.user-icon {
    background-image: url('../images/icons/user-icon.svg');
}

.key-icon {
    background-image: url('../images/icons/key-icon.svg');
}

/* Toggle password visibility */
.campaigner-toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.campaigner-toggle-password:hover {
    opacity: 1;
}

/* Specific tooltip styling for toggle password */
.campaigner-toggle-password[data-tooltip]:hover:after {
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-top: 5px;
    width: auto;
    min-width: 60px;
    max-width: 120px;
    white-space: nowrap;
}

/* Arrow for toggle password tooltip */
.campaigner-toggle-password[data-tooltip]:hover:before {
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-left: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #333;
    border-top: none;
}

.eye-icon {
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('../images/icons/eye-icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
}

.eye-icon.hidden {
    background-image: url('../images/icons/eye-slash-icon.svg');
}

/* Info icon styling */
.campaigner-info-icon {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #555;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.campaigner-info-icon:hover {
    background-color: #0073aa;
    color: white;
}

/* Tooltip styling */
[data-tooltip]:hover:after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 10px 12px;
    border-radius: 4px;
    width: 250px;
    z-index: 9999;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-left: 10px;
    animation: fadeIn 0.3s ease;
}

[data-tooltip]:hover:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid #333;
    margin-left: 5px;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Instruction text */
.campaigner-instruction-text {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* Connect button styling */
#campemma_connect {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
    text-decoration: none;
    text-shadow: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#campemma_connect:hover {
    background-color: #0082c3;
    border-color: #0082c3;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#campemma_connect:disabled {
    background-color: #f7f7f7 !important;
    border-color: #ddd !important;
    color: #a0a5aa !important;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: default;
    opacity: 0.7;
    transform: none;
}

#campemma_connect.active {
    cursor: pointer;
    opacity: 1;
    transition: all 0.3s ease;
}

/* Terms of service styling */
.campaigner-terms-container {
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
}

.campaigner-terms-container input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.campaigner-terms-container label {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
}

/* Loader styling */
#campaigner-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error and success messages */
.campaigner-notice {
    margin: 20px 0;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

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

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

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .campaigner-input-wrapper {
        max-width: 100%;
    }
    
    [data-tooltip]:hover:after {
        width: 200px;
    }
}
