/* Checkout Page Styles */
.checkout-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #ffffff;
}

/* Proper container styling for checkout page */
.checkout-page .container-xl {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: auto;
}

/* Header */
.checkout-header {
    padding: 2rem 0 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.header-content {
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Main Checkout Section */
.checkout-section {
    padding: 1.5rem 0 2rem;
    position: relative;
    z-index: 2;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Order Summary */
.order-summary {
    position: sticky;
    top: 2rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.selected-plan {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(75, 172, 254, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(75, 172, 254, 0.2);
}

.plan-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4facfe;
}

.plan-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.plan-price .price {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.plan-price .period {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.savings {
    display: inline-block;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    color: #1a1a2e;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pricing-breakdown {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.price-line.total {
    font-size: 1.2rem;
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    color: #4facfe;
}

.price-label {
    color: rgba(255, 255, 255, 0.8);
}

.price-value {
    color: #ffffff;
    font-weight: 500;
}

.money-back-guarantee {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.guarantee-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.guarantee-text strong {
    display: block;
    color: #00ff88;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.guarantee-text p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.85rem;
}

/* Payment Form */
.payment-form {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.form-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #4facfe;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.form-input.error {
    border-color: #ff4757;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2);
}

.form-input.success {
    border-color: #00ff88;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-select option {
    background: #1a1a2e;
    color: #ffffff;
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    z-index: 10;
}

.password-toggle:hover {
    color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.password-toggle:focus {
    outline: 2px solid #4facfe;
    outline-offset: 2px;
}

.password-toggle i {
    font-size: 16px;
    display: block;
}

.password-requirements {
    margin-top: 0.5rem;
}

.password-requirements small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* Input wrapper for status indicators */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-status {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.input-status.checking {
    opacity: 1;
    color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
}

.input-status.available {
    opacity: 1;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.input-status.unavailable {
    opacity: 1;
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* Error Messages */
.error-message {
    color: #ff4757;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
    animation: slideIn 0.3s ease;
}

.error-message:not(:empty) {
    display: block;
}

.success-message {
    color: #00ff88;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
    animation: slideIn 0.3s ease;
}

.success-message:not(:empty) {
    display: block;
}

/* General error display */
.general-error {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.3);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.error-content i:first-child {
    font-size: 18px;
    flex-shrink: 0;
}

.error-content span {
    flex: 1;
    font-weight: 500;
}

.error-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.error-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Payment Container */
.payment-form-container {
    margin-bottom: 1.5rem;
}

.card-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Square payment form font fallbacks */
.card-container iframe,
.card-container div,
.card-container input {
    font-family: 'Inter', 'SquareSansText-Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Square font loading error handling */
.square-font-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #ff4757;
    font-size: 0.9rem;
    display: none;
}

.square-font-error.show {
    display: block;
}

.square-font-error .error-icon {
    margin-right: 0.5rem;
}

/* Enhanced loading state for Square fonts */
.payment-loading.font-loading::after {
    content: " (Loading secure fonts...)";
    color: rgba(255, 255, 255, 0.6);
}

.payment-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.security-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.security-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.security-icon {
    color: #00ff88;
}

.security-text {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.security-info small {
    color: rgba(255, 255, 255, 0.6);
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #4facfe;
    border-color: #4facfe;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.checkbox-text a {
    color: #4facfe;
    text-decoration: none;
}

.checkbox-text a:hover {
    text-decoration: underline;
}

.terms-checkbox {
    margin-bottom: 1.5rem;
}

.marketing-checkbox {
    margin-bottom: 2rem;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #1a1a2e;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 56px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Trust Signals */
.trust-signals {
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.trust-item {
    text-align: center;
    padding: 1rem;
}

.trust-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.trust-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #ffffff;
}

.trust-item p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .checkout-page .container-xl {
        padding: 0 1.5rem;
    }
    
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .order-summary {
        order: 2;
        position: static;
    }
    
    .payment-form {
        order: 1;
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .trust-item {
        padding: 0.75rem;
    }
    
    .trust-icon {
        font-size: 1.75rem;
    }
    
    .security-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .checkout-page .container-xl {
        padding: 0 1rem;
    }
    
    .checkout-section {
        padding: 2rem 0;
    }
    
    .summary-card, .payment-form {
        padding: 1rem;
    }
    
    .trust-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
