/* Custom Newsletter Form Styles */

.cnf-newsletter-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

.cnf-form-title {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.3;
}

.cnf-newsletter-form {
    width: 100%;
}

.cnf-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.cnf-form-group {
    margin-bottom: 20px;
    position: relative;
}

.cnf-form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.cnf-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
    font-size: 14px;
    line-height: 1.4;
}

.cnf-required {
    color: #e74c3c;
    font-weight: bold;
}

.cnf-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
}

.cnf-form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #fbfcfd;
}

.cnf-form-control:hover {
    border-color: #bdc3c7;
}

.cnf-form-control.cnf-error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.cnf-form-control.cnf-error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.cnf-field-note {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.cnf-error-message {
    display: block;
    margin-top: 8px;
    color: #e74c3c;
    font-size: 13px;
    font-weight: 500;
    background-color: #fdf2f2;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

/* Checkbox Styling */
.cnf-checkbox-group {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.cnf-checkbox-label {
    display: block;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 0;
    position: relative;
    padding-left: 35px;
    color: #2c3e50;
}

.cnf-checkbox {
    position: absolute !important;
    left: 0 !important;
    top: 2px !important;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    opacity: 1 !important;
    z-index: 1;
    cursor: pointer;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: checkbox;
}

/* Fallback styling for better visibility */
.cnf-checkbox:not(:checked) {
    background-color: #ffffff;
    border: 2px solid #3498db;
    border-radius: 3px;
}

.cnf-checkbox:checked {
    background-color: #27ae60;
    border: 2px solid #27ae60;
}

.cnf-checkbox:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.cnf-checkbox-label:hover {
    color: #34495e;
}

.cnf-checkbox.cnf-error {
    border-color: #e74c3c !important;
    background-color: #fdf2f2 !important;
}

/* Submit Button */
.cnf-submit-button {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cnf-submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(41, 128, 185, 0.3);
}

.cnf-submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.cnf-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.cnf-loading-spinner {
    display: inline-block;
}

.cnf-loading-spinner svg {
    animation: cnf-spin 1s linear infinite;
}

@keyframes cnf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Messages */
.cnf-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

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

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

/* Form State Classes */
.cnf-form-group.cnf-focused label {
    color: #3498db;
}

.cnf-form-group.cnf-filled label {
    color: #27ae60;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cnf-newsletter-form-wrapper {
        margin: 20px;
        padding: 25px 20px;
    }
    
    .cnf-form-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .cnf-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .cnf-form-group-half {
        margin-bottom: 20px;
    }
    
    .cnf-form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .cnf-newsletter-form-wrapper {
        margin: 10px;
        padding: 20px 15px;
    }
    
    .cnf-checkbox-label {
        font-size: 13px;
    }
    
    .cnf-submit-button {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .cnf-form-control {
        border-width: 3px;
    }
    
    .cnf-submit-button {
        background: #000000;
        border: 2px solid #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .cnf-form-control,
    .cnf-submit-button,
    .cnf-checkmark,
    .cnf-loading-spinner svg {
        transition: none;
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cnf-newsletter-form-wrapper {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .cnf-form-title {
        color: #ecf0f1;
    }
    
    .cnf-form-group label {
        color: #bdc3c7;
    }
    
    .cnf-form-control {
        background-color: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .cnf-form-control:focus {
        background-color: #3a526b;
        border-color: #5dade2;
    }
    
    .cnf-checkmark {
        background-color: #34495e;
        border-color: #4a5f7a;
    }
    
    .cnf-field-note {
        color: #95a5a6;
    }
}

/* Print Styles */
@media print {
    .cnf-newsletter-form-wrapper {
        box-shadow: none;
        border: 1px solid #000000;
    }
    
    .cnf-submit-button,
    .cnf-message {
        display: none;
    }
}