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

:root {
    --navy:       #1B2A5E;
    --navy-dark:  #0F1A3E;
    --navy-light: #2A3F7E;
    --gold:       #B8942A;
    --gold-light: #D4AF50;
    --gold-pale:  #F7F0DC;
    --bg:         #F2F4F8;
    --white:      #FFFFFF;
    --text:       #1A1A2E;
    --text-light: #6B7280;
    --border:     #E5E7EB;
    --red:        #DC2626;
    --green:      #059669;
    --radius:     14px;
    --radius-sm:  8px;
    --shadow:     0 4px 20px rgba(27, 42, 94, 0.10);
    --shadow-sm:  0 2px 8px rgba(27, 42, 94, 0.07);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

header {
    background: var(--navy);
    padding: 0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.header-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.2);
}

.header-text h1 {
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.header-text p {
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
    margin-top: 2px;
}

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

.hero {
    text-align: center;
    padding: 48px 24px 0;
}

.hero-tag {
    display: inline-block;
    background: var(--gold-pale);
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 99px;
    margin-bottom: 16px;
}

.hero h2 {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.025em;
    margin-bottom: 10px;
    line-height: 1.15;
}

.hero p {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px 72px;
}

/* ============================================================
   INPUT CARD
   ============================================================ */

.input-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px;
    margin-bottom: 28px;
}

.input-card label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 14px;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.input-group {
    display: flex;
    flex: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s;
}

.input-group:focus-within {
    border-color: var(--navy);
}

.input-group.erro {
    border-color: var(--red);
    animation: shake 0.35s ease;
}

.input-prefix {
    background: var(--bg);
    padding: 0 18px;
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--text-light);
    font-size: 1rem;
    border-right: 2px solid var(--border);
    white-space: nowrap;
}

input#receita-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 18px;
    font-size: 1.3rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text);
    background: transparent;
    min-width: 0;
}

input#receita-input::placeholder { color: var(--border); font-weight: 400; }

.btn-calcular {
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 15px 36px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.btn-calcular:hover  { background: var(--gold); box-shadow: 0 4px 12px rgba(184,148,42,0.35); }
.btn-calcular:active { transform: scale(0.97); }

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-7px); }
    60%      { transform: translateX(7px); }
}

/* ============================================================
   RESULTS
   ============================================================ */

#results { display: none; }

#results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

/* ============================================================
   RESULT CARD
   ============================================================ */

.result-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.result-card-header {
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--border);
}

.card-tag {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 5px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.2;
}

.card-subtitle {
    font-size: 0.79rem;
    color: var(--text-light);
    margin-top: 3px;
}

/* Barra de imposto */
.tax-bar-wrapper {
    padding: 18px 26px 0;
}

.tax-bar-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.tax-bar-meta span:first-child { color: var(--text-light); }
.tax-bar-meta span:last-child  { color: var(--text); font-weight: 700; }

.tax-bar-track {
    background: var(--bg);
    border-radius: 99px;
    height: 9px;
    overflow: hidden;
}

.tax-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--gold), #E8C040);
    width: 0%;
    transition: width 0.7s cubic-bezier(.4,0,.2,1);
}

/* Card body */
.card-body {
    padding: 20px 26px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.line-item:last-of-type { border-bottom: none; }

.line-item.total {
    border-top: 2px solid var(--navy);
    border-bottom: none;
    margin-top: 6px;
    padding-top: 14px;
}

.line-label {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.4;
}

.line-label.neg::before  { content: '(−) '; color: var(--red); }
.line-label.pos::before  { content: '(+) '; color: var(--green); }

.line-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.line-value.neg    { color: var(--red); }
.line-value.pos    { color: var(--green); }
.line-value.total  { font-size: 1.25rem; font-weight: 800; color: var(--navy); }

/* Info box */
.info-box {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-top: auto;
    padding-top: 14px;
}

.info-box-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-light);
    padding: 4px 0;
    gap: 8px;
}

.info-line strong,
.info-line .val { font-weight: 600; color: var(--text); white-space: nowrap; }
.info-line .val-red { font-weight: 600; color: var(--red); white-space: nowrap; }

/* Erro Simples */
#cnpj-erro {
    display: none;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--red);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ============================================================
   BANNER ECONOMIA
   ============================================================ */

.banner-economia {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    border-radius: var(--radius);
    padding: 36px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}

.banner-economia.desvantagem {
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
}

.banner-left { flex: 1; min-width: 0; }

.banner-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.banner-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.banner-value {
    color: var(--white);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.banner-suffix {
    display: inline-block;
    color: rgba(255,255,255,0.55);
    font-size: 1rem;
    font-weight: 400;
    margin-left: 6px;
    letter-spacing: 0;
}

.banner-anual {
    margin-top: 10px;
    color: rgba(255,255,255,0.5);
    font-size: 0.88rem;
}

.banner-anual strong { color: var(--gold-light); }

.banner-right {
    flex-shrink: 0;
    text-align: center;
}

.banner-icon {
    font-size: 4rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

/* ============================================================
   NOTA DE RODAPÉ
   ============================================================ */

.nota-rodape {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px 28px;
    box-shadow: var(--shadow-sm);
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.7;
    border-left: 4px solid var(--gold);
}

.nota-rodape strong { color: var(--navy); }

.nota-rodape p + p { margin-top: 6px; }

/* ============================================================
   CTA — ABRIR EMPRESA
   ============================================================ */

.cta-empresa {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
    border-radius: var(--radius);
    padding: 40px 40px;
    margin-top: 22px;
    box-shadow: var(--shadow);
}

.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.cta-text { flex: 1; }

.cta-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 8px;
}

.cta-text h3 {
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.cta-text p {
    color: rgba(255,255,255,0.65);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 480px;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: var(--white);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
    letter-spacing: 0.01em;
}

.btn-whatsapp:hover  { background: #1DA851; box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45); }
.btn-whatsapp:active { transform: scale(0.97); }

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

.site-footer {
    background: var(--navy-dark);
    margin-top: 0;
}

.footer-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 52px 28px 40px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 56px;
    align-items: start;
}

.footer-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    margin-bottom: 18px;
    display: block;
    /* Filtro para logo ficar branca/clara no fundo escuro */
    filter: brightness(0) invert(1);
}

.footer-desc {
    color: rgba(255,255,255,0.55);
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 360px;
}

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

.footer-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 14px;
}

.footer-section p {
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 0;
    transition: color 0.2s;
    line-height: 1.8;
}

.footer-link:hover { color: var(--gold-light); }
.footer-link svg   { flex-shrink: 0; opacity: 0.7; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    max-width: 1140px;
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-bottom span {
    color: rgba(255,255,255,0.3);
    font-size: 0.78rem;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 720px) {
    .hero h2       { font-size: 1.6rem; }
    .hero          { padding-top: 36px; }
    .container     { padding: 0 16px 56px; }
    .input-card    { padding: 24px 20px; }
    .input-row     { flex-direction: column; }
    .input-group   { border-radius: var(--radius-sm); }
    .btn-calcular  { width: 100%; padding: 15px; }

    #results-grid {
        grid-template-columns: 1fr;
    }

    .banner-economia {
        flex-direction: column;
        padding: 28px 24px;
        text-align: center;
        gap: 16px;
    }

    .banner-value  { font-size: 2.2rem; }
    .banner-right  { display: none; }

    .header-inner  { padding: 14px 16px; }
    .header-text h1 { font-size: 0.95rem; }
    .header-divider { display: none; }

    .cta-empresa   { padding: 28px 20px; }
    .cta-inner     { flex-direction: column; text-align: center; gap: 24px; }
    .cta-text p    { max-width: 100%; }
    .btn-whatsapp  { width: 100%; justify-content: center; }

    .footer-inner  { grid-template-columns: 1fr; gap: 32px; padding: 40px 16px 32px; }
    .footer-info   { grid-template-columns: 1fr 1fr; }
    .footer-bottom { padding: 16px; flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .hero h2       { font-size: 1.4rem; }
    .logo          { height: 38px; }
    .footer-info   { grid-template-columns: 1fr; }
    .cta-text h3   { font-size: 1.2rem; }
}
