/**
 * Accore PMPro Custom Frontend Styles
 * 
 * This file overrides default PMPro frontend styles
 * Placed in theme's paid-memberships-pro/css/ folder
 *
 * @package Accore
 * @since 1.0.0
 */

/* Reset default PMPro card/box styling when using custom template */
.accore-pmpro-checkout-wrapper .pmpro .pmpro_card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.accore-pmpro-checkout-wrapper .pmpro .pmpro_card_content {
    padding: 0;
}

/* Hide default PMPro level cost display in checkout (we show it in sidebar) */
.accore-pmpro-checkout-wrapper #pmpro_level_cost,
.accore-pmpro-checkout-wrapper .pmpro_checkout_level_cost {
    display: none;
}

/* Style PMPro error fields */
.accore-pmpro-checkout-wrapper .pmpro_error,
.accore-pmpro-checkout-wrapper .accore-pmpro-input.pmpro_error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Style PMPro required indicator */
.accore-pmpro-checkout-wrapper .pmpro_asterisk {
    color: #ef4444;
}

/* Loading state for submit button */
.accore-pmpro-checkout-wrapper #pmpro_btn-submit.pmpro_processing,
.accore-pmpro-checkout-wrapper #pmpro_btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* Custom spinner for loading state */
.accore-pmpro-checkout-wrapper #pmpro_btn-submit.pmpro_processing::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pmpro-spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes pmpro-spin {
    to {
        transform: rotate(360deg);
    }
}

/* PMPro checkout boxes additional styling */
.accore-pmpro-checkout-wrapper .pmpro_checkout-fields {
    margin-bottom: 20px;
}

/* Style for PayPal Express button container */
.accore-pmpro-checkout-wrapper #pmpro_paypalexpress_checkout {
    margin-top: 16px;
    text-align: center;
}

/* Stripe Elements styling */
.accore-pmpro-checkout-wrapper .StripeElement {
    height: 50px;
    padding: 15px 20px;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accore-pmpro-checkout-wrapper .StripeElement--focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(32, 128, 141, 0.1);
}

.accore-pmpro-checkout-wrapper .StripeElement--invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* PMPro recaptcha styling */
.accore-pmpro-checkout-wrapper .pmpro_captcha {
    margin-top: 20px;
}

/* PMPro custom fields addons styling */
.accore-pmpro-checkout-wrapper .pmpro_userfields {
    margin-top: 20px;
}

.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield {
    margin-bottom: 20px;
}

.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield label {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    color: #13343b;
    letter-spacing: 0.08px;
    display: block;
    margin-bottom: 8px;
}

.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield input[type="text"],
.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield input[type="email"],
.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield input[type="tel"],
.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield input[type="url"],
.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield textarea,
.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield select {
    width: 100%;
    height: 50px;
    padding: 15px 20px;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #13343b;
    letter-spacing: 0.08px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield textarea {
    height: auto;
    min-height: 100px;
}

.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield input:focus,
.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield textarea:focus,
.accore-pmpro-checkout-wrapper .pmpro_userfields .pmpro_userfield select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(32, 128, 141, 0.1);
}

/* ==========================================================================
   PMPRO CONFIRMATION PAGE STYLES
   ========================================================================== */

.accore-pmpro-confirmation-wrapper {
    width: 100%;
    min-height: calc(100vh - 200px);
    background-color: #fcfcf9;
    padding: 60px 20px;
}

.accore-pmpro-confirmation-wrapper .pmpro {
    max-width: 700px;
    margin: 0 auto;
}

/* Override default PMPro styles */
.accore-pmpro-confirmation-wrapper .pmpro_section,
.accore-pmpro-confirmation-wrapper .pmpro_card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.accore-pmpro-confirmation-wrapper .pmpro_card_content,
.accore-pmpro-confirmation-wrapper .pmpro_card_title {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Hide default PMPro heading/avatar styles */
.accore-pmpro-confirmation-wrapper .pmpro_heading-with-avatar,
.accore-pmpro-confirmation-wrapper .pmpro_list,
.accore-pmpro-confirmation-wrapper .pmpro_list_item,
.accore-pmpro-confirmation-wrapper .pmpro_actions_nav {
    display: none !important;
}

.accore-pmpro-confirmation {
    text-align: center;
}

/* Success Header */
.accore-pmpro-confirmation__header {
    margin-bottom: 40px;
}

.accore-pmpro-confirmation__icon {
    margin-bottom: 24px;
}

.accore-pmpro-confirmation__title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 36px;
    color: #13343b;
    margin: 0 0 12px 0;
}

.accore-pmpro-confirmation__subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: rgba(9, 23, 23, 0.6);
    margin: 0;
}

.accore-pmpro-confirmation__subtitle strong {
    color: #13343b;
    font-weight: 600;
}

/* Order Details Card */
.accore-pmpro-confirmation__card {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 20px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.accore-pmpro-confirmation__card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 28px;
    color: #13343b;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(19, 52, 59, 0.1);
}

.accore-pmpro-confirmation__details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accore-pmpro-confirmation__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accore-pmpro-confirmation__label {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 24px;
    color: rgba(9, 23, 23, 0.6);
}

.accore-pmpro-confirmation__value {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    color: #13343b;
}

.accore-pmpro-confirmation__row--total .accore-pmpro-confirmation__label,
.accore-pmpro-confirmation__row--total .accore-pmpro-confirmation__value {
    font-size: 16px;
    font-weight: 700;
    color: #13343b;
}

.accore-pmpro-confirmation__divider {
    border: none;
    height: 1px;
    background-color: rgba(19, 52, 59, 0.1);
    margin: 8px 0;
}

.accore-pmpro-confirmation__notice {
    background-color: rgba(32, 128, 141, 0.08);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.accore-pmpro-confirmation__notice p {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 22px;
    color: #13343b;
    margin: 0;
}

.accore-pmpro-confirmation__address p {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 24px;
    color: #13343b;
    margin: 0;
}

/* Actions */
.accore-pmpro-confirmation__actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

/* Button Base Styles */
.accore-pmpro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.accore-pmpro-btn--primary {
    background-color: #b17f24;
    color: #fff;
}

.accore-pmpro-btn--primary:hover {
    background-color: #9a6e1f;
    color: #fff;
}

.accore-pmpro-btn__arrow {
    font-size: 16px;
}

.accore-pmpro-btn--outline {
    background-color: transparent;
    border: 2px solid #13343b;
    color: #13343b;
}

.accore-pmpro-btn--outline:hover {
    background-color: #13343b;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .accore-pmpro-confirmation-wrapper {
        padding: 40px 16px;
    }
    
    .accore-pmpro-confirmation__title {
        font-size: 22px;
        line-height: 30px;
    }
    
    .accore-pmpro-confirmation__card {
        padding: 20px;
    }
    
    .accore-pmpro-confirmation__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .accore-pmpro-confirmation__actions {
        flex-direction: column;
    }
    
    .accore-pmpro-confirmation__actions .accore-pmpro-btn {
        width: 100%;
    }
}

/* ==========================================================================
   FREE PLAN CHECKOUT STYLES
   ========================================================================== */

.accore-pmpro-free-plan {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(32, 128, 141, 0.04) 0%, rgba(32, 128, 141, 0.02) 100%);
    border-radius: 16px;
    margin: 20px 0;
}

.accore-pmpro-free-plan__icon {
    margin-bottom: 20px;
}

.accore-pmpro-free-plan__icon svg {
    display: inline-block;
}

.accore-pmpro-free-plan__title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 32px;
    color: #13343b;
    margin: 0 0 16px 0;
}

.accore-pmpro-free-plan__description {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 26px;
    color: rgba(19, 52, 59, 0.7);
    margin: 0 0 28px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.accore-pmpro-free-plan__benefits {
    background: #fff;
    border-radius: 12px;
    padding: 24px 32px;
    display: inline-block;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.accore-pmpro-free-plan__benefits-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #13343b;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accore-pmpro-free-plan__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accore-pmpro-free-plan__list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 24px;
    color: #13343b;
}

.accore-pmpro-free-plan__list li svg {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .accore-pmpro-free-plan {
        padding: 30px 16px;
    }
    
    .accore-pmpro-free-plan__title {
        font-size: 20px;
        line-height: 28px;
    }
    
    .accore-pmpro-free-plan__description {
        font-size: 14px;
        line-height: 22px;
    }
    
    .accore-pmpro-free-plan__benefits {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Logged-in user info styling */
.accore-pmpro-logged-in {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.accore-pmpro-logged-in p {
    margin: 0 0 8px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 24px;
    color: #13343b;
}

.accore-pmpro-logged-in p:last-child {
    margin-bottom: 0;
}

.accore-pmpro-logged-in__email {
    color: rgba(19, 52, 59, 0.6);
}

.accore-pmpro-logged-in__note {
    color: rgba(19, 52, 59, 0.7);
    font-size: 14px !important;
}

.accore-pmpro-logged-in__actions {
    margin-top: 12px !important;
}

.accore-pmpro-logged-in__actions a {
    color: var(--color-primary, #20808d);
    text-decoration: none;
    font-weight: 500;
}

.accore-pmpro-logged-in__actions a:hover {
    text-decoration: underline;
}
