/* ===========================================================
   Cliniclic — formulário de teste grátis (/teste-gratis)
   Mesma anatomia do formulário instantâneo da Meta (fundo cinza,
   cards brancos, opção com rádio à direita, progresso + botão fixos
   no rodapé), com a paleta e a tipografia da LP (base.css).
   =========================================================== */

:root {
    --teal: #0fb3b3;
    --teal-deep: #0a8f93;
    --tint: #eef8f8;
    --ink: #0b1c33;
    --ink-2: #2b3d57;
    --muted: #5a6c85;
    --line: #dfe6ee;
    --danger: hsl(0 72% 50%);

    --lf-bg: #eef2f5;
    --lf-card: #ffffff;
    --lf-w: 480px;
    --r: 14px;
    --r-sm: 10px;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--lf-bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

h1,
h2,
p {
    margin: 0;
}

[hidden] {
    display: none !important;
}

/* ---------- Casca ---------- */

.lf {
    width: 100%;
    max-width: var(--lf-w);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--lf-bg);
}

/* Cabeçalho: [voltar] [progresso] [fechar]. Colunas fixas pra barra não
   pular de lugar quando o "voltar" some na primeira etapa. Fica preso no
   topo pra o progresso continuar visível ao rolar. */
.lf-top {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) 10px 8px;
    min-height: 54px;
    background: var(--lf-bg);
}

.lf-top [data-lf-back] {
    grid-column: 1;
}

.lf-top .lf-progress {
    grid-column: 2;
}

.lf-close {
    grid-column: 3;
}

.lf-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    transition: background 0.15s ease;
}

.lf-icon-btn:hover {
    background: rgb(11 28 51 / 0.06);
}

.lf-icon-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.lf-icon-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lf-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lf-body {
    flex: 1;
    padding: 6px 16px 24px;
}

.lf-step {
    display: grid;
    gap: 12px;
    animation: lf-in 0.24s ease both;
}

@keyframes lf-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lf-step {
        animation: none;
    }
}

/* ---------- Cards ---------- */

.lf-card {
    margin: 0;
    padding: 20px 18px;
    background: var(--lf-card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 1px 2px rgb(11 28 51 / 0.04);
    min-width: 0;
}

fieldset.lf-card {
    min-inline-size: 0;
}

/* <legend> por padrão fica "sentado" na borda do fieldset; float + width
   faz ele se comportar como um título normal dentro do card. */
fieldset.lf-card > legend.lf-q {
    float: left;
    width: 100%;
}

fieldset.lf-card > legend.lf-q + * {
    clear: both;
}

/* Logo em círculo "pendurado" no topo do card, como no formulário da Meta */
.lf-intro {
    position: relative;
    margin-top: 34px;
    padding-top: 46px;
    text-align: center;
}

.lf-logo {
    position: absolute;
    top: 0;
    left: 50%;
    width: 68px;
    height: 68px;
    padding: 13px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: 0 6px 18px -8px rgb(11 28 51 / 0.25);
    transform: translate(-50%, -50%);
}

.lf-intro__title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.lf-intro__text {
    margin-top: 8px;
    font-size: 15px;
    color: var(--ink-2);
}

.lf-important {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #fde68a;
    border-radius: var(--r-sm);
    background: #fef9c3;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #713f12;
    text-align: left;
}

.lf-important strong {
    font-weight: 800;
    color: #854d0e;
}

.lf-important svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    fill: none;
    stroke: #ca8a04;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lf-sent {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted);
}

.lf-sent svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--teal-deep);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Perguntas ---------- */

.lf-q {
    display: block;
    padding: 0;
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--ink);
}

.lf-q:focus,
.lf-intro__title:focus {
    outline: none;
}

.lf-sub {
    margin: -8px 0 16px;
    font-size: 14px;
    color: var(--muted);
}

.lf-options {
    display: grid;
    gap: 10px;
}

.lf-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    background: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.lf-opt:hover {
    border-color: #c4d2df;
}

/* Rádio nativo invisível, mas focável e lido pelo leitor de tela */
.lf-opt input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.lf-opt__label {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
}

.lf-opt__radio {
    flex: none;
    width: 22px;
    height: 22px;
    border: 2px solid #9aa9ba;
    border-radius: 50%;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.lf-opt:has(input:checked) {
    border-color: var(--teal);
    background: var(--tint);
}

.lf-opt input:checked ~ .lf-opt__radio {
    border-color: var(--teal-deep);
    box-shadow: inset 0 0 0 4px #fff;
    background: var(--teal-deep);
}

.lf-opt:has(input:focus-visible) {
    outline: 3px solid rgb(15 179 179 / 0.35);
    outline-offset: 2px;
}

/* ---------- Campos de texto (estilo "linha", como na Meta) ---------- */

.lf-field + .lf-field {
    margin-top: 18px;
}

.lf-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.lf-input {
    display: block;
    width: 100%;
    padding: 10px 0 9px;
    border: 0;
    border-bottom: 1.5px solid var(--line);
    border-radius: 0;
    background: transparent;
    font: inherit;
    font-size: 16px; /* 16px: o iOS não dá zoom no foco */
    color: var(--ink);
    transition: border-color 0.15s ease;
}

.lf-input::placeholder {
    color: #a3b0bf;
}

.lf-input:focus {
    outline: none;
    border-bottom-color: var(--teal);
}

.lf-input.is-invalid {
    border-bottom-color: var(--danger);
}

.lf-field-error {
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
}

.lf-field-error:not(:empty) {
    margin-top: 6px;
}

/* Honeypot fora da tela (não display:none — alguns robôs pulam esses) */
.lf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Consentimento (substitui a etapa de termos) ---------- */

.lf-consent {
    margin-top: 18px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--muted);
}

.lf-consent a {
    font-weight: 600;
    color: var(--teal-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lf-noscript {
    margin: 12px 16px;
}

.lf-noscript a {
    color: var(--teal-deep);
    font-weight: 700;
}

/* ---------- Rodapé fixo: botão ---------- */

.lf-foot {
    position: sticky;
    bottom: 0;
    padding: 12px 16px max(14px, env(safe-area-inset-bottom));
    background: linear-gradient(
        to bottom,
        rgb(238 242 245 / 0),
        var(--lf-bg) 14px
    );
}

.lf-progress {
    height: 6px;
    border-radius: 999px;
    background: #d7e0e8;
    overflow: hidden;
}

.lf-progress__bar {
    display: block;
    width: 33%;
    height: 100%;
    border-radius: inherit;
    background: var(--teal-deep);
    transition: width 0.3s ease;
}

.lf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--teal), var(--teal-deep) 90%);
    box-shadow:
        0 10px 24px -12px rgb(10 143 147 / 0.6),
        inset 0 1px 0 rgb(255 255 255 / 0.2);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        filter 0.15s ease,
        transform 0.15s ease;
}

.lf-btn:hover {
    filter: brightness(1.05);
}

.lf-btn:active {
    transform: scale(0.99);
}

.lf-btn:focus-visible {
    outline: 3px solid rgb(15 179 179 / 0.4);
    outline-offset: 2px;
}

.lf-btn:disabled {
    cursor: progress;
    filter: saturate(0.6);
    opacity: 0.85;
}

.lf-btn.is-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lf-spin 0.7s linear infinite;
}

@keyframes lf-spin {
    to {
        transform: rotate(360deg);
    }
}

.lf-alert {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid hsl(0 80% 88%);
    border-radius: var(--r-sm);
    background: hsl(0 80% 97%);
    font-size: 13.5px;
    color: #7f1d1d;
}

.lf-alert__wa {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
    color: #15803d;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Desktop: o formulário vira um "app" centralizado ---------- */

@media (min-width: 640px) {
    body {
        min-height: 100vh;
        background: #e7edf2
            radial-gradient(
                1200px 600px at 50% -10%,
                rgb(7 208 208 / 0.14),
                transparent 60%
            )
            no-repeat;
    }

    .lf {
        min-height: auto;
        margin: 40px auto;
        border: 1px solid var(--line);
        border-radius: 24px;
        box-shadow:
            0 30px 70px -28px rgb(7 16 43 / 0.25),
            0 10px 24px -14px rgb(7 16 43 / 0.12);
        overflow: clip;
    }

    .lf-form {
        min-height: 600px;
    }

    .lf-foot {
        padding-bottom: 18px;
    }
}
