/* Checkout Page Styles */
.checkout-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-green);
    font-weight: 600;
    font-size: 0.875rem;
}

.secure-badge svg {
    width: 16px;
    height: 16px;
}

/* Main Layout */
.checkout-main {
    min-height: calc(100vh - 80px);
    padding: 3rem 0;
    background: var(--bg-secondary);
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Order Summary */
.order-summary {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.order-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.product-card {
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.product-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.product-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-features li::before {
    content: '✓';
    color: var(--success-green);
    font-weight: bold;
}

/* Pricing Breakdown */
.pricing-breakdown {
    border-top: 2px solid var(--border-light);
    padding-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.price-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.price-line.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    border-top: 2px solid var(--border-light);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.discount-amount {
    color: var(--success-green);
    font-weight: 600;
}

/* Trust Signals */
.trust-signals {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.trust-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary-blue);
    flex-shrink: 0;
}

/* Payment Section */
.payment-section {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.payment-section h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Email Section */
.email-section {
    margin-bottom: 2rem;
}

.email-section label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.email-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.email-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Express Checkout */
.express-checkout {
    margin-bottom: 1.5rem;
    min-height: 50px;
}

.divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}

.divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Payment Form */
#payment-form {
    margin-top: 2rem;
}

#payment-element {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.3s ease;
}

#payment-element.StripeElement--focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Error Message */
.error-message {
    color: var(--error-red);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Submit Button */
.submit-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

/* Payment Footer */
.payment-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.security-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.security-note svg {
    width: 16px;
    height: 16px;
    color: var(--success-green);
}

.payment-methods {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.payment-methods img {
    height: 24px;
}

/* Success Modal */
.success-modal {
    text-align: center;
    padding: 3rem;
}

.success-icon {
    margin-bottom: 1.5rem;
}

.success-icon svg {
    width: 80px;
    height: 80px;
    color: var(--success-green);
}

.success-modal h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.success-message {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.success-details {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.success-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.success-details strong {
    color: var(--text-primary);
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.875rem 2rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .order-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .checkout-main {
        padding: 2rem 0;
    }
    
    .order-summary,
    .payment-section {
        padding: 1.5rem;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* Password Setup Modal Styles */
.password-setup-container {
    padding: 2rem;
}

.password-setup-container .success-icon {
    text-align: center;
    margin-bottom: 1.5rem;
}

.password-setup-container h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.password-setup-container .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.order-info {
    background: var(--bg-secondary, #f3f4f6);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.order-info p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.order-info strong {
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[readonly] {
    background: var(--bg-secondary, #f3f4f6);
    cursor: not-allowed;
    color: var(--text-secondary);
}

/* Password Requirements */
.password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.requirement {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.requirement.met {
    color: var(--success-green, #10b981) !important;
    font-weight: 500;
}

/* Skip option */
.skip-option {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.875rem;
    padding: 0;
}

.btn-link:hover {
    color: var(--primary-blue, #2563eb);
}

/* Loading states for password setup */
.password-setup-container .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

/* Skip confirmation styles */
.skip-confirmation {
    text-align: center;
    padding: 3rem;
}

.important-note {
    background: var(--bg-secondary, #f3f4f6);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid var(--warning-orange, #f59e0b);
}

/* Success animation */
.success-animation svg {
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .password-requirements {
        grid-template-columns: 1fr;
    }
    
    .password-setup-container {
        padding: 1.5rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}