/**
 * IWS Payment Form Styles
 */

/* Progress Steps */
.form-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: #732445;
    color: #fff;
}

.progress-step.completed .step-number {
    background: #4caf50;
    color: #fff;
}

.progress-step.completed .step-number::after {
    content: '✓';
    position: absolute;
}

.step-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-align: center;
}

.progress-step.active .step-label {
    color: #732445;
}

.progress-line {
    width: 100px;
    height: 2px;
    background: #e0e0e0;
    margin: 0 10px;
    margin-bottom: 30px;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Payment Summary */
.payment-summary {
    background: #f8f3f5;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 4px solid #732445;
}

.payment-summary h4 {
    color: #732445;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 700;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: #732445;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 2px solid #732445;
}

/* Payment Section */
.payment-section {
    margin: 30px 0;
}

.payment-section h4 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
}

#payment-element {
    margin-bottom: 20px;
}

.payment-loading {
    text-align: center;
    padding: 40px;
    color: #732445;
    font-size: 16px;
}

#payment-errors {
    color: #df1b41;
    font-size: 14px;
    margin-top: 10px;
}

/* Form Buttons */
.form-buttons {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
}

.back-btn {
    background: #fff;
    color: #732445;
    border: 2px solid #732445;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 0 0 auto;
}

.back-btn:hover {
    background: #f8f3f5;
}

.submit-btn {
    flex: 1;
}

/* Pricing Section */
.iws-pricing-section {
    margin: 40px 0;
    padding: 40px 20px;
}

.iws-pricing-section h2 {
    text-align: center;
    color: #732445;
    font-size: 32px;
    margin-bottom: 30px;
    font-weight: 700;
}

.pricing-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-card {
    background: #fff;
    border: 2px solid #732445;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(115, 36, 69, 0.2);
}

.pricing-card h3 {
    color: #732445;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 700;
}

.package-description {
    color: #666;
    font-size: 16px;
    margin-bottom: 15px;
    min-height: 48px;
}

.package-price {
    color: #732445;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.pricing-btn {
    background: #732445;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.pricing-btn:hover {
    background: #5a1c35;
}

/* Payment Form */
.iws-payment-form-wrapper {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.iws-payment-form .form-title {
    color: #732445;
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.iws-payment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.iws-payment-form .form-group {
    margin-bottom: 20px;
}

.iws-payment-form .form-group.half {
    margin-bottom: 0;
}

.iws-payment-form label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.iws-payment-form .required {
    color: #732445;
}

.iws-payment-form input[type="text"],
.iws-payment-form input[type="email"],
.iws-payment-form select,
.iws-payment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.iws-payment-form input:focus,
.iws-payment-form select:focus,
.iws-payment-form textarea:focus {
    outline: none;
    border-color: #732445;
}

.iws-payment-form textarea {
    resize: vertical;
    min-height: 100px;
}

.package-summary {
    background: #f8f3f5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #732445;
}

.package-summary h4 {
    color: #732445;
    font-size: 18px;
    margin-bottom: 10px;
}

.package-summary p {
    color: #333;
    margin: 5px 0;
}

.submit-btn {
    width: 100%;
    background: #732445;
    color: #fff;
    border: none;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 20px;
}

.submit-btn:hover {
    background: #5a1c35;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-block;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

/* Modal Styles */
.iws-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.iws-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.iws-modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.iws-modal-close:hover,
.iws-modal-close:focus {
    color: #732445;
}

body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .iws-payment-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .pricing-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .iws-payment-form-wrapper {
        padding: 20px;
    }
    
    .iws-modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .form-progress {
        padding: 10px 0;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    .progress-line {
        width: 50px;
        margin: 0 5px;
        margin-bottom: 20px;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .back-btn,
    .submit-btn {
        width: 100%;
    }
    
    .summary-row {
        font-size: 14px;
    }
}

/* Stripe Element Custom Styling */
.StripeElement {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.StripeElement--focus {
    border-color: #732445;
}

.StripeElement--invalid {
    border-color: #df1b41;
}

/* Loading States */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loader::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
