/**
 * TAMER Purchase Forms Styling
 * "Select then Pay" layout with modal payment form
 */

/* ========================================
   Product Selection Cards
   ======================================== */

.tamer-product-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tamer-product-card:hover {
    border-color: #4a7c23;
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.15);
}

.tamer-product-card.selected {
    border-color: #2d5016;
    box-shadow: 0 4px 16px rgba(45, 80, 22, 0.25);
}

.product-header {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.product-header h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.product-price {
    font-size: 42px;
    font-weight: bold;
    line-height: 1;
}

.product-price .currency {
    font-size: 28px;
    vertical-align: top;
}

.product-description {
    padding: 20px;
}

.product-description p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 12px 0;
    font-size: 14px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 6px 0;
    color: #333;
    font-size: 14px;
}

/* Select Button */
.tamer-select-product-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 20px 20px;
    padding: 14px;
    background: #2d5016;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.tamer-select-product-btn:hover {
    background: #4a7c23;
    transform: translateY(-1px);
}

.tamer-product-card.selected .tamer-select-product-btn {
    background: #FF8C00;
}

/* ========================================
   Payment Modal Overlay
   ======================================== */

.tamer-payment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tamer-payment-modal {
    background: #ffffff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tamer-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 1;
}

.tamer-modal-close:hover {
    color: #333;
}

.tamer-modal-header {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c23 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
    border-radius: 12px 12px 0 0;
}

.tamer-modal-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: white;
}

.tamer-selected-product-name {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 5px 0;
}

.tamer-selected-product-price {
    font-size: 32px;
    font-weight: bold;
}

/* ========================================
   Payment Form (inside modal)
   ======================================== */

.tamer-payment-form {
    padding: 25px 30px;
}

.form-group {
    margin-bottom: 18px;
}

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

.tamer-terms-label {
    font-weight: 400 !important;
    font-size: 13px !important;
    color: #555 !important;
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
}

.tamer-terms-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 12px;
}

.form-control {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background: #fff;
    color: #333;
}

.form-control::placeholder {
    color: #aab7c4;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #4a7c23;
    box-shadow: 0 0 0 3px rgba(74, 124, 35, 0.1);
}

/* Stripe Card Element */
.stripe-card-element {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    min-height: 20px;
}

.stripe-card-element.StripeElement--focus {
    border-color: #4a7c23;
    box-shadow: 0 0 0 3px rgba(74, 124, 35, 0.1);
}

.stripe-card-element.StripeElement--invalid {
    border-color: #fa755a;
}

.card-errors,
#tamer-card-errors {
    color: #fa755a;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

/* Purchase Button */
.purchase-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2d5016 0%, #4a7c23 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 5px;
}

.purchase-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
}

.purchase-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   Purchase Result (inside modal)
   ======================================== */

.purchase-result {
    text-align: center;
    padding: 30px;
}

.result-success {
    color: #28a745;
}

.result-error {
    color: #dc3545;
}

.success-icon,
.error-icon {
    width: 70px;
    height: 70px;
    line-height: 70px;
    font-size: 40px;
    margin: 0 auto 15px;
    border-radius: 50%;
}

.success-icon {
    background: #d4edda;
    color: #28a745;
}

.error-icon {
    background: #f8d7da;
    color: #dc3545;
}

.purchase-result h4 {
    margin: 0 0 12px 0;
    font-size: 22px;
}

.purchase-result p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.assessment-id-display {
    color: #2d5016;
    font-weight: bold;
    font-size: 20px;
}

.purchase-result .button,
.purchase-result button {
    display: inline-block;
    padding: 12px 28px;
    margin-top: 15px;
    background: #2d5016;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.purchase-result .button:hover,
.purchase-result button:hover {
    background: #4a7c23;
}

/* Secure Badge */
.secure-payment-badge {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    color: #888;
    font-size: 13px;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .tamer-payment-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .tamer-payment-modal {
        max-height: calc(100vh - 60px);
    }

    .tamer-modal-header {
        padding: 20px;
    }

    .tamer-payment-form {
        padding: 20px;
    }

    .product-header h3 {
        font-size: 18px;
    }

    .product-price {
        font-size: 34px;
    }
}
