/* Custom Payment Form Styles */

.cpf-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cpf-width-full .cpf-form {
    max-width: 100%;
}

.cpf-width-custom .cpf-form {
    /* Width will be controlled by Elementor custom width setting */
    max-width: none;
}

.cpf-form-title {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.cpf-field {
    margin-bottom: 25px;
    position: relative;
}

.cpf-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
    line-height: 1.4;
}

.cpf-field .required {
    color: #e74c3c;
    font-weight: bold;
}

.cpf-field input,
.cpf-field textarea,
.cpf-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    color: #495057;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cpf-field input:focus,
.cpf-field textarea:focus,
.cpf-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.cpf-field input.error,
.cpf-field textarea.error,
.cpf-field select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.cpf-field-error {
    display: none;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
}

.cpf-payment-description {
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.cpf-payment-description small {
    display: block;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #17a2b8;
}

.cpf-submit-field {
    margin-top: 35px;
    margin-bottom: 20px;
}

.cpf-pay-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.cpf-pay-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1a5490 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.cpf-pay-btn:active {
    transform: translateY(0);
}

.cpf-pay-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cpf-pay-btn:disabled:hover {
    background: #95a5a6;
    transform: none;
}

.cpf-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: cpf-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes cpf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cpf-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
    animation: cpf-fadeIn 0.3s ease;
}

@keyframes cpf-fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cpf-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
}

.cpf-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

.cpf-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
}

.cpf-error {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

/* Field Focus Animation */
.cpf-field.focused label {
    color: #3498db;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cpf-form {
        margin: 10px;
        padding: 20px;
        border-radius: 6px;
    }
    
    .cpf-form-title {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .cpf-field {
        margin-bottom: 20px;
    }
    
    .cpf-field input,
    .cpf-field textarea,
    .cpf-field select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .cpf-pay-btn {
        padding: 18px 24px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .cpf-form {
        margin: 5px;
        padding: 15px;
    }
    
    .cpf-field input,
    .cpf-field textarea,
    .cpf-field select {
        padding: 12px 14px;
    }
    
    .cpf-pay-btn {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .cpf-form {
        border: 2px solid #000;
    }
    
    .cpf-field input,
    .cpf-field textarea,
    .cpf-field select {
        border: 2px solid #000;
    }
    
    .cpf-pay-btn {
        background: #000;
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .cpf-field input,
    .cpf-field textarea,
    .cpf-field select,
    .cpf-pay-btn,
    .cpf-field.focused label,
    .cpf-message {
        transition: none;
        animation: none;
        transform: none;
    }
    
    .cpf-loading {
        animation: none;
        border: 2px solid currentColor;
        border-radius: 0;
    }
}

/* Print Styles */
@media print {
    .cpf-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cpf-pay-btn {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    .cpf-message,
    .cpf-loading {
        display: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cpf-form {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .cpf-form-title {
        color: #ecf0f1;
    }
    
    .cpf-field label {
        color: #bdc3c7;
    }
    
    .cpf-field input,
    .cpf-field textarea,
    .cpf-field select {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .cpf-field input:focus,
    .cpf-field textarea:focus,
    .cpf-field select:focus {
        border-color: #3498db;
        background: #3a526b;
    }
    
    .cpf-payment-description small {
        background: #34495e;
        color: #bdc3c7;
        border-left-color: #3498db;
    }
}

/* Accessibility Enhancements */
.cpf-field input:invalid,
.cpf-field textarea:invalid,
.cpf-field select:invalid {
    box-shadow: none; /* Remove browser default invalid styling */
}

.cpf-field input:focus:invalid,
.cpf-field textarea:focus:invalid,
.cpf-field select:focus:invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Screen Reader Only Content */
.cpf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Visible Support for Better Keyboard Navigation */
.cpf-pay-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.cpf-field input:focus-visible,
.cpf-field textarea:focus-visible,
.cpf-field select:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 1px;
}

/* Loading State for Entire Form */
.cpf-form.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.cpf-form.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Hover Effects for Interactive Elements */
.cpf-field input:hover:not(:disabled),
.cpf-field textarea:hover:not(:disabled),
.cpf-field select:hover:not(:disabled) {
    border-color: #bdc3c7;
}

/* Success State Animation */
.cpf-field.success input,
.cpf-field.success textarea,
.cpf-field.success select {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Custom Select Dropdown Styling */
.cpf-field select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23495057"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.cpf-field select::-ms-expand {
    display: none;
}

/* Placeholder Styling */
.cpf-field input::placeholder,
.cpf-field textarea::placeholder {
    color: #95a5a6;
    opacity: 1;
}

/* Form Validation States */
.cpf-field.has-error input,
.cpf-field.has-error textarea,
.cpf-field.has-error select {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.cpf-field.has-success input,
.cpf-field.has-success textarea,
.cpf-field.has-success select {
    border-color: #27ae60;
    background-color: #f2fdf5;
}