/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color System */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    --secondary-50: #f0fdf4;
    --secondary-100: #dcfce7;
    --secondary-200: #bbf7d0;
    --secondary-300: #86efac;
    --secondary-400: #4ade80;
    --secondary-500: #22c55e;
    --secondary-600: #16a34a;
    --secondary-700: #15803d;
    --secondary-800: #166534;
    --secondary-900: #14532d;

    --accent-50: #fff7ed;
    --accent-100: #ffedd5;
    --accent-200: #fed7aa;
    --accent-300: #fdba74;
    --accent-400: #fb923c;
    --accent-500: #f97316;
    --accent-600: #ea580c;
    --accent-700: #c2410c;
    --accent-800: #9a3412;
    --accent-900: #7c2d12;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --success-500: #22c55e;
    --warning-500: #eab308;
    --error-500: #ef4444;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-base: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--gray-50);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
}

.nav-brand h2 {
    color: var(--primary-600);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-menu a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-600);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--gray-600);
    margin: 3px 0;
    transition: 0.3s;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--font-size-base);
    line-height: 1.2;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

.btn-large {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-base);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-outline {
    background: transparent;
    color: var(--primary-600);
    border: 2px solid var(--primary-600);
}

.btn-outline:hover {
    background: var(--primary-600);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: white;
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-600), var(--accent-700));
}

.btn-pix {
    background: linear-gradient(135deg, #00d4aa, #00b894);
    color: white;
    border: none;
}

.btn-pix:hover {
    background: linear-gradient(135deg, #00b894, #00a085);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* iOS Safari specific optimizations for PIX button */
.btn-pix {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Active state for touch feedback */
.btn-pix:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* PIX Modal Styles */
.pix-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

.pix-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4); /* Ensure modal doesn't touch screen edges */
}

.pix-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
    position: relative;
}

.pix-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.pix-modal-header h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.pix-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    padding: var(--space-2);
    border-radius: var(--radius-base);
    transition: all 0.2s ease;
    /* iOS touch optimizations */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    min-width: 44px; /* iOS minimum touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pix-modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.pix-modal-close:active {
    background: var(--gray-200);
    transform: scale(0.95);
}

.pix-modal-body {
    padding: var(--space-6);
}

.pix-modal-body p {
    text-align: center;
    color: var(--gray-700);
    margin-bottom: var(--space-6);
    font-size: var(--font-size-lg);
}

.qr-code-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-8);
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.qr-code-image {
    max-width: 250px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-base);
    /* Prevent image selection on mobile */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    user-select: none;
    pointer-events: none;
}

.pix-instructions {
    background: var(--primary-50);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary-200);
}

.pix-instructions h4 {
    color: var(--primary-700);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.pix-instructions ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-5);
}

.pix-instructions li {
    color: var(--gray-700);
    margin-bottom: var(--space-2);
    line-height: 1.5;
}

.pix-note {
    background: var(--secondary-50);
    color: var(--secondary-700);
    padding: var(--space-3);
    border-radius: var(--radius-base);
    border: 1px solid var(--secondary-200);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-align: center;
    margin: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive adjustments for PIX modal */
@media (max-width: 768px) {
    .pix-modal-content {
        width: 95%;
        margin: var(--space-2);
        max-height: 95vh;
    }
    
    .qr-code-image {
        max-width: 200px;
    }
    
    .pix-modal-header,
    .pix-modal-body {
        padding: var(--space-4);
    }
    
    .pix-modal {
        padding: var(--space-2);
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .pix-modal {
        /* Fix iOS viewport height issues */
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    .pix-modal-content {
        /* Prevent zoom on iOS when focusing inputs */
        font-size: 16px;
    }
    
    .btn-pix {
        /* Ensure proper touch targets on iOS */
        min-height: 44px;
        min-width: 44px;
    }
}

/* Hero Section */
.hero {
    padding: var(--space-24) 0 var(--space-16);
    margin-top: 80px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--secondary-50) 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

.hero h1 {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-6);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--gray-600);
    margin-bottom: var(--space-8);
    line-height: 1.5;
}

.hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 500;
    color: var(--gray-700);
}

.feature-icon {
    font-size: var(--font-size-lg);
}

.hero-cta {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.trust-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--secondary-600);
    font-weight: 500;
}

.hero-image {
    position: relative;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-image:hover .image-overlay {
    opacity: 1;
}

.play-button {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    color: var(--primary-600);
    cursor: pointer;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-header h2 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

.section-header p {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* Features Section */
.features {
    padding: var(--space-20) 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-8);
}

.feature-card {
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-200);
}

.feature-icon-large {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.feature-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

.feature-card p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Pricing Section */
.pricing {
    padding: var(--space-20) 0;
    background: var(--gray-50);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 2px solid transparent;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.pricing-popular {
    border-color: var(--primary-500);
    transform: scale(1.05);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.pricing-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: var(--space-2);
}

.currency {
    font-size: var(--font-size-xl);
    color: var(--gray-600);
}

.amount {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    color: var(--gray-900);
}

.period {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
}

.savings {
    background: var(--secondary-100);
    color: var(--secondary-700);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-weight: 600;
    display: inline-block;
}

.pricing-features {
    list-style: none;
    margin-bottom: var(--space-8);
}

.pricing-features li {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.pricing-features li:last-child {
    border-bottom: none;
}

.payment-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.payment-btn {
    font-weight: 600;
}

/* Installation Section */
.installation {
    padding: var(--space-20) 0;
    background: white;
}

.installation-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-12);
}

.step {
    position: relative;
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0 auto var(--space-6);
}

.step-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

.step-content p {
    color: var(--gray-600);
    margin-bottom: var(--space-6);
}

.code-block {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
    text-align: left;
    margin: var(--space-4) 0;
}

.config-list {
    list-style: none;
    text-align: left;
}

.config-list li {
    padding: var(--space-2) 0;
    position: relative;
    padding-left: var(--space-6);
}

.config-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-500);
    font-weight: bold;
}

.download-btn {
    margin-top: var(--space-4);
}

/* FAQ Section */
.faq {
    padding: var(--space-20) 0;
    background: var(--gray-50);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-8);
}

.faq-item {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-base);
}

.faq-item h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

.faq-item p {
    color: var(--gray-600);
    line-height: 1.6;
}

/* Contact Section */
.contact {
    padding: var(--space-20) 0;
    background: white;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.contact-card {
    text-align: center;
    padding: var(--space-8);
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
}

.contact-card:hover {
    background: white;
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.contact-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

.contact-card p {
    color: var(--gray-600);
    margin-bottom: var(--space-4);
}

.contact-link {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-section h3 {
    color: white;
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-4);
}

.footer-section h4 {
    color: white;
    font-size: var(--font-size-base);
    margin-bottom: var(--space-4);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--space-2);
}

.footer-section ul li a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: var(--space-6);
    text-align: center;
    color: var(--gray-400);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero h1 {
        font-size: var(--font-size-3xl);
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-popular {
        transform: none;
    }
    
    .installation-steps {
        grid-template-columns: 1fr;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 var(--space-3);
    }
    
    .section-header h2 {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: var(--space-16) 0 var(--space-12);
    }
    
    .hero h1 {
        font-size: var(--font-size-2xl);
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .btn-large {
        padding: var(--space-3) var(--space-6);
        font-size: var(--font-size-base);
    }
}

/* Loading and Animation States */
.payment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-btn.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: var(--space-2);
}

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

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.btn:focus,
a:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .footer {
        display: none;
    }
    
    .hero {
        margin-top: 0;
    }
}