/* ========================================
   CHECKOUT FORM MODAL
   ======================================== */

.udc-checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.udc-checkout-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.udc-checkout-container {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.udc-checkout-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.udc-checkout-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.udc-checkout-header {
    padding: 40px 40px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.udc-checkout-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2d5f5d;
    margin: 0 0 10px;
}

.udc-checkout-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.udc-checkout-form {
    padding: 30px 40px 40px;
}

.udc-form-section {
    margin-bottom: 30px;
}

.udc-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.udc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.udc-form-group {
    display: flex;
    flex-direction: column;
}

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

.optional {
    font-weight: 400;
    color: #999;
    font-size: 13px;
}

.udc-form-group input[type="text"],
.udc-form-group input[type="email"],
.udc-form-group input[type="tel"] {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.udc-form-group input:focus {
    outline: none;
    border-color: #2d5f5d;
    box-shadow: 0 0 0 3px rgba(45, 95, 93, 0.1);
}

.udc-form-group small {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Payment Methods */
.udc-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.udc-payment-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.udc-payment-option:hover {
    border-color: #2d5f5d;
    background: rgba(45, 95, 93, 0.02);
}

.udc-payment-option.active {
    border-color: #2d5f5d;
    background: rgba(45, 95, 93, 0.05);
}

.udc-payment-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.payment-icon {
    font-size: 24px;
}

.payment-label {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.payment-powered {
    font-size: 12px;
    color: #999;
}

/* Stripe Elements */
.stripe-card-element {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
}

.stripe-card-element.StripeElement--focus {
    border-color: #2d5f5d;
    box-shadow: 0 0 0 3px rgba(45, 95, 93, 0.1);
}

.stripe-errors {
    color: #dc3232;
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

/* Checkout Summary */
.udc-checkout-summary {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
}

.udc-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
    color: #666;
}

.udc-summary-total {
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.udc-summary-note {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin: 15px 0 0;
}

/* Checkbox */
.udc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.udc-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.udc-checkbox-label a {
    color: #2d5f5d;
    text-decoration: underline;
}

/* Form Actions */
.udc-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.udc-btn-submit {
    flex: 1;
    padding: 16px 30px;
    background: #2d5f5d;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.udc-btn-submit:hover {
    background: #234847;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 95, 93, 0.3);
}

.udc-btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.udc-btn-submit .btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.udc-btn-cancel {
    padding: 16px 30px;
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.udc-btn-cancel:hover {
    border-color: #999;
    color: #333;
}

/* Security Notice */
.udc-security-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 13px;
    color: #999;
    margin-top: 20px;
}

.udc-security-notice svg {
    color: #46b450;
}

/* Responsive */
@media (max-width: 768px) {
    .udc-checkout-modal {
        padding: 0;
        align-items: flex-end;
    }

    .udc-checkout-container {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        width: 100%;
        max-width: none;
    }

    .udc-checkout-header {
        padding: 30px 20px 20px;
    }

    .udc-checkout-header h2 {
        font-size: 24px;
    }

    .udc-checkout-header p {
        font-size: 14px;
    }

    .udc-checkout-form {
        padding: 20px;
    }

    .udc-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .udc-form-group input[type="text"],
    .udc-form-group input[type="email"],
    .udc-form-group input[type="tel"] {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .udc-section-title {
        font-size: 16px;
    }

    .udc-payment-option {
        padding: 14px;
    }

    .stripe-card-element {
        padding: 14px 16px;
        font-size: 16px;
    }

    .udc-form-actions {
        flex-direction: column;
        gap: 12px;
    }

    .udc-btn-submit,
    .udc-btn-cancel {
        width: 100%;
        padding: 16px 20px;
    }

    .udc-checkout-close {
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .udc-checkout-header h2 {
        font-size: 22px;
    }

    .udc-section-title {
        font-size: 15px;
    }

    .payment-icon {
        font-size: 20px;
    }

    .payment-label {
        font-size: 14px;
    }
}