/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --text-dark: #94a3b8;
    --border: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto 24px;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hero-features .feature {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Purchase Section */
.purchase {
    padding: 60px 0;
    background: var(--bg-alt);
}

.purchase-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.purchase-card h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 0.95rem;
}

/* Slider */
.slider-container {
    margin-bottom: 30px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: var(--text-light);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 20px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow);
}

.slider-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-alt);
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 600;
}

.price-display {
    color: var(--primary);
    font-size: 1.25rem;
}

/* Price Breakdown */
.price-breakdown {
    background: var(--bg-alt);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.breakdown-row.total {
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 12px;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Buttons */
.buy-button, .redeem-button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.buy-button:hover, .redeem-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.terms {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 16px;
}

/* How It Works */
.how-it-works {
    padding: 60px 0;
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.step {
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Redeem Section */
.redeem {
    padding: 60px 0;
    background: var(--bg-alt);
}

.redeem-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    margin: 0 auto;
}

.redeem-card h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.redeem-card > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 24px;
}

#redeem-form {
    margin-bottom: 20px;
}

#redeem-key {
    width: 100%;
    padding: 16px;
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: monospace;
    transition: border-color 0.3s;
}

#redeem-key:focus {
    outline: none;
    border-color: var(--primary);
}

/* Config Display */
.config-display {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    position: relative;
}

.config-box {
    color: #fff;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    line-height: 1.5;
    padding-right: 80px;
}

.copy-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.copy-button:hover {
    background: var(--primary-light);
}

.config-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.config-info p {
    margin-bottom: 8px;
    color: var(--text-light);
}

/* Features Section */
.features-section {
    padding: 60px 0;
}

.features-section h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    text-align: center;
    padding: 24px;
}

.feature-card .icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* FAQ Section */
.faq {
    padding: 60px 0;
    background: var(--bg-alt);
}

.faq h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 40px;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.faq-item p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Footer */
footer {
    background: var(--bg-dark);
    color: white;
    padding: 40px 0;
    text-align: center;
}

footer p {
    color: var(--text-dark);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
}

.close:hover {
    color: var(--text);
}

.modal h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.purchase-summary {
    background: var(--bg-alt);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.purchase-summary p {
    margin-bottom: 8px;
}

.purchase-summary p:last-child {
    margin-bottom: 0;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

#pay-button {
    width: 100%;
    background: var(--success);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#pay-button:hover {
    background: #16a34a;
}

#loading, #success, #redeem-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

#success h3 {
    text-align: center;
    margin-bottom: 20px;
}

.success-details {
    background: var(--bg-alt);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.success-details p {
    margin-bottom: 12px;
}

.success-details .note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.button {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.error-message {
    background: #fee2e2;
    color: var(--error);
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .purchase-card, .redeem-card {
        padding: 24px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0 40px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-features {
        flex-direction: column;
        gap: 12px;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .slider-labels {
        font-size: 0.75rem;
    }
}
