/**
 * Single-Page Checkout Styles
 *
 * @package    local_cohortsubscribe
 * @copyright  2025 Your Organization
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

/* Checkout Container */
.checkout-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Checkout Header */
.checkout-header {
    text-align: center;
    margin-bottom: 30px;
}

.checkout-title {
    color: #333;
    margin-bottom: 15px;
}

.checkout-description {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Checkout Form */
.checkout-form-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.checkout-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.checkout-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E30A2E;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.form-label.required::after {
    content: " *";
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1em;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Fix dropdown text visibility */
select.form-control {
    height: auto;
    min-height: 44px;
    padding: 12px 15px;
    line-height: normal;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #28a745;
}

/* Validation Feedback */
.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 5px;
}

.form-control.is-invalid~.invalid-feedback {
    display: block;
}

/* Password Strength Indicator */
.password-strength-indicator {
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.password-strength-indicator.weak {
    width: 33%;
    background: #dc3545;
}

.password-strength-indicator.medium {
    width: 66%;
    background: #ffc107;
}

.password-strength-indicator.strong {
    width: 100%;
    background: #28a745;
}

.password-strength-text {
    font-size: 0.875em;
    margin-top: 5px;
}

.password-strength-text.weak {
    color: #dc3545;
}

.password-strength-text.medium {
    color: #ffc107;
}

.password-strength-text.strong {
    color: #28a745;
}

/* Submit Button */
#checkout-submit-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#checkout-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

#checkout-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#checkout-submit-btn.processing {
    position: relative;
    color: transparent;
}

#checkout-submit-btn.processing::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Submit Feedback */
.submit-feedback {
    min-height: 20px;
    font-size: 0.875em;
}

.submit-feedback.error {
    color: #dc3545;
}

.submit-feedback.success {
    color: #28a745;
}

/* Stripe Pricing Table */
.pricing-section stripe-pricing-table {
    margin: 20px 0;
}

/* Checkout Info */
.checkout-info {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
}

.checkout-info h5 {
    color: #0056b3;
    margin-bottom: 10px;
}

.checkout-info ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.checkout-info li {
    margin-bottom: 5px;
}

/* Success Page Styles */
.checkout-success-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.next-steps-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.next-steps-list {
    padding-left: 25px;
}

.next-steps-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.success-actions {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {

    .checkout-container,
    .checkout-success-container {
        padding: 10px;
    }

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

    .section-title {
        font-size: 1.3em;
    }
}

/* Loading Overlay */
.checkout-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.checkout-loading-overlay.active {
    display: flex;
}

.checkout-loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}