/* ==========================================================================
   PMPro Checkout Page - Premium Conversion-Optimized Design
   ========================================================================== */

/* 
   Checkout Page Design Strategy:
   - Clean, trustworthy layout that reduces checkout anxiety
   - Clear visual hierarchy with progress indicators
   - Brand-consistent styling with subtle pattern integration
   - Mobile-first responsive design
   - Trust indicators and security badges
   - Smooth micro-interactions to guide users
*/

/* Target only checkout pages specifically */
body.page-template-checkout #pmpro_level-0,
body.single-checkout #pmpro_level-0,
div[id*="pmpro_level-"] {
 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
    background-color: rgba(248, 250, 252, 0.97);
    padding: 2rem;
    border-radius: 1.5rem;
    font-family: 'Lexend', sans-serif;
    position: relative;
    margin: 2rem auto;
    max-width: 900px;
}

/* Subtle pattern overlay */
body.page-template-checkout #pmpro_level-0::before,
body.single-checkout #pmpro_level-0::before,
div[id*="pmpro_level-"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 0);
    background-size: 30px 30px;
    opacity: 0.2;
    border-radius: 1.5rem;
    pointer-events: none;
    z-index: 1;
}

/* Ensure content appears above pattern */
#pmpro_form {
    position: relative;
    z-index: 2;
}

/* Progress indicator at top */
#pmpro_form::before {
    content: '';
    display: block;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #ff5e00 0%, #ff5e00 33%, #e5e7eb 33%, #e5e7eb 100%);
    border-radius: 3px;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header section with trust indicators */
.pmpro_checkout_header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pmpro_checkout_title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.pmpro_checkout_subtitle {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.pmpro_trust_indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pmpro_trust_badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
    font-size: 0.875rem;
    font-weight: 500;
}

.pmpro_trust_badge::before {
    content: "🔒";
    font-size: 1rem;
}

/* Card styling improvements */
.pmpro_card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.pmpro_card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Card headers */
.pmpro_card_title,
.pmpro_form_heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 1rem;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pmpro_card_title::before,
.pmpro_form_heading::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: linear-gradient(135deg, #ff5e00, #ff7b32);
    border-radius: 2px;
}

/* Membership information card special styling */
#pmpro_pricing_fields {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    
    background-size: cover;
    background-blend-mode: overlay;
    color: white;
    position: relative;
    overflow: hidden;
}

#pmpro_pricing_fields::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 25px 25px;
    opacity: 0.3;
    pointer-events: none;
}

#pmpro_pricing_fields .pmpro_card_title,
#pmpro_pricing_fields .pmpro_form_heading {
/*     color: white; */
    position: relative;
    z-index: 2;
}

#pmpro_pricing_fields .pmpro_card_title::before,
#pmpro_pricing_fields .pmpro_form_heading::before {
    background: linear-gradient(135deg, #ffd700, #ff5e00);
}

#pmpro_pricing_fields .pmpro_card_content {
    position: relative;
    z-index: 2;
}

#pmpro_pricing_fields p,
#pmpro_pricing_fields .pmpro_level_cost_text {
    color: rgba(255, 255, 255, 0.9);
}

#pmpro_pricing_fields strong {
    color: #ffd700;
}

/* Form field improvements */
.pmpro_form_field {
    margin-bottom: 1.5rem;
}

.pmpro_form_label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.pmpro_form_input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Lexend', sans-serif;
}

.pmpro_form_input:focus {
    outline: none;
    border-color: #ff5e00;
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.1);
    transform: translateY(-1px);
}

.pmpro_form_input:valid {
    border-color: #10b981;
}

/* Password field enhancements */
.pmpro_form_field-password {
    position: relative;
}

/* Default: Attached to field style */
.pmpro_form_field-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pmpro_form_field-password-toggle:hover {
    color: #ff5e00;
    background: #fff5f0;
    border-color: #ff5e00;
    transform: translateY(-50%) scale(1.05);
}

.pmpro_form_field-password-toggle:focus {
    outline: 2px solid #ff5e00;
    outline-offset: 2px;
}

/* Password input padding to make room for toggle */
.pmpro_form_field-password .pmpro_form_input-password {
    padding-right: 2.5rem !important;
}

/* Hide the text and only show icon */
.pmpro_form_field-password-toggle-state {
    display: none !important;
}

/* Style the button element */
.pmpro_btn-password-toggle {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pmpro_btn-password-toggle .pmpro_icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pmpro_btn-password-toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Mobile: Make it slightly smaller */
@media (max-width: 768px) {
    .pmpro_form_field-password-toggle {
        width: 1.5rem;
        height: 1.5rem;
        right: 0.375rem;
        border-radius: 0.25rem;
    }
    
    .pmpro_form_field-password .pmpro_form_input-password {
        padding-right: 2.25rem !important;
    }
    
    .pmpro_btn-password-toggle svg {
        width: 14px;
        height: 14px;
    }
}

/* Two-column layout for related fields */
.pmpro_cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Inline fields (like expiration date) */
.pmpro_form_fields-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pmpro_form_fields-inline select {
    flex: 1;
}

/* Button styling */
.pmpro_btn {
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Lexend', sans-serif;
    display: inline-block;
}

.pmpro_btn-submit-checkout {
    background: linear-gradient(135deg, #ff5e00, #ff7b32);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 94, 0, 0.3);
    font-size: 1.125rem;
    padding: 1rem 2rem;
    width: 100%;
    margin-top: 1rem;
}

.pmpro_btn-submit-checkout:hover {
    background: linear-gradient(135deg, #e55300, #ff5e00);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 94, 0, 0.4);
}

.pmpro_btn-submit-checkout:active {
    transform: translateY(0);
}

/* Discount code buttons */
.pmpro_btn-submit-discount-code {
    background: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.pmpro_btn-submit-discount-code:hover {
    background: #4b5563;
}

/* Card actions (login links, etc.) */
.pmpro_card_actions {
    background: rgba(249, 250, 251, 0.8);
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.pmpro_card_actions a {
    color: #ff5e00;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.pmpro_card_actions a:hover {
    color: #e55300;
    text-decoration: underline;
}

/* Security badge for payment section */
#pmpro_payment_information_fields .pmpro_form_heading::after {
    content: "🔒 Secure";
    font-size: 0.75rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    margin-left: auto;
    font-weight: 500;
}

/* Processing message styling */
#pmpro_processing_message {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    margin-top: 1rem;
}

/* Message styling */
.pmpro_message {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pmpro_message.pmpro_success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.pmpro_message.pmpro_error {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* Discount code styling */
.pmpro_tag-discount-code {
    background: #ff5e00;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Hidden fields for discount codes */
#other_discount_code_fields {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    border: 1px dashed #d1d5db;
}

/* Form submit section */
.pmpro_form_submit {
    margin-top: 2rem;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1rem;
    text-align: center;
    border: 2px dashed rgba(16, 185, 129, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    body.page-template-checkout #pmpro_level-0,
    body.single-checkout #pmpro_level-0,
    div[id*="pmpro_level-"] {
        padding: 1rem;
        margin: 1rem;
        border-radius: 1rem;
    }
    
    .pmpro_checkout_title {
        font-size: 1.5rem;
    }
    
    .pmpro_cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .pmpro_trust_indicators {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pmpro_form_fields-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pmpro_btn-submit-checkout {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

/* Loading state for submit button */
.pmpro_btn-submit-checkout[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.pmpro_btn-submit-checkout[disabled]::after {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.pmpro_form_input:focus-visible {
    outline: 2px solid #ff5e00;
    outline-offset: 2px;
}

/* Trust indicators icons */
.pmpro_trust_badge.ssl::before {
    content: "🔒";
}

.pmpro_trust_badge.money-back::before {
    content: "💰";
}

.pmpro_trust_badge.support::before {
    content: "💬";
}

/* Card number field styling */
#AccountNumber {
    letter-spacing: 0.1em;
    font-family: 'Courier New', monospace;
}

/* Add subtle animations */
.pmpro_card {
    animation: fadeInUp 0.6s ease-out;
}

.pmpro_card:nth-child(2) {
    animation-delay: 0.1s;
}

.pmpro_card:nth-child(3) {
    animation-delay: 0.2s;
}

.pmpro_card:nth-child(4) {
    animation-delay: 0.3s;
}

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

/* Success indicators for completed fields */
.pmpro_form_input.completed {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310b981'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
}