/**
 * Gerador de Recibos - Stylesheet Principal
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ========================================
   RESET E VARIÁVEIS CSS
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Premium SaaS Palette - Fintech Green */
    --primary-color: #00DD80;
    --primary-hover: #00C270;
    --primary-gradient: linear-gradient(135deg, #00DD80 0%, #00B86B 100%);
    --secondary-color: #1A1F25;
    --accent-color: #FFFFFF;
    --surface-color: #F8F9FA;
    --text-color: #111827;
    
    /* Variações */
    --primary-light: #33FFAA;
    --bg-color: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    
    /* Sombras Antigravity */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 10px 25px rgba(0, 221, 128, 0.3);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);

    /* Layout */
    --border-radius: 12px;
    --spacing-unit: 8px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --header-height: 70px;
    --bottom-nav-height: 65px;
    
    /* Tipografia */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg-color: #0B0E11;
    --bg-secondary: #1A1F25;
    --surface-color: #232A32;
    --text-color: #F9FAFB;
    --text-muted: #9CA3AF;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(11, 14, 17, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 10px 25px rgba(0, 221, 128, 0.15);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.b20-credit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

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

.b20-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 24px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.b20-badge:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 221, 128, 0.15);
}

.b20-badge .b20-name {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.b20-badge .b20-url {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-top: 4px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

/* ========================================
   BASE STYLES
   ======================================== */

html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    padding-top: var(--header-height);
    min-height: 100vh;
}

@media (max-width: 950px) {
    body {
        padding-bottom: var(--bottom-nav-height);
    }
}

/* ========================================
   HEADER FIXO
   ======================================== */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.header-logo h1 {
    font-size: 1.2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo i {
    font-size: 1.5rem;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

@media (min-width: 951px) {
    .desktop-nav {
        display: flex;
        gap: 8px;
    }
    
    .desktop-nav .nav-link {
        padding: 8px 16px;
        border-radius: var(--border-radius);
        color: var(--text-color);
        text-decoration: none;
        transition: var(--transition);
        font-weight: 500;
    }
    
    .desktop-nav .nav-link:hover,
    .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
    }
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--bg-secondary);
}

/* ========================================
   BOTTOM NAVIGATION (MOBILE)
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 951px) {
    .bottom-nav {
        display: none !important;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    transition: var(--transition);
    min-width: 64px;
    min-height: 48px;
}

.nav-item i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: scale(1.15);
}

/* ========================================
   CONTAINER E LAYOUT
   ======================================== */

.container {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* ========================================
   BOTÕES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 48px;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #000000;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-height: 36px;
}

/* ========================================
   FORMULÁRIOS
   ======================================== */

.form-group {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.form-group legend {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: inherit;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.form-field input[readonly] {
    background: var(--bg-secondary);
    cursor: not-allowed;
}

.form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.field-error {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 4px;
    min-height: 20px;
}

.form-field.error input,
.form-field.error select,
.form-field.error textarea {
    border-color: var(--error-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

@media (max-width: 767px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

/* ========================================
   HERO SECTION
   ======================================== */

.hero-section {
    position: relative;
    background: linear-gradient(to bottom, rgba(11, 14, 17, 0.85) 0%, rgba(11, 14, 17, 0.4) 100%), url('../assets/hero_banner.png') center/cover no-repeat, var(--bg-color);
    color: var(--text-color);
    padding: 120px 20px 80px;
    text-align: center;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

/* Background floating blobs for spatial depth */
.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.15;
    animation: floatBlob 10s ease-in-out infinite alternate;
}

.hero-section::before {
    background: var(--primary-color);
    width: 500px;
    height: 500px;
    top: -100px;
    left: -100px;
}

.hero-section::after {
    background: var(--warning-color);
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

[data-theme="dark"] .hero-section::before,
[data-theme="dark"] .hero-section::after {
    opacity: 0.1;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px;
    animation: fadeUp 1s ease-out forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .hero-content {
        padding: 40px 10px;
    }
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    margin-bottom: 40px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
    margin-inline: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========================================
   SECTIONS
   ======================================== */

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 32px;
    text-align: center;
    color: var(--text-color);
}

.how-it-works,
.benefits-section,
.info-section,
.faq-preview,
.cta-section {
    padding: 60px 0;
}

.steps-grid,
.benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 40px;
}

@media (max-width: 767px) {
    .steps-grid,
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .step-card,
    .benefit-card {
        padding: 16px !important;
    }
    .step-icon,
    .benefit-card i {
        font-size: 2rem !important;
        margin-bottom: 12px !important;
    }
    .step-card h3,
    .benefit-card h3 {
        font-size: 1rem !important;
        line-height: 1.3;
    }
    .step-card p,
    .benefit-card p {
        font-size: 0.85rem !important;
    }
}

@media (min-width: 768px) {
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.step-card,
.benefit-card {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.step-card:hover,
.benefit-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.step-icon,
.benefit-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.step-card h3,
.benefit-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.step-card p,
.benefit-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* ========================================
   INFO SECTION
   ======================================== */

.info-content {
    max-width: 800px;
    margin: 0 auto;
}

.info-content h3 {
    font-size: 1.5rem;
    margin: 32px 0 16px;
    color: var(--primary-color);
}

.info-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.info-content ul {
    margin: 16px 0 16px 24px;
}

.info-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ========================================
   FAQ
   ======================================== */

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 16px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: var(--bg-secondary);
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    font-family: inherit;
}

.faq-question:hover {
    background: var(--surface-color);
}

.faq-icon {
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: var(--bg-color);
}

.faq-answer:not([hidden]) {
    padding: 20px;
    max-height: 1000px;
}

.faq-answer p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.faq-answer ul {
    margin: 12px 0 12px 24px;
}

.faq-answer li {
    margin-bottom: 8px;
}

.faq-preview-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.faq-preview-card h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.faq-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   CTA SECTION
   ======================================== */

.cta-section {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1C1C1C 100%);
    color: white;
    text-align: center;
    padding: 80px 20px;
    border-radius: var(--border-radius);
    margin: 40px 0;
}

.cta-section h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 32px;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   RECEIPT CREATOR
   ======================================== */

.receipt-creator {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 32px;
}

@media (min-width: 1024px) {
    .receipt-creator {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        align-items: start; /* Para evitar que o formulário estique a altura inteira caso o preview fique muito alto */
    }

    .preview-section {
        position: sticky;
        top: 24px;
        height: fit-content;
    }
}

.form-section,
.preview-section {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.preview-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.receipt-preview {
    position: relative;
    min-height: 400px;
}

.receipt-document {
    background: white;
    padding: 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: #000;
    aspect-ratio: 210 / 297; /* Proporção exata milimétrica da folha A4 */
    max-width: 100%;
    max-height: 85vh; /* Garante que a folha não fique gigante na tela do desktop, escalando-a para baixo */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Evita que o conteúdo quebre o layout A4 */
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Ocultar a assinatura do pagador e centralizar a do recebedor permanentemente */
.signatures-wrapper {
    flex-direction: column !important;
    align-items: center !important;
}
.signatures-wrapper .signature-line:nth-child(1) {
    width: 100% !important;
    max-width: 400px !important;
    flex: none !important;
}
.signatures-wrapper .signature-line:nth-child(2) {
    display: none !important;
}

.receipt-header-doc {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #000;
}

.receipt-header-doc h2 {
    font-size: 2rem;
    color: #000;
    margin-bottom: 8px;
}

.receipt-number {
    font-size: 0.9rem;
    color: #666;
}

.receipt-body {
    line-height: 1.8;
}

.receipt-amount {
    font-size: 1.3rem;
    margin-bottom: 24px;
    padding: 16px;
    background: #F5F5F5;
    border-radius: 4px;
    text-align: center;
}

.receipt-text {
    margin-bottom: 32px;
    text-align: justify;
}

.receipt-footer-doc {
    margin-top: 48px;
}

.signature-line {
    margin-top: 64px;
    text-align: center;
}

.signature-content {
    border-top: 2px solid #000;
    padding-top: 8px;
    margin-bottom: 8px;
    min-height: 40px;
    font-family: 'Brush Script MT', cursive;
    font-size: 1.5rem;
}

.preview-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
}

.preview-empty i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ========================================
   BLOG
   ======================================== */

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 32px;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.blog-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition);
}

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

.blog-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.blog-content h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.blog-excerpt {
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.blog-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.blog-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   MODELS
   ======================================== */

.models-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 32px;
}

@media (min-width: 768px) {
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.model-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 32px;
    transition: var(--transition);
}

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

.model-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 16px;
    text-align: center;
}

.model-card h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-color);
    text-align: center;
}

.model-description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.model-details h4 {
    color: var(--primary-color);
    margin: 16px 0 8px;
}

.model-details ul {
    margin: 8px 0 16px 24px;
}

.model-details li {
    margin-bottom: 4px;
    color: var(--text-muted);
}

.example-text {
    font-style: italic;
    background: var(--bg-color);
    padding: 12px;
    border-radius: 4px;
    margin: 12px 0;
}

.model-card .btn {
    width: 100%;
    margin-top: 24px;
}

.tips-section {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 2px solid var(--border-color);
}

.tips-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 32px;
}

@media (min-width: 768px) {
    .tips-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tip-card {
    text-align: center;
    padding: 24px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.tip-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

/* ========================================
   ARTICLE
   ======================================== */

.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 40px;
}

.article-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-header h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 16px;
    color: var(--text-color);
}

.article-lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.article-body section {
    margin-bottom: 32px;
}

.article-body h2 {
    font-size: 1.8rem;
    margin: 32px 0 16px;
    color: var(--primary-color);
}

.article-body h3 {
    font-size: 1.4rem;
    margin: 24px 0 12px;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.article-body ul {
    margin: 16px 0 16px 24px;
}

.article-body li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.article-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.article-cta {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 32px;
}

.article-cta h3 {
    margin-bottom: 12px;
}

.article-navigation {
    text-align: center;
}

.related-articles {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
}

@media (min-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.related-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

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

.related-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.related-card h3 {
    font-size: 1.1rem;
}

/* ========================================
   LEGAL PAGES
   ======================================== */

.legal-content {
    max-width: 900px;
    margin: 0 auto;
}

.legal-content section {
    margin-bottom: 32px;
}

.legal-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.legal-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.legal-content ul {
    margin: 16px 0 16px 24px;
}

.legal-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.legal-footer {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-top: 40px;
}

.legal-date {
    text-align: center;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ========================================
   CONTACT
   ======================================== */

.contact-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 32px;
}

@media (min-width: 1024px) {
    .contact-container {
        grid-template-columns: 1fr 2fr;
    }
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--border-radius);
    text-align: center;
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.info-card h3 {
    margin-bottom: 12px;
}

.info-card p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.contact-form-section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--border-radius);
}

.contact-form-section h3 {
    margin-bottom: 12px;
    color: var(--primary-color);
}

.contact-form-section > p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.contact-success {
    text-align: center;
    padding: 40px;
}

.contact-success i {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 16px;
}

.contact-success h3 {
    margin-bottom: 12px;
}

.additional-info {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 32px;
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.info-item {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.info-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.info-item h4 {
    margin-bottom: 8px;
}

.text-muted {
    color: var(--text-muted);
}

/* ========================================
   NEWSLETTER
   ======================================== */

.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 60px 32px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: 60px;
}

.newsletter-content h2 {
    margin-bottom: 12px;
}

.newsletter-content p {
    margin-bottom: 24px;
    opacity: 0.9;
}

/* ========================================
   FOOTER
   ======================================== */

.app-footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-section h3 {
    margin-bottom: 16px;
    color: var(--primary-color);
}

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

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin-bottom: 8px;
}

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

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--error-color);
    color: white;
}

/* ========================================
   UTILITIES
   ======================================== */

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 8px;
}

.page-header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.page-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    margin: 0 0 4px 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0;
}

/* ========================================
   FORM GROUPS (UX)
   ======================================== */

.form-group-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-group-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.form-group-header {
    padding: 16px 24px;
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    background: rgba(0, 221, 128, 0.04);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-body {
    padding: 24px;
}

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

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    body {
        padding: 0;
    }
    
    .app-header,
    .bottom-nav,
    .app-footer,
    .preview-header,
    .form-section,
    .btn,
    .nav-item {
        display: none !important;
    }
    
    .receipt-document {
        border: none;
        box-shadow: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 767px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }

    /* Otimizações Mobile First para a Página de Criação */
    .receipt-creator {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .form-section,
    .preview-section {
        padding: 16px;
    }

    .accordion-body {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 20px;
    }

    .page-header-text {
        align-items: center;
    }

    .page-header h2 {
        justify-content: center;
    }

    #btn-clear-form {
        justify-content: center;
    }

    /* Aproveitar 100% da tela no mobile removendo margens mortas */
    .preview-section {
        padding: 16px 8px; /* Tira o espaçamento lateral inútil */
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .preview-header, .receipt-actions {
        width: 100%;
        padding: 0 8px;
    }

    .receipt-document {
        min-width: 100%;
        max-width: 100%;
        padding: 24px 16px; /* Padding interno menor no mobile */
        box-sizing: border-box;
    }

    /* Reduzir levemente as fontes no celular para caber tudo sem quebrar */
    .receipt-text {
        font-size: 0.95rem !important;
    }
    .receipt-amount strong {
        font-size: 1.3rem !important;
    }
    .signature-line {
        min-width: 100% !important; /* Força as assinaturas a ocuparem a tela toda empilhadas */
    }
}

/* ==========================================================================
   Print Styles (Geração Nativa de PDF)
   ========================================================================== */
@media print {
    /* Ativar impressão de cores de fundo com alta fidelidade */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Esconder tudo o que não é o recibo */
    .app-header, 
    .app-footer, 
    .bottom-nav, 
    .form-section,
    .page-header,
    .desktop-nav,
    .header-actions,
    .toast,
    #toast,
    button,
    #btn-download-pdf,
    #btn-clear-form {
        display: none !important;
    }

    /* Ajustar o corpo da página */
    body {
        background-color: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Fazer o grid focar apenas no preview */
    .receipt-creator {
        display: block !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Remover estilizações do contêiner do preview para parecer uma folha de papel real */
    .preview-section {
        position: static !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Evitar que o script de redimensionamento interfira na impressão nativa */
    #receipt-preview {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    /* Ajustar o documento em si */
    .receipt-document {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 5mm 10mm !important; /* Margens mínimas para caber tudo */
        width: 100% !important;
        max-width: none !important;
        min-height: auto !important;
        aspect-ratio: auto !important;
        transform: none !important;
    }

    /* Forçar cabeçalho numa linha e remover exageros de espaço */
    .receipt-header-doc {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }

    /* Aproximar os elementos do cabeçalho */
    .receipt-header-doc > div {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    /* Diminuir espaçamentos de margem nas assinaturas */
    .signatures-wrapper {
        margin-top: 16px !important;
        gap: 16px !important;
    }

    /* Configuração da Página A4: Margem 0 remove Data, Hora e URL que o navegador imprime no topo/rodapé */
    @page {
        size: A4 portrait;
        margin: 5mm; /* Margem de impressão bem pequena */
    }
}

