<div class="pricing-container">
<div class="pricing-header">
<h2 class="pricing-title">Choose Your Plan</h2>
<p class="pricing-subtitle">Select the perfect plan for your needs</p>
<div class="billing-toggle">
<span class="billing-label">Monthly</span>
<label class="toggle-switch">
<input type="checkbox" id="billingToggle">
<span class="toggle-slider"></span>
</label>
<span class="billing-label">Annual <span class="discount-badge">Save 20%</span></span>
</div>
</div>
<div class="pricing-grid">
<!-- Basic Plan -->
<div class="pricing-card basic">
<div class="card-header">
<h3 class="plan-name">Basic</h3>
<p class="plan-description">Perfect for individuals getting started</p>
</div>
<div class="price-section">
<div class="price-wrapper">
<span class="currency">$</span>
<span class="price" data-monthly="9" data-annual="7">9</span>
<span class="period">/month</span>
</div>
<p class="price-note">Billed monthly</p>
</div>
<ul class="features-list">
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Up to 5 projects
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
10GB storage
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Email support
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Basic analytics
</li>
</ul>
<button class="cta-button basic-btn">Get Started</button>
</div>
<!-- Pro Plan -->
<div class="pricing-card pro popular">
<div class="popular-badge">Most Popular</div>
<div class="card-header">
<h3 class="plan-name">Pro</h3>
<p class="plan-description">Best for growing businesses</p>
</div>
<div class="price-section">
<div class="price-wrapper">
<span class="currency">$</span>
<span class="price" data-monthly="29" data-annual="23">29</span>
<span class="period">/month</span>
</div>
<p class="price-note">Billed monthly</p>
</div>
<ul class="features-list">
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Unlimited projects
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
100GB storage
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Priority support
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Advanced analytics
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Team collaboration
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
API access
</li>
</ul>
<button class="cta-button pro-btn">Start Free Trial</button>
</div>
<!-- Enterprise Plan -->
<div class="pricing-card enterprise">
<div class="card-header">
<h3 class="plan-name">Enterprise</h3>
<p class="plan-description">For large organizations</p>
</div>
<div class="price-section">
<div class="price-wrapper">
<span class="currency">$</span>
<span class="price" data-monthly="99" data-annual="79">99</span>
<span class="period">/month</span>
</div>
<p class="price-note">Billed monthly</p>
</div>
<ul class="features-list">
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Everything in Pro
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Unlimited storage
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
24/7 phone support
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Custom integrations
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Advanced security
</li>
<li class="feature-item">
<svg class="check-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>
Dedicated manager
</li>
</ul>
<button class="cta-button enterprise-btn">Contact Sales</button>
</div>
</div>
<div class="pricing-footer">
<p class="footer-text">All plans include a 14-day free trial. No credit card required.</p>
<div class="trust-indicators">
<div class="trust-item">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z"/>
</svg>
<span>SSL Secured</span>
</div>
<div class="trust-item">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<span>Money Back Guarantee</span>
</div>
</div>
</div>
</div>
.pricing-container {
max-width: 1200px;
margin: 0 auto;
padding: 60px 20px;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
min-height: 100vh;
}
.pricing-header {
text-align: center;
margin-bottom: 60px;
}
.pricing-title {
font-size: 48px;
font-weight: 700;
color: #1a1a1a;
margin: 0 0 16px 0;
background: linear-gradient(135deg, #667eea, #764ba2);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.pricing-subtitle {
font-size: 20px;
color: #666;
margin: 0 0 40px 0;
}
.billing-toggle {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
background: white;
padding: 8px;
border-radius: 50px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
display: inline-flex;
}
.billing-label {
font-size: 16px;
font-weight: 500;
color: #666;
display: flex;
align-items: center;
gap: 8px;
}
.discount-badge {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
font-size: 12px;
padding: 4px 8px;
border-radius: 12px;
font-weight: 600;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #ccc;
transition: 0.3s;
border-radius: 24px;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background: white;
transition: 0.3s;
border-radius: 50%;
}
input:checked + .toggle-slider {
background: linear-gradient(135deg, #667eea, #764ba2);
}
input:checked + .toggle-slider:before {
transform: translateX(26px);
}
.pricing-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 32px;
margin-bottom: 60px;
}
.pricing-card {
background: white;
border-radius: 20px;
padding: 40px 32px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
position: relative;
border: 2px solid transparent;
}
.pricing-card:hover {
transform: translateY(-8px);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.pricing-card.popular {
border-color: #667eea;
transform: scale(1.05);
}
.pricing-card.popular:hover {
transform: scale(1.05) translateY(-8px);
}
.popular-badge {
position: absolute;
top: -12px;
left: 50%;
transform: translateX(-50%);
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 8px 24px;
border-radius: 20px;
font-size: 14px;
font-weight: 600;
}
.card-header {
text-align: center;
margin-bottom: 32px;
}
.plan-name {
font-size: 24px;
font-weight: 700;
color: #1a1a1a;
margin: 0 0 8px 0;
}
.plan-description {
font-size: 16px;
color: #666;
margin: 0;
}
.price-section {
text-align: center;
margin-bottom: 32px;
}
.price-wrapper {
display: flex;
align-items: baseline;
justify-content: center;
margin-bottom: 8px;
}
.currency {
font-size: 24px;
font-weight: 600;
color: #666;
}
.price {
font-size: 48px;
font-weight: 700;
color: #1a1a1a;
margin: 0 4px;
transition: all 0.3s ease;
}
.period {
font-size: 18px;
color: #666;
}
.price-note {
font-size: 14px;
color: #999;
margin: 0;
}
.features-list {
list-style: none;
padding: 0;
margin: 0 0 32px 0;
}
.feature-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 0;
font-size: 16px;
color: #333;
}
.check-icon {
width: 20px;
height: 20px;
color: #10b981;
flex-shrink: 0;
}
.cta-button {
width: 100%;
padding: 16px 24px;
border: none;
border-radius: 12px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.basic-btn {
background: #f8f9fa;
color: #333;
border: 2px solid #e9ecef;
}
.basic-btn:hover {
background: #e9ecef;
transform: translateY(-2px);
}
.pro-btn {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
}
.pro-btn:hover {
background: linear-gradient(135deg, #5a6fd8, #6a42a0);
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}
.enterprise-btn {
background: #1a1a1a;
color: white;
}
.enterprise-btn:hover {
background: #333;
transform: translateY(-2px);
}
.pricing-footer {
text-align: center;
}
.footer-text {
font-size: 16px;
color: #666;
margin: 0 0 24px 0;
}
.trust-indicators {
display: flex;
justify-content: center;
gap: 32px;
flex-wrap: wrap;
}
.trust-item {
display: flex;
align-items: center;
gap: 8px;
color: #666;
font-size: 14px;
}
.trust-item svg {
width: 20px;
height: 20px;
color: #10b981;
}
/* Responsive design */
@media (max-width: 768px) {
.pricing-container {
padding: 40px 16px;
}
.pricing-title {
font-size: 36px;
}
.pricing-subtitle {
font-size: 18px;
}
.pricing-grid {
grid-template-columns: 1fr;
gap: 24px;
}
.pricing-card.popular {
transform: none;
}
.pricing-card.popular:hover {
transform: translateY(-8px);
}
.trust-indicators {
flex-direction: column;
gap: 16px;
}
}
/* Animation for price changes */
.price.changing {
animation: priceChange 0.3s ease;
}
@keyframes priceChange {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
document.addEventListener('DOMContentLoaded', () => {
const billingToggle = document.getElementById('billingToggle');
const priceElements = document.querySelectorAll('.price');
const priceNotes = document.querySelectorAll('.price-note');
const billingLabels = document.querySelectorAll('.billing-label');
// Handle billing toggle
billingToggle.addEventListener('change', () => {
const isAnnual = billingToggle.checked;
priceElements.forEach(priceEl => {
const monthlyPrice = priceEl.dataset.monthly;
const annualPrice = priceEl.dataset.annual;
const newPrice = isAnnual ? annualPrice : monthlyPrice;
// Add animation class
priceEl.classList.add('changing');
// Update price after a short delay
setTimeout(() => {
priceEl.textContent = newPrice;
priceEl.classList.remove('changing');
}, 150);
});
// Update price notes
priceNotes.forEach(note => {
note.textContent = isAnnual ? 'Billed annually' : 'Billed monthly';
});
// Update billing label styles
billingLabels.forEach((label, index) => {
if (index === 0) { // Monthly
label.style.color = isAnnual ? '#999' : '#333';
label.style.fontWeight = isAnnual ? '400' : '600';
} else { // Annual
label.style.color = isAnnual ? '#333' : '#999';
label.style.fontWeight = isAnnual ? '600' : '400';
}
});
});
// Handle CTA button clicks
const ctaButtons = document.querySelectorAll('.cta-button');
ctaButtons.forEach(button => {
button.addEventListener('click', (e) => {
const card = button.closest('.pricing-card');
const planName = card.querySelector('.plan-name').textContent;
const price = card.querySelector('.price').textContent;
const isAnnual = billingToggle.checked;
// Add loading state
const originalText = button.textContent;
button.textContent = 'Loading...';
button.disabled = true;
button.style.opacity = '0.7';
// Simulate API call
setTimeout(() => {
console.log(`Selected plan: ${planName}`);
console.log(`Price: $${price}/${isAnnual ? 'year' : 'month'}`);
console.log(`Billing: ${isAnnual ? 'Annual' : 'Monthly'}`);
// Show success feedback
button.textContent = '✓ Selected';
button.style.background = '#10b981';
// Reset after delay
setTimeout(() => {
button.textContent = originalText;
button.disabled = false;
button.style.opacity = '1';
button.style.background = '';
}, 2000);
}, 1500);
});
});
// Add hover effects to cards
const pricingCards = document.querySelectorAll('.pricing-card');
pricingCards.forEach(card => {
card.addEventListener('mouseenter', () => {
// Add subtle glow effect
if (card.classList.contains('popular')) {
card.style.boxShadow = '0 20px 60px rgba(102, 126, 234, 0.2)';
} else {
card.style.boxShadow = '0 20px 60px rgba(0, 0, 0, 0.15)';
}
});
card.addEventListener('mouseleave', () => {
// Reset shadow
card.style.boxShadow = '';
});
});
// Animate cards on scroll
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const cardObserver = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
// Initially hide cards for animation
pricingCards.forEach((card, index) => {
card.style.opacity = '0';
card.style.transform = 'translateY(30px)';
card.style.transition = `opacity 0.6s ease ${index * 0.1}s, transform 0.6s ease ${index * 0.1}s`;
cardObserver.observe(card);
});
// Keyboard navigation
document.addEventListener('keydown', (e) => {
if (e.key === 'Tab') {
// Enhance focus visibility for accessibility
const focusedElement = document.activeElement;
if (focusedElement.classList.contains('cta-button')) {
focusedElement.style.outline = '3px solid #667eea';
focusedElement.style.outlineOffset = '2px';
}
}
});
// Remove custom focus styles on blur
ctaButtons.forEach(button => {
button.addEventListener('blur', () => {
button.style.outline = '';
button.style.outlineOffset = '';
});
});
// Calculate savings for annual billing
function updateSavingsDisplay() {
const isAnnual = billingToggle.checked;
if (isAnnual) {
priceElements.forEach(priceEl => {
const monthlyPrice = parseInt(priceEl.dataset.monthly);
const annualPrice = parseInt(priceEl.dataset.annual);
const monthlyCost = monthlyPrice * 12;
const annualCost = annualPrice * 12;
const savings = monthlyCost - annualCost;
const savingsPercentage = Math.round((savings / monthlyCost) * 100);
// You could display savings here if needed
console.log(`Annual savings: $${savings} (${savingsPercentage}%)`);
});
}
}
billingToggle.addEventListener('change', updateSavingsDisplay);
});