/* Braspress — Conclusão de Cadastro Motorista
   Paleta: azul #003A70 / #00284E, amarelo #FFC500
   Mobile-first, responsivo */

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

:root {
    --bp-blue: #003A70;
    --bp-blue-dark: #00284E;
    --bp-yellow: #FFC500;
    --bp-bg: #EEF1F5;
    --bp-card: #FFFFFF;
    --bp-text: #1B1B1B;
    --bp-muted: #667085;
    --bp-border: #D9DEE6;
    --bp-ok: #0E9F4B;
    --bp-err: #C62828;
}

html, body { height: 100%; }
body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bp-bg);
    color: var(--bp-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Topbar ---------- */
.bp-topbar {
    background: var(--bp-blue-dark);
    color: #B8C7D9;
    font-size: clamp(10px, 3vw, 12px);
}
.bp-topbar-inner {
    max-width: 520px;
    margin: 0 auto;
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Header ---------- */
.bp-header {
    background: linear-gradient(135deg, #003A70 0%, #00284E 100%);
    border-bottom: 4px solid var(--bp-yellow);
}
.bp-header-inner {
    max-width: 520px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.bp-logo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bp-logo svg { height: clamp(26px, 8vw, 34px); width: auto; max-width: 100%; }
.bp-logo-tag {
    color: var(--bp-yellow);
    font-size: clamp(7px, 2.2vw, 9px);
    font-weight: 700;
    letter-spacing: 2.5px;
    margin-left: 4px;
    white-space: nowrap;
}
.bp-header-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 8px 12px;
    border-radius: 30px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- Main ---------- */
.bp-main {
    flex: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 16px 14px 40px;
}
.bp-kicker {
    text-align: center;
    color: var(--bp-muted);
    font-size: clamp(11px, 3.2vw, 13px);
    margin-bottom: 12px;
}

.bp-card {
    background: var(--bp-card);
    border-radius: 16px;
    border: 1px solid var(--bp-border);
    box-shadow: 0 10px 30px rgba(2, 32, 71, 0.08);
    padding: clamp(20px, 5vw, 28px) clamp(16px, 4.5vw, 24px);
}

.bp-step-label {
    display: inline-block;
    background: #EAF1FA;
    color: var(--bp-blue);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.bp-step-label--ok {
    background: #E7F7EE;
    color: var(--bp-ok);
}

/* Banner de aprovado */
.bp-ok-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #EFFAF3;
    border: 1.5px solid #BFE9CF;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 18px;
    font-size: 13.5px;
    color: #1F5137;
    line-height: 1.55;
}
.bp-ok-banner svg { width: 26px; height: 26px; flex-shrink: 0; margin-top: 2px; }
.bp-ok-banner strong { color: #0E9F4B; }

/* Banner informativo (titularidade) */
.bp-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #F2F7FD;
    border: 1.5px solid #D5E4F5;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 4px 0 18px;
    font-size: 12.5px;
    color: #3E5A78;
    line-height: 1.55;
}
.bp-info-banner svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.bp-info-banner strong { color: var(--bp-blue-dark); }

/* Conta: campo dígito estreito */
.bp-field-row--conta { align-items: flex-start; }
.bp-field--dig { flex: 0 0 72px !important; }

/* Checkbox de declaração */
.bp-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--bp-text);
    line-height: 1.45;
    padding: 12px 14px;
    background: #F7F9FC;
    border: 1.5px solid var(--bp-border);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 4px;
    -webkit-tap-highlight-color: transparent;
}
.bp-check.err { border-color: var(--bp-err); }
.bp-check input {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--bp-blue);
}
.bp-check span { font-weight: 600; }

/* Honeypot — invisível para humanos */
.bp-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.bp-title { font-size: clamp(19px, 5.5vw, 22px); font-weight: 800; color: var(--bp-blue-dark); margin-bottom: 6px; }
.bp-subtitle { font-size: clamp(13px, 3.8vw, 14px); color: var(--bp-muted); line-height: 1.5; margin-bottom: 20px; }
.bp-subtitle strong { color: var(--bp-text); }

/* Faixa de confiança (cadeado) */
.bp-trust {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    color: #3E5A78;
    background: #F2F7FD;
    border: 1px solid #D5E4F5;
    border-radius: 9px;
    padding: 9px 12px;
    margin: -8px 0 16px;
}
.bp-trust svg { width: 18px; height: 18px; color: #0E9F4B; flex-shrink: 0; }

/* Seção dentro do form */
.bp-section {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--bp-blue);
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--bp-yellow);
    display: flex;
    align-items: center;
    gap: 8px;
}
.bp-section:first-of-type { margin-top: 0; }
.bp-section::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--bp-yellow);
    flex-shrink: 0;
}

/* ---------- Form ---------- */
.bp-field { position: relative; margin-bottom: 16px; }
.bp-field input,
.bp-field select {
    width: 100%;
    padding: 16px 14px 8px;
    font-size: 16px; /* >=16px evita zoom automático no iOS */
    border: 1.5px solid var(--bp-border);
    border-radius: 10px;
    outline: none;
    background: #FBFCFE;
    color: var(--bp-text);
    transition: border-color .15s, box-shadow .15s;
    letter-spacing: .3px;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}
.bp-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1 L6 6 L11 1' stroke='%23667085' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
.bp-field input:focus,
.bp-field select:focus {
    border-color: var(--bp-blue);
    box-shadow: 0 0 0 3px rgba(0, 58, 112, 0.12);
}
.bp-field label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bp-muted);
    font-size: 15px;
    pointer-events: none;
    transition: all .15s ease;
    padding: 0 3px;
}
.bp-field input:focus + label,
.bp-field input.filled + label,
.bp-field input:not(:placeholder-shown) + label {
    top: 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--bp-blue);
}
.bp-field input.err,
.bp-field select.err {
    border-color: var(--bp-err);
}
.bp-field .bp-hint {
    display: block;
    font-size: 11px;
    color: var(--bp-err);
    margin-top: 5px;
    padding-left: 2px;
    min-height: 14px;
}

/* Campo estático (label sempre no topo) — select */
.bp-field--static label {
    top: 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--bp-blue);
    transform: none;
    pointer-events: none;
}
.bp-field--static select { padding-top: 22px; }

.bp-field-row { display: flex; gap: 10px; }
.bp-field-row .bp-field { flex: 1; min-width: 0; }

/* ---------- PIN segmentado (senha 8 / token 6) ---------- */
.bp-pin-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFF6D9;
    border: 1.5px solid #F5C518;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #6B4A00;
    line-height: 1.5;
    margin-bottom: 14px;
}
.bp-pin-alert svg { width: 24px; height: 24px; flex-shrink: 0; }
.bp-pin-alert strong { color: #B45309; text-transform: uppercase; }
.bp-pin-intro {
    font-size: 13px;
    color: var(--bp-muted);
    line-height: 1.55;
    margin: -4px 0 16px;
}
.bp-pin-intro strong { color: var(--bp-text); }
.bp-pin-group { margin-bottom: 22px; }
.bp-pin-group.err .bp-pin-boxes input { border-color: var(--bp-err); }
.bp-pin-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.bp-pin-title { font-size: 14px; font-weight: 800; color: var(--bp-text); }
.bp-pin-tag {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--bp-blue);
    background: #EAF1FA;
    padding: 3px 10px;
    border-radius: 14px;
}
.bp-pin-boxes {
    display: grid;
    gap: clamp(4px, 1.6vw, 8px);
    width: 100%;
}
.bp-pin-boxes[data-len="8"] { grid-template-columns: repeat(8, 1fr); }
.bp-pin-boxes[data-len="6"] { grid-template-columns: repeat(6, 1fr); }
.bp-pin-boxes input {
    width: 100%;
    height: clamp(46px, 13vw, 54px);
    text-align: center;
    font-size: clamp(18px, 5vw, 21px);
    font-weight: 800;
    font-family: inherit;
    color: var(--bp-blue-dark);
    border: 1.5px solid var(--bp-border);
    border-radius: 10px;
    background: #FBFCFE;
    outline: none;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.bp-pin-boxes input:focus {
    border-color: var(--bp-blue);
    box-shadow: 0 0 0 3px rgba(0, 58, 112, 0.12);
    background: #FFFFFF;
}
.bp-pin-boxes input.filled {
    background: #EAF1FA;
    border-color: var(--bp-blue);
}
.bp-pin-note {
    font-size: 12px;
    color: var(--bp-muted);
    line-height: 1.5;
    background: #F7F9FC;
    border-left: 3px solid var(--bp-yellow);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 18px;
}

/* ---------- Upload foto CNH ---------- */
.bp-drop-wrap { margin-bottom: 14px; }
.bp-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 2px dashed var(--bp-border);
    border-radius: 14px;
    padding: 22px 14px;
    background: #FBFCFE;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
}
.bp-drop:active { background: #F0F4F9; }
.bp-drop-wrap.err .bp-drop { border-color: var(--bp-err); }
.bp-drop-icon { color: var(--bp-blue); }
.bp-drop-icon svg { width: 34px; height: 34px; }
.bp-drop-title { font-size: 14px; font-weight: 700; color: var(--bp-text); }
.bp-drop-sub { font-size: 11.5px; color: var(--bp-muted); }
.bp-drop-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}
.bp-drop-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #EAF1FA;
    color: var(--bp-blue);
    border: 1.5px solid rgba(0, 58, 112, 0.25);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .4px;
    cursor: pointer;
    min-height: 44px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
.bp-drop-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.bp-drop-btn:active { background: #DCE8F5; }
.bp-drop-btn--danger {
    background: #FDEDEC;
    color: var(--bp-err);
    border-color: rgba(198, 40, 40, 0.25);
}
.bp-drop-btn--danger:active { background: #FADBD8; }
.bp-preview {
    max-width: 100%;
    max-height: 170px;
    border-radius: 10px;
    border: 1px solid var(--bp-border);
    margin-top: 4px;
}

/* ---------- Tela de análise ---------- */
.bp-analise-card { padding-top: 34px; }
.bp-analise-anim {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 22px;
}
.bp-analise-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 5px solid #EAF1FA;
    border-top-color: var(--bp-yellow);
    border-right-color: var(--bp-blue);
    animation: bp-spin 1.1s linear infinite;
}
.bp-analise-core {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--bp-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}
.bp-analise-core svg { width: 30px; height: 30px; }
.bp-analise-line { font-size: 14px; color: var(--bp-muted); line-height: 1.6; margin-bottom: 10px; }
.bp-analise-line strong { color: var(--bp-text); }
.bp-analise-sub { font-size: 12px; color: var(--bp-muted); margin-bottom: 24px; }
.bp-analise-progress {
    width: 100%;
    height: 8px;
    background: #EAF1FA;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 18px;
}
.bp-analise-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bp-blue), var(--bp-yellow));
    border-radius: 6px;
    transition: width .4s ease;
}
.bp-analise-steps {
    display: flex;
    flex-direction: column;
    gap: 9px;
    text-align: left;
    font-size: 13px;
    color: var(--bp-muted);
}
.bp-analise-steps span { display: flex; align-items: center; gap: 9px; }
.bp-analise-steps span::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--bp-border);
    flex-shrink: 0;
    transition: all .3s;
}
.bp-analise-steps span.done { color: var(--bp-text); font-weight: 600; }
.bp-analise-steps span.done::before {
    border-color: var(--bp-ok);
    background: var(--bp-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5 L10 16.5 L18 8' stroke='white' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* ---------- Botão ---------- */
.bp-btn {
    width: 100%;
    background: var(--bp-blue);
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    padding: 15px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background .15s, transform .05s;
    margin-top: 6px;
    min-height: 48px; /* alvo de toque */
    -webkit-tap-highlight-color: transparent;
}
.bp-btn:hover { background: var(--bp-blue-dark); }
.bp-btn:active { transform: scale(0.99); }

/* ---------- Overlay de envio ---------- */
.bp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 21, 43, 0.88);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: #FFFFFF;
}
.bp-overlay.show { display: flex; }
.bp-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--bp-yellow);
    border-radius: 50%;
    animation: bp-spin .8s linear infinite;
}
@keyframes bp-spin { to { transform: rotate(360deg); } }
.bp-overlay p { font-size: 15px; font-weight: 600; letter-spacing: .5px; }

/* ---------- Sucesso ---------- */
.bp-success-icon {
    width: 74px;
    height: 74px;
    margin: 6px auto 18px;
    border-radius: 50%;
    background: #E7F7EE;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bp-success-icon svg { width: 38px; height: 38px; }
.bp-card.center { text-align: center; }

/* Senha do app — token */
.bp-token-box {
    background: linear-gradient(135deg, #003A70 0%, #00284E 100%);
    border-radius: 14px;
    padding: clamp(16px, 4.5vw, 20px) clamp(14px, 4vw, 16px);
    margin: 16px 0;
}
.bp-token-box--yellow {
    background: linear-gradient(135deg, #1F3D63 0%, #003A70 100%);
    border: 1.5px solid rgba(255, 197, 0, 0.45);
}
.bp-token-label {
    display: block;
    color: var(--bp-yellow);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.bp-token-digits {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: clamp(30px, 9vw, 40px);
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 6px;
    margin-bottom: 14px;
    user-select: all;
}
.bp-copy-btn {
    background: var(--bp-yellow);
    color: var(--bp-blue-dark);
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
    cursor: pointer;
    min-height: 42px;
    -webkit-tap-highlight-color: transparent;
}
.bp-copy-btn:active { transform: scale(0.97); }
.bp-token-warn {
    display: block;
    color: #9FB2C8;
    font-size: 11px;
    margin-top: 12px;
    line-height: 1.4;
}
.bp-final-warn {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    background: #FFF6D9;
    border: 1.5px solid #F5C518;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #6B4A00;
    line-height: 1.5;
    margin: 4px 0 16px;
}
.bp-final-warn svg { width: 24px; height: 24px; flex-shrink: 0; }
.bp-final-warn strong { color: #B45309; text-transform: uppercase; }

.bp-done-list {
    text-align: left;
    background: #F7F9FC;
    border: 1px solid var(--bp-border);
    border-radius: 10px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 13px;
}
.bp-done-list div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--bp-border);
}
.bp-done-list div:last-child { border-bottom: none; }
.bp-done-list span:first-child { color: var(--bp-muted); flex-shrink: 0; }
.bp-done-list span:last-child { font-weight: 700; text-align: right; word-break: break-word; }

/* ---------- Footer ---------- */
.bp-footer {
    background: var(--bp-blue-dark);
    color: #9FB2C8;
    text-align: center;
    font-size: 12px;
    padding: 18px 16px;
    border-top: 4px solid var(--bp-yellow);
}
.bp-footer-inner { max-width: 520px; margin: 0 auto; }
.bp-footer-line { margin-bottom: 10px; }
.bp-footer-small { font-size: 10.5px; margin-top: 6px; color: #6E86A1; }

/* ---------- Responsivo ---------- */
/* Telas muito pequenas (<=360px) */
@media (max-width: 360px) {
    .bp-field-row { flex-direction: column; gap: 0; }
    .bp-main { padding: 12px 10px 32px; }
    .bp-token-digits { letter-spacing: 3px; }
    .bp-topbar-right { display: none; }
    .bp-pin-boxes { gap: 3px; }
    .bp-pin-boxes input { border-radius: 8px; height: 44px; }
}

/* Mobile típico (<=480px) */
@media (max-width: 480px) {
    .bp-header-badge span { display: none; }
    .bp-header-badge { padding: 8px 10px; }
    .bp-header-badge svg { width: 16px; height: 16px; }
    .bp-card { border-radius: 14px; }
    .bp-field-row { flex-direction: column; gap: 0; }
    .bp-field { margin-bottom: 14px; }
    .bp-done-list div { flex-direction: column; gap: 2px; padding: 8px 0; }
    .bp-done-list span:last-child { text-align: left; }
    .bp-pin-boxes { gap: clamp(3px, 1.4vw, 6px); }
    .bp-pin-boxes input { height: clamp(44px, 12vw, 50px); font-size: 17px; }
    .bp-btn { font-size: 14px; }
}

/* Safe-area (iPhone com notch) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    .bp-footer {
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }
}

/* Desktop: centralizado com respiro */
@media (min-width: 700px) {
    .bp-main { padding-top: 28px; }
}
