:root {
    --navy:          #003c6e;
    --navy-dark:     #002850;
    --navy-light:    #e8f0f8;
    --navy-mid:      #d0e0ef;
    --orange:        #e07828;
    --orange-light:  #fdf3ea;
    --bg:            #f5f7fa;
    --surface:       #ffffff;
    --border:        #dde4ec;
    --border-strong: #c0cdd9;
    --text:          #1a2a3a;
    --text-mid:      #4a5a6a;
    --text-muted:    #7a8a9a;
    --green:         #2e8b57;
    --red:           #c0392b;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow-sm:     0 1px 4px rgba(0,40,88,0.08);
    --shadow:        0 4px 20px rgba(0,40,88,0.10);
    --shadow-lg:     0 8px 40px rgba(0,40,88,0.14);
}

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

body {
    font-family: 'Poppins', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ── Top Bar ─────────────────────────────── */
.top-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.top-bar-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand img {
    height: 48px;
    width: auto;
    display: block;
}

.top-bar-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Hero strip ───────────────────────────── */
.hero-strip {
    background: var(--navy);
    color: #fff;
    padding: 2.5rem 2rem 2.75rem;
    text-align: center;
}

.hero-strip h1 {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.6rem;
}

.hero-strip h1 em {
    font-style: normal;
    color: #7ab8e8;
}

.hero-strip p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.8px;
}

/* ── Page ────────────────────────────────── */
.page {
    flex: 1;
    max-width: 1040px;
    margin: 0 auto;
    width: 100%;
    padding: 2.5rem 2rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* ── Card ────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 2.5rem;
    box-shadow: var(--shadow);
}

/* ── Form ────────────────────────────────── */
.form-section { margin-bottom: 2.25rem; }
.form-section:last-of-type { margin-bottom: 1.25rem; }

.section-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--navy-mid);
}

.section-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--navy);
    color: #fff;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.col-span-2 { grid-column: span 2; }
.field-uf { max-width: 88px; }

label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.72rem 0.95rem;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.92rem;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
    width: 100%;
    appearance: none;
}

input::placeholder { color: var(--text-muted); font-size: 0.88rem; }

input:focus, select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(0, 60, 110, 0.10);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8a9a' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}

/* CEP inline action */
.input-with-action { display: flex; gap: 0.4rem; }
.input-with-action input { flex: 1; }

.input-btn {
    background: var(--navy-light);
    border: 1.5px solid var(--navy-mid);
    border-radius: var(--radius-sm);
    color: var(--navy);
    padding: 0 0.85rem;
    cursor: pointer;
    transition: background 0.18s;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.input-btn:hover { background: var(--navy-mid); }
.input-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Form Footer ─────────────────────────── */
.form-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.btn-cotar {
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.82rem 2.2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
    box-shadow: 0 4px 14px rgba(0,40,88,0.25);
    letter-spacing: 0.3px;
}
.btn-cotar:hover {
    background: var(--navy-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,40,88,0.32);
}
.btn-cotar:active { transform: translateY(0); }
.btn-cotar:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Tab Navigation ──────────────────────── */
.tab-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.tab-nav-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.25rem;
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.9rem 1.2rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.leads-badge {
    background: var(--orange);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* ── Loading — Radar animation ───────────── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    padding: 3.5rem 2rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Radar */
.radar-wrap {
    position: relative;
    width: 300px;
    height: 300px;
    flex-shrink: 0;
}
.radar-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 54px; height: 54px;
    background: var(--navy);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 0 rgba(0,60,110,0.4);
    animation: centerPulse 1.8s ease-out infinite;
    z-index: 10;
}
@keyframes centerPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,60,110,0.4); }
    70%  { box-shadow: 0 0 0 18px rgba(0,60,110,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,60,110,0); }
}

.radar-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    border-radius: 50%;
    border: 1.5px solid var(--navy-mid);
    animation: radarExpand 3s ease-out infinite;
    opacity: 0;
}
.r1 { width: 90px;  height: 90px;  animation-delay: 0s;    }
.r2 { width: 170px; height: 170px; animation-delay: 0.6s;  }
.r3 { width: 250px; height: 250px; animation-delay: 1.2s;  }
@keyframes radarExpand {
    0%   { opacity: 0.7; transform: translate(-50%,-50%) scale(0.6); }
    100% { opacity: 0;   transform: translate(-50%,-50%) scale(1);   }
}

/* SVG linhas */
.radar-lines {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.radar-line {
    stroke: var(--navy-mid);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
    opacity: 0.5;
}
.radar-line.active { stroke: var(--navy); opacity: 1; stroke-dasharray: none; }
.radar-line.done   { stroke: var(--green); opacity: 1; stroke-dasharray: none; }

/* Nós das seguradoras */
.radar-node {
    position: absolute;
    top: 50%; left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transform: translate(-50%,-50%)
               rotate(var(--angle))
               translateY(-115px)
               rotate(calc(-1 * var(--angle)));
    z-index: 10;
}
.rn-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--navy-mid);
    border: 2px solid var(--border-strong);
    transition: all 0.4s ease;
}
.radar-node span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.4s;
}
.radar-node.active .rn-dot {
    background: var(--navy);
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(0,60,110,0.2);
    animation: dotPulse 0.8s ease infinite alternate;
}
.radar-node.active span { color: var(--navy); }
.radar-node.done .rn-dot { background: var(--green); border-color: var(--green); box-shadow: none; }
.radar-node.done span    { color: var(--green); }
@keyframes dotPulse {
    from { transform: scale(1); }
    to   { transform: scale(1.3); }
}

/* Mensagem e barra */
.loading-msg {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-mid);
    min-height: 1.4em;
    transition: opacity 0.3s;
}
.loading-bar-wrap {
    width: 260px;
    height: 4px;
    background: var(--navy-mid);
    border-radius: 4px;
    overflow: hidden;
}
.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--navy), var(--orange));
    border-radius: 4px;
    transition: width 0.8s ease;
}

/* ── Leads page ──────────────────────────── */
.leads-page {
    max-width: 1040px;
    margin: 2rem auto;
    padding: 0 2rem 4rem;
}
.leads-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.leads-header h2 { font-size: 1.25rem; color: var(--text); margin-bottom: 0.2rem; }
.leads-subtitle   { font-size: 0.82rem; color: var(--text-muted); }
.leads-actions { display: flex; gap: 0.6rem; }

.leads-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.leads-table thead tr {
    background: var(--navy);
    color: #fff;
}
.leads-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.leads-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.leads-table tbody tr:last-child td { border-bottom: none; }
.leads-table tbody tr:hover td { background: var(--navy-light); }
.leads-table tbody tr:nth-child(even) td { background: var(--bg); }
.leads-table tbody tr:nth-child(even):hover td { background: var(--navy-light); }

.leads-empty td {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-style: italic;
}
.lead-price      { font-weight: 600; color: var(--text); }
.lead-price.best { color: var(--green); }
.lead-unavail    { color: var(--text-muted); font-size: 0.78rem; }
.lead-badge-best {
    display: inline-block;
    background: #edfaf3;
    color: var(--green);
    border: 1px solid #a8d5b8;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
}
.lead-hora { color: var(--text-muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* ── Results ─────────────────────────────── */
.results {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.35s ease;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.results-header h2 { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.results-header-actions { display: flex; gap: 0.6rem; }

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-mid);
    padding: 0.45rem 1.1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

/* ── Result Card ─────────────────────────── */
.result-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    animation: slideUp 0.4s ease-out both;
    box-shadow: var(--shadow-sm);
}
.result-card:nth-child(2) { animation-delay: 0.07s; }
.result-card:nth-child(3) { animation-delay: 0.14s; }

.result-card.winner {
    border-color: var(--navy);
    box-shadow: 0 0 0 1px var(--navy), var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}

/* Logo oficial da seguradora, servido de frontend/img/seguradoras/. `contain`
   porque as marcas nao tem a mesma proporcao: a da Tokio e a da Too sao largas e
   `cover` cortaria pedaco delas. O texto que sobrou aqui e o do `alt`, que so
   aparece se o arquivo faltar. */
.insurer-logo {
    width: 42px;
    height: 42px;
    padding: 2px;
    border-radius: 9px;
    background: #fff;
    border: 1px solid var(--border);
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-mid);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.insurer-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.insurer-type { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }

.card-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-mid);
    line-height: 1.1;
    margin-top: 0.25rem;
}
.card-price.has-value { color: var(--navy); }

.card-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.card-status {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75rem;
    padding: 0.28rem 0.7rem;
    border-radius: 20px;
    margin-top: 0.2rem;
    font-weight: 500;
}
.card-status.status-sucesso             { background: #edfaf3; color: var(--green); border: 1px solid #a8d5b8; }
.card-status.status-indisponivel        { background: #fdf3f3; color: var(--red); border: 1px solid #e8b8b8; }
.card-status.status-erro                { background: #fdf3f3; color: var(--red); border: 1px solid #e8b8b8; }
.card-status.status-pendente_biometria  { background: #fff8ec; color: #8a5c00; border: 1px solid #e8d0a0; }
.card-status.status-analise_em_andamento { background: #fff8ec; color: #8a5c00; border: 1px solid #e8d0a0; }
.card-status.status-reprovado            { background: #fdf3f3; color: var(--red); border: 1px solid #e8b8b8; }

.card-details {
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.biometric-link {
    display: inline-block;
    margin-top: 0.4rem;
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}
.biometric-link:hover { color: var(--orange); }

.badge-winner {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* ── Toast ───────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    background: var(--navy-dark);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.4rem;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    max-width: 320px;
    animation: slideInRight 0.25s ease-out;
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Footer ──────────────────────────────── */
.footer {
    background: var(--navy);
    color: rgba(255,255,255,0.55);
    padding: 1.1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}
.footer code {
    font-family: 'Consolas', monospace;
    color: #7ab8e8;
    background: rgba(255,255,255,0.08);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

/* ── Card action (Contratar button) ─────── */
.card-action {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}

.btn-contratar {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-contratar:hover { background: var(--navy-dark); }
.result-card.winner .btn-contratar { background: var(--orange); }
.result-card.winner .btn-contratar:hover { background: #c56a20; }

/* ── Modal ───────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 30, 60, 0.55);
    backdrop-filter: blur(3px);
}

.modal-box {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: slideUp 0.2s ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: border-color 0.15s, color 0.15s;
}
.modal-close:hover { border-color: var(--text-mid); color: var(--text); }

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.modal-insurer-badge {
    width: 44px;
    height: 44px;
    padding: 2px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-mid);
    flex-shrink: 0;
}

.modal-title  { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 0; }
.modal-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ── Tab badge beta ─────────────────────── */
.tab-badge-beta {
    background: var(--orange);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Validação de Contrato ───────────────── */
.val-page {
    max-width: 1040px;
    margin: 2rem auto;
    padding: 0 2rem 4rem;
}

.val-header { margin-bottom: 1.75rem; }
.val-header h2 { font-size: 1.25rem; color: var(--text); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.6rem; }
.val-subtitle  { font-size: 0.85rem; color: var(--text-muted); max-width: 640px; line-height: 1.6; }

.val-phase-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--orange-light);
    color: var(--orange);
    border: 1px solid var(--orange);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Upload */
.val-upload {
    background: var(--surface);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 3.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.val-upload:hover { border-color: var(--navy); background: var(--navy-light); }

.val-upload-icon svg { stroke: var(--text-muted); }
.val-upload:hover .val-upload-icon svg { stroke: var(--navy); }

.val-upload-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.val-upload-sub   { font-size: 0.82rem; color: var(--text-muted); }
.val-upload-divider {
    display: flex; align-items: center; gap: 0.75rem;
    width: 200px; color: var(--text-muted); font-size: 0.78rem; margin: 0.25rem 0;
}
.val-upload-divider::before,
.val-upload-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-val-demo {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-val-demo:hover { background: var(--navy-dark); }
.val-upload-hint { font-size: 0.76rem; color: var(--text-muted); }

/* Analyzing */
.val-analyzing {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.val-doc-scanner {
    position: relative;
    width: 160px;
    height: 200px;
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    overflow: hidden;
    padding: 16px 12px;
    box-shadow: var(--shadow-sm);
}
.val-doc-body { display: flex; flex-direction: column; gap: 8px; }
.val-doc-line {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    animation: lineFlicker 2s ease infinite;
}
.val-doc-line.w80 { width: 80%; }
.val-doc-line.w60 { width: 60%; animation-delay: 0.1s; }
.val-doc-line.w90 { width: 90%; animation-delay: 0.2s; }
.val-doc-line.w50 { width: 50%; animation-delay: 0.3s; }
.val-doc-line.w75 { width: 75%; animation-delay: 0.4s; }
.val-doc-line.w85 { width: 85%; animation-delay: 0.5s; }
.val-doc-line.w40 { width: 40%; animation-delay: 0.6s; }
.val-doc-line.w70 { width: 70%; animation-delay: 0.7s; }
@keyframes lineFlicker {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1;   }
}

.val-scanner-beam {
    position: absolute;
    left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--orange), transparent);
    box-shadow: 0 0 8px var(--orange);
    animation: scanBeam 1.6s ease-in-out infinite;
    top: 0;
}
@keyframes scanBeam {
    0%   { top: 0%;   opacity: 1; }
    90%  { top: 95%;  opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.val-analyzing-msg {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-mid);
    min-height: 1.4em;
    transition: opacity 0.3s;
}
.val-progress-wrap {
    width: 300px; height: 4px;
    background: var(--navy-mid);
    border-radius: 4px; overflow: hidden;
}
.val-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--navy), var(--orange));
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Result */
.val-result {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeUp 0.5s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.val-result-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}
.val-score-wrap { display: flex; align-items: center; gap: 1.25rem; }
.val-score {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
}
.val-score span { font-size: 1.4rem; font-weight: 500; color: var(--text-muted); }
.val-score-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.val-risk-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
}
.val-risk-badge.warn { background: #fff8ec; color: #8a5c00; border: 1px solid #e8d0a0; }
.val-risk-badge.ok   { background: #edfaf3; color: var(--green); border: 1px solid #a8d5b8; }

.val-clauses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 700px) { .val-clauses-grid { grid-template-columns: 1fr; } }

.val-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.val-col-title {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.val-col-title.ok  { background: #edfaf3; color: var(--green); border-bottom: 1px solid #a8d5b8; }
.val-col-title.err { background: #fdf3f3; color: var(--red);   border-bottom: 1px solid #e8b8b8; }

.val-clause-list { list-style: none; padding: 0; }
.val-clause-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.83rem;
}
.val-clause-list li:last-of-type { border-bottom: none; }
.clause-icon {
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    margin-top: 1px;
}
.val-clause-list li.ok   .clause-icon { color: var(--green); }
.val-clause-list li.err  .clause-icon { color: var(--red); }
.val-clause-list li.warn .clause-icon { color: #8a5c00; }
.val-clause-list strong { display: block; color: var(--text); margin-bottom: 0.15rem; }
.val-clause-list small  { color: var(--text-muted); font-size: 0.76rem; line-height: 1.5; }

.val-recommendations {
    padding: 1rem 1.25rem;
    background: #fffbf0;
    border-top: 1px solid #f0d080;
}
.val-rec-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #8a5c00;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.val-recommendations ol { padding-left: 1.2rem; }
.val-recommendations li { font-size: 0.8rem; color: var(--text-mid); margin-bottom: 0.4rem; line-height: 1.55; }

.val-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.btn-val-proceed {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-val-proceed:hover { background: #246b45; }
.val-actions-note { font-size: 0.8rem; color: var(--text-muted); }

/* ── Biometria panel ─────────────────────── */
.biometria-panel {
    background: #fffbf0;
    border: 1px solid #f0d080;
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.bio-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.bio-step-2 { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #f0d080; opacity: 0.65; }

.bio-step-num {
    width: 26px;
    height: 26px;
    background: var(--orange);
    color: #fff;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.bio-step strong { display: block; font-size: 0.9rem; color: var(--text); margin-bottom: 0.25rem; }
.bio-step p      { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.75rem; }

.btn-bio {
    padding: 0.5rem 1.1rem;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-bio:hover    { background: #c56a20; }
.btn-bio:disabled { opacity: 0.6; cursor: default; }

.bio-link-wrap { margin-top: 0.75rem; }
.bio-link-wrap p { margin-bottom: 0.4rem; }

/* ── Emission result screens ─────────────── */
.emission-success,
.emission-error {
    text-align: center;
    padding: 2rem 1rem;
}

.emission-check {
    width: 64px;
    height: 64px;
    background: #edfaf3;
    color: var(--green);
    border-radius: 50%;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.emission-error-icon {
    width: 64px;
    height: 64px;
    background: #fdf3f3;
    color: var(--red);
    border-radius: 50%;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.emission-success h3 { color: var(--green); font-size: 1.25rem; margin-bottom: 0.5rem; }
.emission-error  h3  { color: var(--red);   font-size: 1.25rem; margin-bottom: 0.5rem; }
.emission-success p,
.emission-error  p   { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ── Utilities ───────────────────────────── */
.hidden { display: none !important; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 780px) {
    .page        { padding: 1.75rem 1rem 4rem; }
    .card        { padding: 1.5rem; }
    .field-grid  { grid-template-columns: 1fr 1fr; }
    .col-span-2  { grid-column: span 2; }
    .results-grid{ grid-template-columns: 1fr; }
    .hero-strip h1 { font-size: 1.5rem; }
    .top-bar-label { display: none; }
    .footer      { flex-direction: column; gap: 0.4rem; text-align: center; }
}
@media (max-width: 480px) {
    .field-grid  { grid-template-columns: 1fr; }
    .col-span-2  { grid-column: span 1; }
    .field-uf    { max-width: 100%; }
}

/* ── Tela de Login ──────────────────────────────────────────────────────── */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #005098 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-screen.hidden { display: none; }

.login-box {
    background: white;
    border-radius: 20px;
    padding: 3rem 2.5rem 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.login-logo {
    width: 160px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.login-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
}

.login-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.5rem;
}

#login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.login-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    letter-spacing: 0.08em;
}

.login-field input:focus { border-color: var(--navy); }

.login-error {
    font-size: 0.82rem;
    color: var(--red);
    text-align: center;
    padding: 0.4rem;
}

.login-btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.25rem;
}

.login-btn:hover  { background: var(--navy-dark); }
.login-btn:active { transform: scale(0.98); }

.login-btn.shake {
    animation: login-shake 0.35s ease;
}

@keyframes login-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}

/* ── Aprovações Pendentes ─────────────────────────────────────────────────── */

.aprovacoes-page {
    max-width: 1040px;
    margin: 2rem auto;
    padding: 0 2rem 4rem;
}

.aprovacoes-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aprov-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.aprov-card.has-pending-too {
    border-color: #c9d8ef;
    box-shadow: 0 8px 24px rgba(18, 58, 104, 0.08);
}

.aprov-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
}
.aprov-cpf { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.6rem; }
.aprov-hora { font-size: 0.78rem; color: var(--text-muted); }

.aprov-detalhe { font-size: 0.85rem; color: var(--text-mid); margin-bottom: 0.85rem; }

.aprov-precos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.9rem 0;
}
.aprov-insurer-card {
    min-height: 92px;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfe;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
}
.aprov-insurer-top { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.aprov-insurer-top span { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.aprov-insurer-card strong { font-size: 1rem; color: var(--navy); line-height: 1.3; }
.aprov-insurer-card small { font-size: .68rem; color: var(--text-muted); margin-top: auto; }
.aprov-insurer-card.status-sucesso { background:#f6fcf8; border-color:#b9dfc8; }
.aprov-insurer-card.status-analise_em_andamento,
.aprov-insurer-card.status-pendente_biometria { background:#f7faff; border-color:#b9cfea; }
.aprov-insurer-card.status-reprovado,
.aprov-insurer-card.status-cancelado,
.aprov-insurer-card.status-erro { background:#fff9f9; border-color:#eccaca; }
.aprov-status-dot { width:7px; height:7px; border-radius:50%; background:#a5afbb; flex-shrink:0; }
.status-sucesso .aprov-status-dot { background:var(--green); }
.status-analise_em_andamento .aprov-status-dot,
.status-pendente_biometria .aprov-status-dot {
    background:#2e6eb5;
    box-shadow:0 0 0 0 rgba(46,110,181,.38);
    animation: aprovPulse 1.7s infinite;
}
.status-reprovado .aprov-status-dot, .status-cancelado .aprov-status-dot,
.status-erro .aprov-status-dot { background:var(--red); }
.aprov-loading-label { display:flex; align-items:center; gap:.45rem; font-style:normal; }
.aprov-spinner {
    width:14px; height:14px; border-radius:50%;
    border:2px solid #c8d8ec; border-top-color:#2e6eb5;
    animation: aprovSpin .8s linear infinite;
}
.aprov-scan-line {
    position:absolute; left:0; bottom:0; height:3px; width:42%;
    background:linear-gradient(90deg, transparent, #397cc4, transparent);
    animation: aprovScan 1.8s ease-in-out infinite;
}
.aprov-alerta {
    background:#fff8e4; color:#76520a; border:1px solid #ecd28c;
    border-radius:8px; padding:.55rem .75rem; font-size:.76rem; margin:.4rem 0;
}
.aprov-waiting-panel {
    display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.85rem;
    background:linear-gradient(135deg,#f2f7fd,#f8fbff);
    border:1px solid #c9d9ed; border-radius:10px; padding:.8rem .9rem; margin:.8rem 0 1rem;
}
.aprov-waiting-panel strong { display:block; color:var(--navy); font-size:.82rem; margin-bottom:.15rem; }
.aprov-waiting-panel p { color:var(--text-mid); font-size:.73rem; line-height:1.45; margin:0; }
.aprov-waiting-icon { display:flex; align-items:center; gap:3px; width:28px; justify-content:center; }
.aprov-waiting-icon span {
    width:5px; height:5px; border-radius:50%; background:#2e6eb5;
    animation: aprovDots 1.2s infinite ease-in-out;
}
.aprov-waiting-icon span:nth-child(2) { animation-delay:.15s; }
.aprov-waiting-icon span:nth-child(3) { animation-delay:.3s; }
.aprov-live { font-size:.68rem; color:#2e6eb5; font-weight:700; white-space:nowrap; }
.aprov-live i { display:inline-block; width:6px; height:6px; border-radius:50%; background:#2e6eb5; margin-right:4px; animation:aprovPulse 1.7s infinite; }
.aprov-message-label { font-size:.68rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:700; margin-bottom:.35rem; }

.aprov-mensagem {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-family: inherit;
    font-size: 0.83rem;
    color: var(--text);
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

.aprov-card-actions { display: flex; gap: 0.6rem; }

.btn-aprovar, .btn-rejeitar, .btn-pdf {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-aprovar { background: var(--green); color: #fff; }
.btn-aprovar:hover { background: #246f46; }
.btn-aprovar.btn-send-partial { background:#fff; color:#9a6300; border:1px solid #d8a84d; }
.btn-aprovar.btn-send-partial:hover { background:#fff8e8; }
.btn-rejeitar { background: var(--surface); color: var(--red); border: 1px solid var(--border-strong); }
.btn-rejeitar:hover { background: var(--bg); }
.btn-pdf { background: var(--surface); color: #1a73e8; border: 1px solid var(--border-strong); }
.btn-pdf:hover { background: var(--bg); }
.btn-aprovar:disabled, .btn-rejeitar:disabled, .btn-pdf:disabled { opacity: 0.6; cursor: not-allowed; }

@keyframes aprovSpin { to { transform:rotate(360deg); } }
@keyframes aprovPulse {
    0% { box-shadow:0 0 0 0 rgba(46,110,181,.4); }
    70% { box-shadow:0 0 0 6px rgba(46,110,181,0); }
    100% { box-shadow:0 0 0 0 rgba(46,110,181,0); }
}
@keyframes aprovScan {
    0% { transform:translateX(-110%); }
    100% { transform:translateX(340%); }
}
@keyframes aprovDots {
    0%, 60%, 100% { transform:translateY(0); opacity:.35; }
    30% { transform:translateY(-4px); opacity:1; }
}
@media (max-width:700px) {
    .aprovacoes-page { padding:0 1rem 3rem; }
    .aprov-card { padding:1rem; }
    .aprov-precos { grid-template-columns:1fr; }
    .aprov-waiting-panel { grid-template-columns:auto 1fr; }
    .aprov-live { display:none; }
    .aprov-card-actions { flex-direction:column; }
    .btn-aprovar, .btn-rejeitar, .btn-pdf { width:100%; }
}
@media (prefers-reduced-motion:reduce) {
    .aprov-spinner, .aprov-scan-line, .aprov-status-dot,
    .aprov-waiting-icon span, .aprov-live i { animation:none !important; }
}

/* Fila "Aguardando biometria" (item 8) */
.bio-fila-msg {
    margin-top: 8px;
    font-size: 0.84rem;
    color: #8a6d1a;
    background: #fff8e6;
    border: 1px solid #f2e2b0;
    border-radius: 6px;
    padding: 6px 10px;
}
.bio-fila-msg.bio-ok, .bio-ok {
    color: #1a7a3c;
    background: #e9f7ee;
    border-color: #b7e2c6;
}

/* Acompanhamento da Too na tela de cotação (Opção 2): "aguardando o valor oficial" */
.too-spinner {
    display: inline-block;
    width: 11px; height: 11px;
    margin-right: 6px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    vertical-align: -1px;
    animation: aprovSpin 0.8s linear infinite;
}
@keyframes b1PricePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.result-card.card-waiting .card-price { animation: b1PricePulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
    .too-spinner,
    .result-card.card-waiting .card-price { animation: none; }
}

/* Multi-locatário: co-locatários no formulário + aviso de análise conjunta */
.co-pret-block { margin-top: 14px; }
.co-pret-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.co-pret-row input {
    flex: 1; min-width: 0;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit; font-size: 0.9rem;
    background: var(--surface); color: var(--text);
}
.co-pret-row input:focus { outline: none; border-color: var(--navy); }
.co-pret-remove {
    background: none; border: none; color: #c0392b;
    font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0 6px; flex-shrink: 0;
}
.btn-add-copret {
    background: none; border: 1px dashed var(--border-strong, #cbd5e1);
    color: var(--navy); border-radius: 8px; padding: 8px 12px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-add-copret:hover { background: var(--bg); }
.analise-conjunta {
    background: #eaf1f9; border: 1px solid #c9d8ef; color: #1f4e79;
    border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
    font-size: 0.85rem; font-weight: 600;
}

/* Fase 2: fallback individual */
.analise-individual { margin-top: 6px; }
.ai-hint { font-size: 0.85rem; color: var(--text-mid, #52606d); margin: 0 0 8px; }
#btn-analise-individual { margin-bottom: 10px; }
.indiv-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; margin-bottom: 8px; font-size: 0.88rem; line-height: 1.5;
}
.indiv-card strong { color: var(--navy); }
.indiv-status { color: var(--text-muted); font-size: 0.82rem; }
.ai-ok { color: #1f8f5a; }
.ai-no { color: #b23b3b; }
