/* ==========================================================================
   Ferramentas B20 — Business Model Canvas e Simulador de SERP
   Reaproveita as variaveis e classes do style.css (container, btn, section-header).
   ========================================================================== */

/* ---------- Hero das ferramentas ----------
   As paginas de servico preenchem a 2a coluna do .page-hero com uma ilustracao.
   As ferramentas nao tem imagem, entao a coluna ficava vazia e o texto espremido
   nos 600px do .page-hero-text. Aqui a hero volta a ocupar a largura toda. */
.tool-hero .page-hero-content {
    grid-template-columns: 1.35fr 0.9fr;
    align-items: center;
}

.tool-hero .page-hero-text {
    max-width: 780px;
}

.tool-hero h1 {
    max-width: 15ch;
}

.tool-hero .page-hero-desc {
    max-width: 62ch;
}

.tool-hero-side {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.tool-hero-side h2 {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 18px;
}

.tool-facts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.tool-facts li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: .92rem;
    color: #334155;
    line-height: 1.45;
}

.tool-facts i {
    color: var(--blue);
    margin-top: 3px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .tool-hero .page-hero-content {
        grid-template-columns: 1fr;
    }

    .tool-hero h1,
    .tool-hero .page-hero-desc,
    .tool-hero .page-hero-text {
        max-width: none;
    }
}

/* ---------- Hub de ferramentas ---------- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 40px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--blue);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}

.tool-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.tool-card h3 {
    font-size: 1.25rem;
    margin: 0 0 10px;
}

.tool-card p {
    color: #64748b;
    margin: 0 0 24px;
    flex: 1;
}

.tool-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tool-tag {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 5px 12px;
}

/* ---------- Barra de acoes das ferramentas ---------- */
.tool-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.tool-bar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-bar input[type=text] {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .95rem;
    font-family: inherit;
    min-width: 260px;
}

.tool-bar input[type=text]:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}

.tool-status {
    font-size: .85rem;
    color: #94a3b8;
    min-height: 1.2em;
}

/* ==========================================================================
   Business Model Canvas
   ========================================================================== */
.bmc-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-auto-rows: minmax(190px, auto);
    gap: 12px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.bmc-block {
    background: #fff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Colunas do canvas classico: 5 blocos no topo, 2 na base. */
.bmc-parcerias      { grid-column: 1 / 3;  grid-row: 1 / 3; }
.bmc-atividades     { grid-column: 3 / 5;  grid-row: 1 / 2; }
.bmc-recursos       { grid-column: 3 / 5;  grid-row: 2 / 3; }
.bmc-valor          { grid-column: 5 / 7;  grid-row: 1 / 3; }
.bmc-relacionamento { grid-column: 7 / 9;  grid-row: 1 / 2; }
.bmc-canais         { grid-column: 7 / 9;  grid-row: 2 / 3; }
.bmc-segmentos      { grid-column: 9 / 11; grid-row: 1 / 3; }
.bmc-custos         { grid-column: 1 / 6;  grid-row: 3 / 4; }
.bmc-receita        { grid-column: 6 / 11; grid-row: 3 / 4; }

.bmc-valor {
    background: #f8fafc;
}

.bmc-block-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.bmc-block-head i {
    color: var(--blue);
    font-size: .9rem;
}

.bmc-block-head h3 {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0;
    color: #0f172a;
}

.bmc-hint {
    font-size: .74rem;
    color: #94a3b8;
    margin: 0 0 10px;
    line-height: 1.35;
}

.bmc-field {
    flex: 1;
    font-size: .875rem;
    line-height: 1.5;
    color: #334155;
    outline: none;
    overflow-wrap: break-word;
    /* O texto e restaurado com textContent; pre-wrap preserva as quebras de linha. */
    white-space: pre-wrap;
    border-radius: 6px;
    padding: 4px;
    min-height: 60px;
}

.bmc-field:focus {
    box-shadow: 0 0 0 2px var(--blue);
}

.bmc-field:empty::before {
    content: attr(data-placeholder);
    color: #cbd5e1;
    pointer-events: none;
}

/* Impresso e no PDF, o cabecalho do documento */
.bmc-print-head {
    display: none;
}

@media (max-width: 1024px) {

    /* Empilha: cada bloco ocupa a largura toda, na ordem de leitura do canvas. */
    .bmc-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .bmc-grid > .bmc-block {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        min-height: 150px;
    }
}

/* ==========================================================================
   Simulador de SERP
   ========================================================================== */
.serp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 980px) {
    .serp-layout {
        grid-template-columns: 1fr;
    }
}

/* --- Coluna esquerda: a pagina de resultados simulada --- */
.serp-screen {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.serp-chrome {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.serp-dots {
    display: flex;
    gap: 6px;
}

.serp-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}

.serp-searchbar {
    flex: 1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: .85rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
}

.serp-searchbar i {
    color: #94a3b8;
}

.serp-results {
    padding: 20px 24px 28px;
}

.serp-block {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    position: relative;
}

.serp-block:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.serp-block.is-selected {
    border-color: var(--blue);
    background: #eff6ff;
}

.serp-block.is-yours {
    border-color: var(--blue);
    background: #eff6ff;
}

.serp-block.is-yours::after {
    content: 'VOCÊ';
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #fff;
    background: var(--blue);
    padding: 3px 8px;
    border-radius: 999px;
}

.serp-tag {
    display: inline-block;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.serp-tag-ad { background: #fef3c7; color: #92400e; }
.serp-tag-snippet { background: #dcfce7; color: #166534; }
.serp-tag-local { background: #dbeafe; color: #1e40af; }
.serp-tag-paa { background: #f3e8ff; color: #6b21a8; }

.serp-url {
    font-size: .78rem;
    color: #64748b;
    margin: 0 0 2px;
}

.serp-title {
    font-size: 1.05rem;
    color: #1a0dab;
    margin: 0 0 4px;
    font-weight: 500;
    line-height: 1.35;
}

.serp-desc {
    font-size: .84rem;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.serp-snippet-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    margin-top: 8px;
}

.serp-local-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.serp-local-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .84rem;
}

.serp-stars {
    color: #f59e0b;
    font-size: .78rem;
}

.serp-paa-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 4px;
    font-size: .9rem;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.serp-paa-item:last-child {
    border-bottom: none;
}

/* --- Coluna direita: controles --- */
.serp-panel {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@media (max-width: 980px) {
    .serp-panel {
        position: static;
    }
}

.serp-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
}

.serp-card h3 {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.serp-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.serp-toggle:last-of-type {
    border-bottom: none;
}

.serp-toggle input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--blue);
}

.serp-toggle-label {
    font-size: .88rem;
    font-weight: 600;
    color: #0f172a;
    display: block;
}

.serp-toggle-desc {
    font-size: .76rem;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
    line-height: 1.4;
}

.serp-meter {
    text-align: center;
    padding: 6px 0 2px;
}

.serp-meter-value {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--blue);
    line-height: 1;
    font-family: var(--font-display, inherit);
}

.serp-meter-label {
    font-size: .78rem;
    color: #64748b;
    margin-top: 6px;
}

.serp-bar {
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 16px;
}

.serp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), #1d4ed8);
    border-radius: 999px;
    transition: width .35s ease;
}

.serp-explain {
    font-size: .85rem;
    color: #475569;
    line-height: 1.6;
}

.serp-explain strong {
    color: #0f172a;
}

.serp-range {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.serp-range input[type=range] {
    flex: 1;
    accent-color: var(--blue);
}

.serp-range output {
    font-weight: 700;
    color: #0f172a;
    min-width: 26px;
    text-align: right;
}

.serp-disclaimer {
    font-size: .74rem;
    color: #94a3b8;
    line-height: 1.5;
    border-top: 1px solid #f1f5f9;
    margin-top: 16px;
    padding-top: 14px;
}

/* ==========================================================================
   Calendário de Sazonalidades
   ========================================================================== */
.cal-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.cal-filters label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.cal-filters select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .92rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    min-width: 190px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.cal-filters select:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
}

.cal-filters .cal-check {
    flex-direction: row;
    align-items: center;
    gap: 9px;
    text-transform: none;
    letter-spacing: 0;
    font-size: .88rem;
    color: #334155;
    cursor: pointer;
    align-self: flex-end;
    padding-bottom: 9px;
}

.cal-filters .cal-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--blue);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 22px;
}

.cal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.cal-card[hidden] {
    display: none;
}

.cal-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.cal-month {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--blue);
}

.cal-card-head h3 {
    font-size: 1.15rem;
    margin: 4px 0 2px;
    line-height: 1.3;
}

.cal-day {
    font-size: .82rem;
    color: #94a3b8;
    margin: 0;
}

.cal-heat {
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.cal-heat-quente { background: #fee2e2; color: #991b1b; }
.cal-heat-morna  { background: #fef3c7; color: #92400e; }
.cal-heat-fria   { background: #e0f2fe; color: #075985; }

.cal-why {
    font-size: .9rem;
    color: #475569;
    line-height: 1.55;
    margin: 0 0 16px;
}

.cal-lead {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .84rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 18px;
}

.cal-lead i {
    color: var(--blue);
}

.cal-tips {
    display: grid;
    gap: 12px;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    margin-top: auto;
}

.cal-tip[hidden] {
    display: none;
}

.cal-tip-seg {
    display: inline-block;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #475569;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 3px 8px;
    margin-bottom: 5px;
}

.cal-tip p {
    font-size: .86rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

.cal-empty {
    text-align: center;
    color: #64748b;
    padding: 60px 20px;
    background: #fff;
    border: 2px dashed #e2e8f0;
    border-radius: 14px;
}

.cal-empty i {
    display: block;
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.cal-empty[hidden] {
    display: none;
}

@media (max-width: 600px) {
    .cal-filters select {
        min-width: 100%;
    }

    .cal-filters label {
        width: 100%;
    }
}

/* ==========================================================================
   Gerador de Dados Estruturados
   ========================================================================== */
.sg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

@media (max-width: 1024px) {
    .sg-layout {
        grid-template-columns: 1fr;
    }
}

.sg-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 26px;
}

.sg-sep {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 22px 0;
}

.sg-field {
    margin-bottom: 18px;
}

.sg-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #334155;
    margin-bottom: 6px;
}

.sg-req {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 4px;
    padding: 2px 6px;
    text-transform: uppercase;
}

.sg-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .92rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
}

.sg-input:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}

textarea.sg-input {
    resize: vertical;
    line-height: 1.5;
}

.sg-hint {
    font-size: .78rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 6px 0 0;
}

/* Grupos repetiveis (perguntas do FAQ, passos do HowTo, etc.) */
.sg-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
}

.sg-group-list {
    display: grid;
    gap: 14px;
    margin: 14px 0;
}

.sg-group-row {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
}

.sg-group-row .sg-field:last-child {
    margin-bottom: 0;
}

.sg-group-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: .74rem;
    font-weight: 700;
    color: #94a3b8;
}

.sg-icon-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #94a3b8;
}

.sg-icon-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Saida */
.sg-output-wrap {
    position: sticky;
    top: 100px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
}

@media (max-width: 1024px) {
    .sg-output-wrap {
        position: static;
    }
}

.sg-output-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.sg-output-head h3 {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-output-head h3 i {
    color: var(--blue);
}

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

.sg-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: .84rem;
    line-height: 1.5;
    margin: 0 0 14px;
}

.sg-warn[hidden] {
    display: none;
}

.sg-output {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    overflow-x: auto;
    max-height: 520px;
    overflow-y: auto;
    margin: 0;
}

.sg-output code {
    font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
    font-size: .8rem;
    line-height: 1.6;
    white-space: pre;
    background: none;
    color: inherit;
    padding: 0;
}

.sg-output-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.sg-output-foot p {
    font-size: .8rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
    flex: 1;
    min-width: 240px;
}

.sg-output-foot code {
    background: #f1f5f9;
    color: #334155;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: .92em;
}

/* ==========================================================================
   Impressao — regras comuns a todas as ferramentas.
   O canvas tem regras proprias em bmc-print.css.
   ========================================================================== */
@media print {
    .header,
    .skip-link,
    .breadcrumbs,
    .cta-section,
    .footer,
    footer,
    .faq-section,
    .whatsapp-float,
    #cookie-banner,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Calendário: imprime so o que sobrou do filtro, sem quebrar cards ao meio */
    .cal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8mm;
    }

    .cal-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #cbd5e1;
    }
}
