/**
 * PAAY 3DS Checkout Styles
 */

.paay-checkout-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.paay-checkout-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.paay-checkout-container h2 {
    margin-top: 0;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
    text-align: center;
}

.paay-checkout-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #555;
    font-size: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
}

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

.form-group {
    flex: 1;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input.error {
    border-color: #f44336;
}

.form-group input.error:focus {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

/* Order Summary */
.order-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #333;
    font-size: 18px;
}

.price {
    color: #4CAF50;
    font-weight: 600;
}

/* Submit Button */
.paay-submit-button {
    width: 100%;
    padding: 16px 32px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    position: relative;
}

.paay-submit-button:hover {
    background: #45a049;
}

.paay-submit-button:active {
    transform: scale(0.98);
}

.paay-submit-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.paay-submit-button .button-loader {
    display: inline-block;
}

/* Security Badges */
.security-badges {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.security-badges p {
    margin: 5px 0;
    color: #666;
}

.security-badges .small-text {
    font-size: 12px;
    color: #999;
}

/* Messages/Alerts */
#paay-messages {
    margin-bottom: 20px;
}

.paay-alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.paay-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

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

.close-alert {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.close-alert:hover {
    opacity: 1;
}

/* Challenge iframe */
#threeds-challenge-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.challenge-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.challenge-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    height: 600px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#threeds-challenge-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .paay-checkout-container {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .paay-checkout-container h2 {
        font-size: 24px;
    }
    
    .paay-checkout-container h3 {
        font-size: 18px;
    }
    
    .challenge-content {
        width: 95%;
        height: 500px;
    }
}

@media (max-width: 480px) {
    .paay-checkout-wrapper {
        padding: 0 10px;
    }
    
    .paay-checkout-container {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 14px;
    }
    
    .paay-submit-button {
        font-size: 16px;
        padding: 14px 24px;
    }
}

/* Loading animation */
.button-loader::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Input field states */
input:invalid {
    box-shadow: none;
}

input:required:valid {
    border-color: #4CAF50;
}

/* Accessibility */
.paay-checkout-container *:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .paay-submit-button,
    .security-badges,
    #paay-messages {
        display: none;
    }
}