:root {
    --primary-color: #0e623b;
    --primary-dark: #0a4d2e;
    --primary-light: #148550;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* GLOBALS */
.logo-text { font-size: 24px; font-weight: 800; color: var(--primary-color); letter-spacing: -0.5px; }
.logo-text span { font-weight: 300; margin-left: 4px; }
.btn-primary { background: var(--primary-color); color: white; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: 0.3s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary-large { background: white; color: var(--primary-color); padding: 16px 32px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 16px; transition: 0.3s; display: inline-block; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.btn-primary-large:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.2); }

/* =========================================================
   PÁGINA INSTITUCIONAL (LANDING PAGE)
========================================================= */
#landing-page { width: 100%; }
.lp-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* HEADER */
.lp-header { background: white; padding: 20px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.02); position: sticky; top: 0; z-index: 50; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.lp-nav a { text-decoration: none; color: var(--text-main); font-weight: 500; margin-left: 30px; transition: 0.2s; }
.lp-nav a:hover:not(.btn-primary) { color: var(--primary-color); }

/* HERO */
.lp-hero { background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%); position: relative; padding-top: 100px; padding-bottom: 0; color: white; text-align: center; }
.hero-text { max-width: 800px; margin: 0 auto 60px auto; position: relative; z-index: 10; }
.hero-text h1 { font-size: 48px; font-weight: 800; line-height: 1.15; margin-bottom: 25px; letter-spacing: -1px; }
.hero-text h1 span { color: #86efac; }
.hero-text p { font-size: 18px; line-height: 1.6; opacity: 0.9; margin-bottom: 40px; font-weight: 300; }
.hero-wave { line-height: 0; }
.hero-wave svg { display: block; width: 100%; height: auto; }

/* FEATURES */
.lp-features { padding: 80px 0; background: var(--bg-color); }
.section-title { text-align: center; margin-bottom: 60px; max-width: 600px; margin-left: auto; margin-right: auto; }
.section-title h2 { font-size: 32px; color: var(--text-main); margin-bottom: 15px; letter-spacing: -0.5px; }
.section-title p { color: var(--text-muted); font-size: 16px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { background: white; padding: 40px 30px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); text-align: center; transition: 0.3s; border: 1px solid var(--border-color); }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); }
.icon-box { width: 64px; height: 64px; background: rgba(14, 98, 59, 0.08); color: var(--primary-color); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; }
.icon-box svg { width: 32px; height: 32px; }
.feature-card h3 { font-size: 20px; margin-bottom: 15px; color: var(--text-main); }
.feature-card p { color: var(--text-muted); line-height: 1.6; }

/* HOW IT WORKS */
.lp-how { padding: 80px 0; background: white; }
.how-flex { display: flex; align-items: center; gap: 60px; flex-wrap: wrap; }
.how-image { flex: 1; min-width: 300px; display: flex; justify-content: center; }
.mockup-qr { width: 250px; height: 280px; background: var(--bg-color); border-radius: 24px; border: 8px solid var(--text-main); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--primary-color); box-shadow: 0 20px 50px rgba(0,0,0,0.1); }
.mockup-qr svg { width: 100px; height: 100px; margin-bottom: 20px; }
.mockup-qr p { font-weight: 600; font-size: 18px; color: var(--text-main); }
.how-text { flex: 1; min-width: 300px; }
.how-text h2 { font-size: 32px; margin-bottom: 20px; color: var(--text-main); letter-spacing: -0.5px; }
.how-text p { color: var(--text-muted); font-size: 16px; line-height: 1.6; margin-bottom: 30px; }
.how-list { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.how-list li { background: var(--bg-color); padding: 15px 20px; border-radius: 12px; color: var(--text-main); border-left: 4px solid var(--primary-color); }

/* FOOTER */
.lp-footer { background: var(--text-main); color: white; padding: 60px 0 40px 0; }
.footer-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 40px; margin-bottom: 40px; }
.footer-brand p { color: #94a3b8; margin-top: 10px; max-width: 300px; }
.footer-links { text-align: right; color: #64748b; font-size: 14px; }

@media(max-width: 768px) {
    .lp-nav { display: none; }
    .hero-text h1 { font-size: 36px; }
    .footer-flex { flex-direction: column; text-align: center; }
    .footer-links { text-align: center; }
}


/* =========================================================
   APP DE BUSCA (Acesso pelo Token)
========================================================= */
#app-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.app-top-header {
    padding: 20px;
    text-align: center;
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-search-section { padding: 20px; flex: 1; display: flex; flex-direction: column;}
.search-box { position: relative; margin-bottom: 20px; display: flex; align-items: center; }
.search-box input {
    width: 100%;
    padding: 18px 85px 18px 50px;
    font-size: 16px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    outline: none;
    color: var(--text-main);
}
.search-box input:focus { border-color: var(--primary-light); box-shadow: 0 4px 25px rgba(14, 98, 59, 0.12); }
.search-box input::placeholder { color: #94a3b8; }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: #94a3b8; }

.camera-btn { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--primary-color); width: 24px; height: 24px; cursor: pointer; transition: 0.2s; }
.camera-btn:hover { color: var(--primary-dark); transform: translateY(-50%) scale(1.1); }
#clearBtn { position: absolute; right: 55px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #94a3b8; width: 20px; height: 20px; cursor: pointer; }

/* Câmera / Leitor */
#reader-container { background: var(--card-bg); border-radius: 16px; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--border-color); box-shadow: 0 4px 20px rgba(0,0,0,0.04); animation: slideUp 0.3s ease forwards; }
.reader-header { background: var(--primary-color); color: white; padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
#closeReaderBtn { background: none; border: none; color: white; width: 20px; height: 20px; cursor: pointer; }
#reader { width: 100%; min-height: 250px; background: #000; }
#reader video { width: 100% !important; border-radius: 0 0 16px 16px; }

/* Resultados */
.results-container { display: flex; flex-direction: column; gap: 15px; padding-bottom: 30px; }
.empty-state { text-align: center; color: #94a3b8; padding: 60px 20px; }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 15px; opacity: 0.5; }

.product-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    animation: slideUp 0.3s ease forwards;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.product-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-title { font-weight: 700; font-size: 16px; line-height: 1.4; color: var(--text-main); padding-right: 10px; }
.product-meta { font-size: 13px; color: var(--text-muted); display: flex; gap: 10px; align-items: center; }
.product-meta span { background: var(--bg-color); padding: 4px 8px; border-radius: 6px; }
.product-price { font-size: 28px; font-weight: 800; color: var(--primary-color); margin-top: 8px; letter-spacing: -0.5px; }

/* Loading */
.spinner { width: 36px; height: 36px; border: 3px solid rgba(14, 98, 59, 0.1); border-top-color: var(--primary-color); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Informações e Ads */
.app-info-container { padding: 0 20px 20px 20px; display: flex; flex-direction: column; gap: 15px; }

.how-it-works-box {
    background: rgba(14, 98, 59, 0.05);
    border: 1px dashed rgba(14, 98, 59, 0.3);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.how-it-works-box svg { width: 24px; height: 24px; color: var(--primary-color); flex-shrink: 0; }
.how-it-works-box p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.how-it-works-box strong { color: var(--primary-color); }

.ad-banner {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

/* Footer */
.app-bottom-footer { text-align: center; padding: 20px; font-size: 13px; color: var(--text-muted); background: var(--card-bg); border-top: 1px solid var(--border-color); margin-top: auto; }
