/**
 * Desenvolvido por B20 Conteúdo Digital
 * Premium Glassmorphism Design System - Mobile First
 */

/* CSS Variables */
:root {
    --primary-color: #25D366; /* WhatsApp Green */
    --primary-hover: #1EBE5D;
    --primary-glow: rgba(37, 211, 102, 0.4);
    
    --bg-base: #0B0F19; /* Deep dark blue/black */
    --surface-base: rgba(20, 27, 45, 0.6); /* Glass surface */
    --surface-border: rgba(255, 255, 255, 0.08);
    --surface-highlight: rgba(255, 255, 255, 0.12);
    
    --text-primary: #FFFFFF;
    --text-muted: #94A3B8;
    
    --error-color: #EF4444;
    --success-color: #10B981;
    
    --border-radius: 20px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="light"] {
    --bg-base: #F8FAFC;
    --surface-base: rgba(255, 255, 255, 0.7);
    --surface-border: rgba(0, 0, 0, 0.05);
    --surface-highlight: rgba(255, 255, 255, 1);
    --text-primary: #0F172A;
    --text-muted: #64748B;
    --primary-glow: rgba(37, 211, 102, 0.2);
}

/* Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-base);
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 80px; /* Space for Header */
    padding-bottom: 80px; /* Space for Mobile Nav */
}

/* Background Orbs */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
    will-change: transform;
}
.orb-1 { width: 40vw; height: 40vw; background: var(--primary-color); top: -10vw; left: -10vw; }
.orb-2 { width: 50vw; height: 50vw; background: #3B82F6; bottom: -10vw; right: -10vw; opacity: 0.3; }

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
}

/* App Header (Top Navigation) */
.app-header {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 70px;
    background: var(--surface-base);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--surface-border);
    z-index: 1000;
    display: flex; align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
}

.logo {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-heading);
    font-size: 1.3rem; font-weight: 800;
    color: var(--text-primary); text-decoration: none;
    white-space: nowrap;
}
.logo i { color: var(--primary-color); }

.desktop-nav { display: none; gap: 12px; align-items: center; }
.desktop-nav a {
    color: var(--text-muted); text-decoration: none;
    font-weight: 600; transition: var(--transition);
    padding: 8px 12px; border-radius: 100px;
    white-space: nowrap;
    font-size: 0.9rem;
}
.desktop-nav a:hover, .desktop-nav a.active {
    color: var(--primary-color); background: rgba(37, 211, 102, 0.1);
}

.theme-toggle-header {
    background: transparent; border: 1px solid var(--surface-border);
    color: var(--text-primary); min-width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: var(--transition); flex-shrink: 0;
}
.theme-toggle-header:hover { background: var(--surface-highlight); }

/* Bottom Mobile Navigation */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 70px;
    background: var(--surface-base); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--surface-border);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 1000; padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--text-muted); text-decoration: none; font-size: 0.75rem; font-weight: 500;
    transition: var(--transition);
}
.bottom-nav a i { font-size: 1.4rem; transition: transform 0.3s; }
.bottom-nav a.active { color: var(--primary-color); }
.bottom-nav a.active i { transform: translateY(-3px); }

/* Helpers */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #10B981);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.w-full { width: 100%; }
.mt-4 { margin-top: 24px; }
.text-center { text-align: center; }

/* Sections */
.section { padding: 40px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.section-subtitle { color: var(--text-muted); margin-bottom: 30px; }

/* Hero */
.hero-section { text-align: center; margin-bottom: 40px; }
.hero-section h2 { font-family: var(--font-heading); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.hero-section p { font-size: 1rem; color: var(--text-muted); }

/* Glass Panels */
.pix-form, .result-section, .history-item, .faq-item {
    background: var(--surface-base); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border); border-radius: var(--border-radius);
    padding: 24px; margin-bottom: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: var(--transition);
}
.pix-form {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.result-section {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .pix-form, .result-section, .history-item, .faq-item { padding: 32px; }
}

/* Wizard Progress */
.wizard-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.progress-step { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; transition: var(--transition); }
.progress-step.active { color: var(--primary-color); }
.progress-line { flex: 1; height: 2px; background: var(--surface-border); margin: 0 10px; border-radius: 2px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-group label { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); font-size: 0.95rem; }
.form-group label i { color: var(--primary-color); }
.form-group input, .form-group textarea, .template-selector select {
    width: 100%; padding: 14px 16px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--surface-border);
    border-radius: 12px; color: var(--text-primary); font-family: var(--font-body); font-size: 1rem; transition: var(--transition);
}
[data-theme="light"] .form-group input, [data-theme="light"] .form-group textarea, [data-theme="light"] .template-selector select { background: rgba(255, 255, 255, 0.5); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 4px var(--primary-glow); background: transparent; }
[data-theme="light"] .form-group input:focus, [data-theme="light"] .form-group textarea:focus { background: rgba(255, 255, 255, 0.8); }
.input-error { color: var(--error-color); font-size: 0.8rem; margin-top: 6px; min-height: 18px; }
.char-counter { text-align: right; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 24px; border: none; border-radius: 12px;
    font-family: var(--font-heading); font-weight: 600; font-size: 1rem;
    cursor: pointer; transition: var(--transition);
}
.btn-primary { background: var(--primary-color); color: #0B0F19; box-shadow: 0 10px 20px var(--primary-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 25px var(--primary-glow); background: var(--primary-hover); }
.btn-secondary { background: var(--surface-highlight); color: var(--text-primary); border: 1px solid var(--surface-border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.btn-success { background: #10B981; color: #fff; }
.btn-success:hover { background: #059669; transform: translateY(-2px); }
.btn-icon { background: transparent; border: 1px solid var(--surface-border); color: var(--text-primary); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-icon:hover:not(:disabled) { background: var(--surface-highlight); }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }

/* Result Layout */
.result-header { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; gap: 16px; text-align: center; }
.result-header h3 { font-family: var(--font-heading); font-size: 1.3rem; color: var(--primary-color); }
.card-grid { display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 768px) { .card-grid { flex-direction: row; align-items: start; } .qr-module, .card-module { flex: 1; } }
.qr-container { background: #fff; padding: 16px; border-radius: 20px; display: inline-block; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.qr-module { text-align: center; }
.card-module { text-align: center; }
.card-preview { border-radius: 16px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 15px 40px rgba(0,0,0,0.5); max-width: 100%; }
.card-preview canvas { display: block; width: 100%; height: auto; }
.card-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
@media (min-width: 768px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
/* History & Pagination */
.pagination-controls { display: flex; align-items: center; gap: 12px; }
.page-info { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.history-item { display: flex; flex-direction: column; padding: 20px; }
.history-header { display: flex; justify-content: space-between; align-items: flex-start; }
.history-info h4 { font-size: 1.1rem; margin-bottom: 4px; }
.history-info p { color: var(--text-muted); font-size: 0.85rem; }
.history-amount { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: var(--primary-color); }
.history-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); background: var(--surface-base); backdrop-filter: blur(20px); border: 1px dashed var(--surface-border); border-radius: var(--border-radius); }
.empty-state i { font-size: 3rem; opacity: 0.5; margin-bottom: 10px; color: var(--primary-color); }
.empty-state h3 { font-size: 1.3rem; color: var(--text-primary); font-family: var(--font-heading); }

/* FAQ */
.faq-item { padding: 0; }
.faq-question { width: 100%; padding: 20px; background: transparent; border: none; text-align: left; font-size: 1rem; font-weight: 600; color: var(--text-primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-icon { font-size: 1.4rem; font-weight: 300; transition: transform 0.4s; color: var(--primary-color); }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-answer { padding: 0 20px 20px; color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }

/* Footer */
.site-footer {
    background: var(--surface-base); border-top: 1px solid var(--surface-border);
    padding: 40px 5% 20px; margin-top: 40px; border-radius: var(--border-radius) var(--border-radius) 0 0;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.footer-content { display: flex; flex-direction: column; gap: 40px; max-width: 1100px; margin: 0 auto; }
@media (min-width: 768px) { .footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand h2 { color: var(--primary-color); margin-bottom: 10px; font-family: var(--font-heading); display: flex; align-items: center; gap: 8px; font-size: 1.4rem; }
.footer-brand p { color: var(--text-muted); line-height: 1.5; font-size: 0.9rem; }
.footer-links h3 { margin-bottom: 16px; font-size: 1rem; color: var(--text-primary); font-family: var(--font-heading); }
.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: var(--transition); font-size: 0.9rem; }
.footer-links a:hover { color: var(--primary-color); }
.footer-bottom { text-align: center; border-top: 1px solid var(--surface-border); margin-top: 30px; padding-top: 20px; color: var(--text-muted); font-size: 0.8rem; }

/* Toast */
.toast {
    position: fixed; top: 90px; left: 50%; transform: translateX(-50%) translateY(-100px);
    background: var(--text-primary); color: var(--bg-base); padding: 14px 24px;
    border-radius: 100px; font-weight: 500; display: flex; align-items: center; gap: 10px;
    opacity: 0; transition: var(--transition); z-index: 2000; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    font-size: 0.95rem; width: max-content; max-width: 90%;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Desktop Enhancements */
@media (min-width: 768px) {
    body { padding-bottom: 0; } /* Remove bottom space on desktop */
    .bottom-nav { display: none; }
    .desktop-nav { display: flex; }
    .toast { top: auto; bottom: 30px; transform: translateX(-50%) translateY(100px); }
}
