/* ==========================================================================
   Sistema AI — página Contratar (contratar.html)
   --------------------------------------------------------------------------
   Arquivo separado do sistema.css de propósito: só esta página usa, e assim
   a publicação dela não obriga a trocar o `?v=` do CSS em todas as outras.
   Usa os mesmos tokens (cores, fontes, raios) do sistema.css.
   ========================================================================== */

.contratar-topo { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.contratar-topo h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); margin-bottom: 1rem; }
.contratar-topo h1 em { font-style: italic; color: var(--acento); }
.contratar-topo .chamada { margin-bottom: 0; }

/* ---------- etapas ---------- */

.etapas {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    list-style: none;
    padding: 0;
    margin: 1.75rem 0 0;
    font-size: var(--t-sm);
    color: var(--texto-fraco);
}
.etapas li { display: inline-flex; align-items: center; gap: .5rem; }
.etapas li span {
    display: grid; place-items: center;
    width: 1.6rem; height: 1.6rem;
    border-radius: 50%;
    border: 1px solid var(--borda-forte);
    font-family: var(--mono);
    font-size: var(--t-xs);
    font-weight: 600;
}
.etapas li[aria-current="step"] { color: var(--texto); font-weight: 600; }
.etapas li[aria-current="step"] span { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.etapas li.feita span { border-color: var(--acento); color: var(--acento); }

/* ---------- periodicidade ---------- */

.periodo-linha {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.periodo-linha h2 { margin: 0; font-size: var(--t-2xl); }
.periodo {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--borda-forte);
    border-radius: 999px;
    background: var(--superficie);
}
.periodo button {
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 600;
    padding: .5rem 1.1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--texto-fraco);
    cursor: pointer;
}
.periodo button[aria-pressed="true"] { background: var(--acento); color: var(--sobre-acento); }
.periodo button:not([aria-pressed="true"]):hover { color: var(--texto); }

.filtro-aviso { margin: 1rem 0 0; font-size: var(--t-sm); color: var(--texto-fraco); }
.filtro-aviso button {
    font: inherit;
    padding: 0;
    border: 0;
    background: none;
    color: var(--acento);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* ---------- cartões de plano (herdam .plano do sistema.css) ---------- */

.planos-contratar { margin-top: 1.75rem; }
/* Uma seção por tipo de plano (Usinas, Clínica…), cada uma com a sua grade. */
.planos-secao + .planos-secao { margin-top: 2.5rem; }
.planos-secao .grupo-titulo { margin-top: 0; }
.planos-secao .planos { margin-top: 1rem; }
/* auto-fill, e não o auto-fit da grade geral: um plano sozinho na seção
   (Usinas) ocupa UMA coluna, do tamanho dos outros, em vez de se esticar
   pela largura toda. */
.planos-secao .planos:not(.planos-4) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.plano-funcao {
    font-family: var(--mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--acento);
    margin: 0 0 .4rem;
}
/* Degustação: a porta de entrada, com borda tracejada para não parecer mais um preço. */
.plano-degustacao {
    border-style: dashed;
    border-color: var(--acento);
}
.plano-escolhido {
    border-color: var(--acento);
    box-shadow: 0 0 0 2px var(--acento), var(--sombra-alta);
}
.plano-economia {
    display: inline-block;
    margin: 0 0 1rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--vital-tenue, var(--acento-tenue));
    color: var(--acento);
    font-size: var(--t-xs);
    font-weight: 600;
}
/* Crédito de IA incluso: numa linha própria, logo abaixo do preço. */
.plano-credito {
    display: block;
    margin: 0 0 1rem;
    padding: .35rem .7rem;
    border-radius: 10px;
    border: 1px dashed var(--acento);
    color: var(--texto);
    font-size: var(--t-xs);
    font-weight: 600;
}
.plano .lista-checa li { font-size: var(--t-sm); }
.plano-garantia-detalhe { display: block; font-size: var(--t-xs); color: var(--texto-fraco); }

.carregando, .falha-caixa {
    margin-top: 1.75rem;
    padding: 1.5rem;
    border: 1px dashed var(--borda-forte);
    border-radius: var(--raio);
    color: var(--texto-fraco);
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

/* ---------- formulário ---------- */

.contratar-form-grade {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}
@media (max-width: 860px) { .contratar-form-grade { grid-template-columns: 1fr; } }

.caixa {
    padding: clamp(1.25rem, 3vw, 2rem);
    background: var(--superficie);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
}
.caixa h2, .caixa h3 { font-size: var(--t-xl); }

.resumo-plano {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .9rem 1.1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--raio-sm);
    background: var(--acento-tenue);
    font-size: var(--t-sm);
}
.resumo-plano strong { font-size: var(--t-base); }
.resumo-plano .numero { color: var(--texto); }
.link-botao {
    font: inherit;
    font-size: var(--t-sm);
    padding: 0;
    border: 0;
    background: none;
    color: var(--acento);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.link-botao:hover { color: var(--acento-forte); }

.campo { display: grid; gap: .35rem; margin-bottom: 1.1rem; align-content: start; }
.campo label { font-size: var(--t-sm); font-weight: 600; }
.campo .opcional { font-weight: 400; color: var(--texto-fraco); }
.campo input {
    width: 100%;
    min-width: 0;
    font: inherit;
    font-size: var(--t-base);            /* 16px: o iPhone não dá zoom ao focar */
    padding: .75rem .9rem;
    border: 1px solid var(--borda-forte);
    border-radius: var(--raio-sm);
    background: var(--superficie-2);
    color: var(--texto);
}
.campo input:focus { outline: 2px solid var(--acento); outline-offset: 1px; border-color: var(--acento); }
.campo input[aria-invalid="true"] { border-color: var(--ambar); }
.campo-ajuda { font-size: var(--t-xs); color: var(--texto-fraco); margin: 0; }
.campo-erro { font-size: var(--t-xs); color: var(--ambar); margin: 0; font-weight: 600; }
.campos-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 560px) { .campos-2 { grid-template-columns: 1fr; } }

.aceite {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: .6rem;
    align-items: start;
    margin: .5rem 0 1.25rem;
    font-size: var(--t-sm);
}
.aceite input { width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--acento); }

.aviso {
    margin: 1rem 0 0;
    padding: .9rem 1.1rem;
    border-left: 2px solid var(--ambar);
    background: color-mix(in srgb, var(--ambar-cheio) 9%, transparent);
    border-radius: 0 var(--raio-sm) var(--raio-sm) 0;
    font-size: var(--t-sm);
    color: var(--texto);
    max-width: none;
}
.aviso .botao { margin-top: .75rem; }
.aviso-ok {
    border-left-color: var(--acento);
    background: var(--acento-tenue);
}

.botao[disabled], .botao[aria-disabled="true"] { opacity: .6; cursor: progress; transform: none; }
.botao-largo { width: 100%; }

.pagamento-nota {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .8rem 0 0;
    font-size: var(--t-xs);
    color: var(--texto-fraco);
    max-width: none;
}
.pagamento-nota svg { width: 16px; height: 16px; flex: none; color: var(--acento); }

.lado-explica h3 { font-family: var(--texto-fonte); font-size: var(--t-base); margin-bottom: .6rem; }
.lado-explica ol {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: .6rem;
    font-size: var(--t-sm);
    color: var(--texto-fraco);
}
.lado-explica ol strong { color: var(--texto); }

/* ---------- retorno do pagamento ---------- */

.status-caixa { max-width: 760px; margin-inline: auto; }
.status-caixa h2 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem); }
.status-linha { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.status-linha h2 { margin: 0; }
.girando {
    width: 26px; height: 26px;
    flex: none;
    border-radius: 50%;
    border: 3px solid var(--acento-tenue);
    border-top-color: var(--acento);
    animation: girar .9s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .girando { animation-duration: 3s; } }
.status-icone {
    width: 34px; height: 34px;
    flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--acento);
    color: var(--sobre-acento);
}
.status-icone svg { width: 20px; height: 20px; }
.status-icone.ruim { background: var(--ambar-cheio); color: #fff; }

.chave-caixa {
    margin: 1.25rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--borda-forte);
    border-radius: var(--raio-sm);
    background: var(--superficie-2);
}
.chave-rotulo {
    font-size: var(--t-xs);
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--texto-fraco);
    font-weight: 600;
    margin: 0 0 .45rem;
}
.chave-linha { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.chave-valor {
    flex: 1 1 14rem;
    min-width: 0;
    font-family: var(--mono);
    font-size: var(--t-md);
    font-weight: 600;
    overflow-wrap: anywhere;
    user-select: all;
}
.chave-caixa .campo-ajuda { margin-top: .6rem; }

.ativar {
    margin: 1.25rem 0;
    padding: 1.1rem;
    border-radius: var(--raio-sm);
    border: 1px solid color-mix(in srgb, #25D366 45%, transparent);
    background: color-mix(in srgb, #25D366 9%, transparent);
}
.ativar p { font-size: var(--t-sm); margin: .75rem 0 0; }
.botao-whatsapp { background: #25D366; color: #052E16; }
.botao-whatsapp:hover { background: #1EBE5A; color: #052E16; }
.ativado {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: 600;
    color: var(--acento);
}

/* ---------- resgate ---------- */

.resgate-grade {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}
@media (max-width: 800px) { .resgate-grade { grid-template-columns: 1fr; } }
.resgate-linha { display: flex; flex-wrap: wrap; gap: .6rem; align-items: stretch; }
.resgate-linha input { flex: 1 1 14rem; }
.resgate-linha .botao { flex: none; }
@media (max-width: 480px) { .resgate-linha .botao { width: 100%; } }
.resgate-destaque { animation: destacar 1.6s ease; }
@keyframes destacar {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acento) 60%, transparent); }
    100% { box-shadow: 0 0 0 14px transparent; }
}

/* ---------- janela do termo ---------- */

.termo-janela {
    width: min(760px, calc(100vw - 2rem));
    max-height: min(86vh, 900px);
    padding: 0;
    border: 1px solid var(--borda-forte);
    border-radius: var(--raio);
    background: var(--superficie);
    color: var(--texto);
    box-shadow: var(--sombra-alta);
}
.termo-janela[open] { display: flex; flex-direction: column; }
.termo-janela::backdrop { background: rgba(4, 14, 16, .6); backdrop-filter: blur(2px); }
.termo-cabeca {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--borda);
}
.termo-cabeca h2 { margin: 0; font-size: var(--t-lg); flex: 1; }
.termo-fechar {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    flex: none;
    border: 1px solid var(--borda);
    border-radius: 50%;
    background: transparent;
    color: var(--texto);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}
.termo-corpo {
    padding: 1.25rem;
    overflow-y: auto;
    font-size: var(--t-sm);
    color: var(--texto);
    flex: 1;
}
.termo-corpo p { white-space: pre-line; max-width: none; }
.termo-corpo h3 { font-family: var(--texto-fonte); font-size: var(--t-base); margin: 1.25rem 0 .5rem; }
.termo-versao { font-size: var(--t-xs); color: var(--texto-fraco); margin-top: 1rem; }
.termo-pe {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .6rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--borda);
}
@media (max-width: 480px) { .termo-pe .botao { flex: 1 1 100%; } }

[hidden] { display: none !important; }

/* ---------- campanha de desconto ----------
   Âmbar, não o verde do acento: o desconto precisa se destacar do resto do
   cartão, e o verde já é "escolhido" e "teste grátis". */
.campanha-faixa {
    display: grid;
    gap: .75rem;
    margin: 1rem 0 1.5rem;
}
.campanha-faixa-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--raio);
    background: linear-gradient(100deg, color-mix(in srgb, var(--ambar-cheio) 16%, var(--superficie)), var(--superficie) 70%);
    border: 1px solid color-mix(in srgb, var(--ambar-cheio) 45%, var(--borda));
}
.campanha-faixa-pct {
    flex: none;
    font-family: var(--display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    line-height: 1;
    color: var(--ambar);
}
.campanha-faixa-item strong { display: block; font-size: var(--t-md); }
.campanha-faixa-chamada { display: block; font-size: var(--t-sm); }
.campanha-faixa-prazo { display: block; font-size: var(--t-xs); color: var(--texto-fraco); margin-top: .15rem; }

.plano-campanha { position: relative; border-color: color-mix(in srgb, var(--ambar-cheio) 60%, var(--borda)); }
.plano-fita {
    position: absolute;
    top: -.8rem;
    right: 1rem;
    max-width: calc(100% - 2rem);
    padding: .25rem .7rem;
    border-radius: 999px;
    background: var(--ambar);
    color: var(--superficie);   /* branco no claro, escuro no escuro: contraste nos dois */
    font-size: var(--t-xs);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--ambar-cheio) 70%, transparent);
}
.plano-campanha .plano-etiqueta { left: 1rem; right: auto; }
.plano-de { margin: .25rem 0 -.25rem; font-size: var(--t-sm); color: var(--texto-fraco); }
.plano-de s { text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--ambar-cheio) 80%, transparent); }
.plano-economia-campanha {
    background: color-mix(in srgb, var(--ambar-cheio) 14%, transparent);
    color: var(--ambar);
}

.demonstrativo {
    flex-basis: 100%;
    margin-top: .5rem;
    padding: .8rem 1rem;
    border-radius: var(--raio-sm);
    background: var(--superficie);
    border: 1px solid var(--borda);
}
.demo-linha { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; }
.demo-linha span:last-child { white-space: nowrap; }
.demo-desconto { color: var(--ambar); }
.demo-total { border-top: 1px solid var(--borda); margin-top: .3rem; padding-top: .45rem; font-weight: 700; }
.demo-nota { margin: .45rem 0 0; font-size: var(--t-xs); color: var(--texto-fraco); }
.demo-economia { margin: .3rem 0 0; font-size: var(--t-sm); font-weight: 700; color: var(--ambar); }
