/* style.css - PostAI - Design Instagram - MODIFICADO */
:root {
    /* Cores Instagram */
    --instagram-gradient: linear-gradient(45deg, 
        #405de6, #5851db, #833ab4, #c13584, 
        #e1306c, #fd1d1d, #f56040, #f77737
    );
    --instagram-purple: #833ab4;
    --instagram-pink: #e1306c;
    --instagram-red: #fd1d1d;
    --instagram-blue: #405de6;
    --instagram-orange: #f77737;
    
    /* Cores neutras */
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --border-color: #dbdbdb;
    --border-light: #efefef;
    --border-focus: #a8a8a8;
    
    /* Texto */
    --text-primary: #262626;
    --text-secondary: #8e8e8e;
    --text-light: #a8a8a8;
    --text-on-dark: #ffffff;
    
    /* Feedback */
    --success: #2ecc71;
    --success-dark: #27ae60;
    --warning: #f1c40f;
    --warning-dark: #f39c12;
    --error: #e74c3c;
    --error-dark: #c0392b;
    --info: #3498db;
    --info-dark: #2980b9;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.18);
    
    /* Bordas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transições */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Espaçamentos */
    --space-xs: 3px;
    --space-sm: 5px;
    --space-md: 10px;
    --space-lg: 15px;
    --space-xl: 20px;
    --space-2xl: 30px;
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: var(--space-sm);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: var(--space-md);
}

small {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Links e Botões Base */
a, button {
    color: inherit;
    font-family: inherit;
    transition: var(--transition-fast);
}

button {
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
}

button:focus-visible {
    outline: 2px solid var(--instagram-blue);
    outline-offset: 2px;
}

/* Layout Principal - HEADER MODIFICADO */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--space-lg) var(--space-lg);
    backdrop-filter: blur(10px);
    text-align: center; /* Centralizado */
}

.header-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column; /* Empilhado */
    align-items: center;
    gap: var(--space-xs);
}

.logo {
    font-weight: 800; /* Mais pesado */
    font-size: 4rem; /* Muito maior */
    background: var(--instagram-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradient 3s ease infinite;
    line-height: 1;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.logo-subtitle {
    font-size: 2rem; /* Maior */
    color: var(--text-secondary);
    font-weight: 500;
}

/* REMOVIDO: user-actions e btn-icon */

/* Hero - ALTURA AUMENTADA */
.hero-image {
    width: 100%;
    height: 350px; /* Aumentado de 280px */
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
                url('https://postai.rede73.com.br/assets/banner.JPG');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.hero-content {
    max-width: 500px;
}

.hero-title {
    font-size: 2rem; /* Aumentado */
    font-weight: 700;
    color: var(--text-on-dark);
    margin-bottom: var(--space-2xl);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.125rem; /* Aumentado */
    color: rgba(255, 255, 255, 0.9);
    opacity: 0.9;
}

/* Conteúdo Principal */
.main-content {
    max-width: 600px;
    margin: 0 auto;
    margin-top: -20px; /* ADICIONE ESTA LINHA - reduz espaço acima */
    padding: 0 var(--space-lg);
}

.content-section {
    display: none;
    animation: fadeIn 0.5s var(--transition-normal);
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards de Produto - NOVO DESIGN COM VALOR AO LADO */

/* REDUÇÃO ESPECÍFICA PARA SEÇÃO DE PRODUTOS */
#productsSection .form-header {
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
}

/* Nas outras seções (form, results, payment) mantém o normal */
#formSection .form-header,
#resultsSection .form-header,
#paymentSection .form-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
}


.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md); /* Reduzido de var(--space-lg) */
    margin-top: var(--space-lg); /* Reduzido de var(--space-xl) */
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md); /* Ainda menor padding */
    border: 2px solid var(--instagram-purple);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 90px; /* Altura muito reduzida */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--instagram-purple);
}

.product-card.selected {
    border-color: var(--instagram-purple);
    box-shadow: 0 0 0 2px rgba(131, 58, 180, 0.2);
}

/* Cabeçalho do card: Ícone + Título na mesma linha */
.product-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.product-icon {
    font-size: 1.5rem; /* Ainda menor */
    background: var(--instagram-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-grow: 1;
}

/* CORPO DO CARD: Descrição e valor lado a lado (70%-30%) */
.product-card-body {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    flex-grow: 1;
    margin-bottom: var(--space-xs);
}

.product-description {
    font-size: 1rem; /* Menor fonte */
    color: var(--text-secondary);
    line-height: 1.3;
    flex: 0 0 70%; /* 70% da largura */
    max-width: 70%;
    margin: 0; /* Remove margem inferior */
}

.product-price-container {
    flex: 0 0 30%; /* 30% da largura */
    max-width: 30%;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
}

.product-price {
    font-size: 1.5rem; /* Menor que antes */
    font-weight: 700;
    color: var(--instagram-purple);
    line-height: 1;
}

.product-price::before {
    content: 'R$ ';
    font-size: 0.75rem;
    font-weight: 500;
}

.product-price-hint {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 2px;
}


/* Contêineres de Formulário */
.form-container, .payment-container {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-lg); /* Reduzido de var(--space-xl) */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg); /* Reduzido de var(--space-xl) */
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm); /* Mínimo possível */
    padding-bottom: var(--space-xs); /* Mínimo */
}

.form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Grupos de Input */
.input-group {
    margin-bottom: var(--space-xl);
}

.input-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.textarea-wrapper {
    position: relative;
}

.textarea-intelligent {
    width: 100%;
    min-height: 120px;
    padding: var(--space-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition-normal);
    background: var(--bg-light);
    font-family: inherit;
}

.textarea-intelligent:focus {
    outline: none;
    border-color: var(--instagram-purple);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(131, 58, 180, 0.1);
}

.textarea-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.hint-icon {
    color: var(--instagram-blue);
}

.keywords-input {
    width: 100%;
    padding: var(--space-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-normal);
    background: var(--bg-light);
    font-family: inherit;
}

.keywords-input:focus {
    outline: none;
    border-color: var(--instagram-purple);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(131, 58, 180, 0.1);
}

.keywords-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: var(--space-xs);
}

/* Botões Principais */
.btn-primary {
    width: 100%;
    padding: var(--space-lg);
    background: var(--instagram-gradient);
    color: var(--text-on-dark);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loader */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--text-on-dark);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Seção de Resultados */
.result-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.result-content.result-blurred {
    filter: blur(10px);
    user-select: none;
    pointer-events: none;
}

.result-content.result-blurred::after {
    content: 'CONTEÚDO BLOQUEADO - REALIZE O PAGAMENTO PARA VISUALIZAR';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
    width: 90%;
    z-index: 2;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    border: 2px solid var(--instagram-purple);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.result-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-btn {
    background: var(--instagram-gradient);
    color: var(--text-on-dark);
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: var(--transition-normal);
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.copy-btn.copied {
    background: var(--success);
}

/* Seção de Pagamento */
.payment-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.payment-icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: var(--space-lg);
}

.payment-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.payment-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.payment-info {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border-color);
}

.payment-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--instagram-purple);
    text-align: center;
    margin-bottom: var(--space-sm);
}

.payment-id {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-xl);
    word-break: break-all;
    background: var(--bg-white);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.pix-code-container {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.pix-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    word-break: break-all;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.copy-pix-btn {
    width: 100%;
    padding: var(--space-md);
    background: var(--instagram-blue);
    color: var(--text-on-dark);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: var(--transition-normal);
}

.copy-pix-btn:hover {
    background: var(--info-dark);
    transform: translateY(-1px);
}

.copy-pix-btn:active {
    transform: translateY(0);
}

/* Upload Section */
.upload-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
}

.upload-label {
    display: block;
    margin-bottom: var(--space-lg);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.upload-label i {
    margin-right: var(--space-sm);
    color: var(--instagram-purple);
}

.file-input-wrapper {
    position: relative;
    margin-bottom: var(--space-lg);
}

.file-input {
    width: 100%;
    padding: var(--space-xl);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-light);
    cursor: pointer;
    transition: var(--transition-normal);
    display: block;
}

.file-input:hover {
    border-color: var(--instagram-purple);
    background: rgba(131, 58, 180, 0.05);
}

.file-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
}

.upload-icon {
    font-size: 2rem;
    color: var(--instagram-purple);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-top: var(--space-sm);
}

.btn-upload {
    width: 100%;
    padding: var(--space-lg);
    background: var(--success);
    color: var(--text-on-dark);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: var(--transition-normal);
}

.btn-upload:hover:not(:disabled) {
    background: var(--success-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-upload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status OCR */
.ocr-status {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: none;
    animation: slideIn 0.3s var(--transition-normal);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ocr-status.processing {
    background: rgba(241, 196, 15, 0.1);
    color: var(--warning-dark);
    border: 1px solid rgba(241, 196, 15, 0.3);
    display: block;
}

.ocr-status.success {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success-dark);
    border: 1px solid rgba(46, 204, 113, 0.3);
    display: block;
}

.ocr-status.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-dark);
    border: 1px solid rgba(231, 76, 60, 0.3);
    display: block;
}

/* FOOTER REMOVIDO - APAGUEI TODO O CSS DO FOOTER */

/* Utilitários */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

/* Responsividade Extra */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .header {
        padding: var(--space-md);
    }
    
    .logo {
        font-size: 5rem;
    }
    
    .logo-subtitle {
        font-size: 1rem;
    }
    
@media (max-width: 480px) {  
    .hero-image {
        /* Resetamos a altura fixa para que a proporção comande */
        height: auto;
        min-height: auto; 
        
        /* Criamos o espaço exato da proporção da sua imagem (830/1804) */
        aspect-ratio: 1804 / 830; 
        
        width: 100%;
        background-size: 100% 100%; /* Força a imagem a colar nas bordas */
        background-attachment: scroll;
        background-position: center;
        
        padding: var(--space-md);
        margin-bottom: var(--space-xl);
    }
}

    .main-content {
        padding: 0 var(--space-md);
    }
    
    .form-container, 
    .payment-container {
        padding: var(--space-lg);
    }
    
    .payment-amount {
        font-size: 2rem;
    }
}

/* Animações de Notificação */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes notificationSlideOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Acessibilidade - Modo Alto Contraste */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
        --bg-light: #ffffff;
    }
    
    .btn-primary,
    .copy-btn,
    .copy-pix-btn,
    .btn-upload {
        border: 2px solid #000000;
    }
}

/* Acessibilidade - Redução de Movimento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* Seta de voltar - APENAS ÍCONE ROXO MAIOR */
.back-to-products {
    color: var(--instagram-purple) !important; /* Roxo puro */
    font-size: 1.5rem; /* 50% maior (era 1rem) */
    background: none !important; /* Sem fundo */
    border: none !important; /* Sem borda */
    padding: 8px; /* Espaço para clique */
    width: auto; /* Largura automática */
    height: auto; /* Altura automática */
    min-width: 44px; /* Área de toque mínima */
    min-height: 44px; /* Área de toque mínima */
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-products:hover {
    color: #6a2d9c !important; /* Roxo mais escuro no hover */
    transform: scale(1.1); /* Aumenta 10% no hover */
    background: rgba(131, 58, 180, 0.05); /* Leve fundo no hover */
    border-radius: 50%; /* Círculo sutil no hover */
}

.back-to-products:active {
    transform: scale(1); /* Volta ao normal ao clicar */
}

/* Remove qualquer estilo residual de .btn-icon */
.back-to-products.btn-icon {
    background: none;
    border: none;
}