/* Payment Checkout Module - BEM Methodology */
.payment-checkout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.payment-checkout--active {
    opacity: 1;
    visibility: visible;
}

.payment-checkout__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.payment-checkout__modal {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.payment-checkout--active .payment-checkout__modal {
    transform: scale(1) translateY(0);
}

.payment-checkout__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.payment-checkout__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.payment-checkout__close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-checkout__close:hover {
    background: #f3f4f6;
    color: #374151;
}

.payment-checkout__content {
    padding: 0 2rem 2rem;
}

.payment-checkout__step {
    display: none;
}

.payment-checkout__step--active {
    display: block;
}

/* Plan Summary */
.payment-checkout__plan-summary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.payment-checkout__plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}

.payment-checkout__plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.payment-checkout__currency {
    font-size: 1.5rem;
    font-weight: 600;
}

.payment-checkout__amount {
    font-size: 3rem;
    font-weight: 700;
}

.payment-checkout__plan-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
}

.payment-checkout__feature {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Form Sections */
.payment-checkout__section {
    margin-bottom: 2rem;
}

.payment-checkout__section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.payment-checkout__field {
    margin-bottom: 1rem;
}

.payment-checkout__field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.payment-checkout__label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.payment-checkout__input,
.payment-checkout__select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
}

.payment-checkout__input:focus,
.payment-checkout__select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.payment-checkout__input::placeholder {
    color: #9ca3af;
}

/* Custom Select Styling */
.payment-checkout__select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Terms and Conditions */
.payment-checkout__terms {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.payment-checkout__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #374151;
    cursor: pointer;
    position: relative;
    min-height: 24px;
}

.payment-checkout__checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.payment-checkout__checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 1px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-checkout__checkbox:checked + .payment-checkout__checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.payment-checkout__checkbox:checked + .payment-checkout__checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.payment-checkout__checkbox:focus + .payment-checkout__checkmark {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.payment-checkout__terms-text {
    flex: 1;
    line-height: 1.6;
}

.payment-checkout__terms a {
    color: #3b82f6;
    text-decoration: underline;
}

.payment-checkout__terms a:hover {
    color: #1d4ed8;
}

/* Submit Section */
.payment-checkout__submit-section {
    margin-top: 2rem;
    text-align: center;
}

.payment-checkout__submit-btn {
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 60px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.payment-checkout__submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.payment-checkout__submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.payment-checkout__btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.payment-checkout__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.payment-checkout__security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.payment-checkout__lock-icon {
    font-size: 1rem;
}

/* Success Step */
.payment-checkout__success {
    text-align: center;
    padding: 2rem 0;
}

.payment-checkout__success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.payment-checkout__success-title {
    font-size: 2rem;
    font-weight: 700;
    color: #10b981;
    margin: 0 0 1rem 0;
}

.payment-checkout__success-message {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0 0 2rem 0;
}

.payment-checkout__account-details {
    background: #f9fafb;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: left;
}

.payment-checkout__account-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
}

.payment-checkout__account-info {
    margin-bottom: 2rem;
}

.payment-checkout__account-field {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.payment-checkout__account-field code {
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.payment-checkout__next-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
}

.payment-checkout__steps-list {
    padding-left: 1.5rem;
    color: #6b7280;
}

.payment-checkout__steps-list li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.payment-checkout__action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.payment-checkout__login-btn {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    color: white;
    text-decoration: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-block;
}

.payment-checkout__login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.payment-checkout__close-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-checkout__close-btn:hover {
    background: #374151;
}

/* Form Validation */
.payment-checkout__input:invalid {
    border-color: #ef4444;
}

.payment-checkout__input:invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Card Input Formatting */
.payment-checkout__input[name="card_number"] {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    letter-spacing: 0.05em;
}

.payment-checkout__input[name="card_expiry"],
.payment-checkout__input[name="card_cvc"] {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .payment-checkout__modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .payment-checkout__header {
        padding: 1.5rem 1.5rem 0;
    }
    
    .payment-checkout__content {
        padding: 0 1.5rem 1.5rem;
    }
    
    .payment-checkout__plan-summary {
        padding: 1.5rem;
    }
    
    .payment-checkout__amount {
        font-size: 2.5rem;
    }
    
    .payment-checkout__field-group {
        grid-template-columns: 1fr;
    }
    
    .payment-checkout__plan-features {
        grid-template-columns: 1fr;
    }
    
    .payment-checkout__action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .payment-checkout__title {
        font-size: 1.5rem;
    }
    
    .payment-checkout__plan-name {
        font-size: 1.25rem;
    }
    
    .payment-checkout__amount {
        font-size: 2rem;
    }
    
    .payment-checkout__section-title {
        font-size: 1.125rem;
    }
}
