/* =====================================================================
   W3 MASTER — Briefing de Projeto (complementa style.css)
   ===================================================================== */

/* Garante que [hidden] vença regras como .btn { display: inline-flex } */
[hidden] { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ----------- 1. Layout da página ----------- */
.briefing { padding-top: calc(var(--header-h) + 3rem); overflow: hidden; min-height: 100vh; }
.briefing .hero__glow--orange { top: -200px; left: -160px; }
.briefing__container { position: relative; z-index: 2; max-width: 860px; }
.briefing__intro { text-align: center; margin-bottom: 2.5rem; }
.briefing__intro .section__title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }

/* ----------- 2. Progresso ----------- */
.bf-progress { margin-bottom: 1.2rem; }
.bf-progress__top {
    display: flex; justify-content: space-between; gap: 1rem;
    font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem;
}
.bf-progress__top span:last-child { color: var(--orange-soft); font-weight: 600; text-align: right; }
.bf-progress__bar { height: 6px; border-radius: 100px; background: var(--surface-2); overflow: hidden; }
.bf-progress__bar span {
    display: block; height: 100%; width: 0; border-radius: inherit;
    background: var(--grad-brand); box-shadow: var(--glow-orange);
    transition: width .45s var(--ease);
}

/* ----------- 3. Formulário e etapas ----------- */
.bf-form { border-radius: var(--radius-lg); padding: 2.2rem; }
.bf-step__title { font-size: 1.4rem; font-weight: 700; }
.bf-step__desc { color: var(--text-muted); margin: .35rem 0 1.8rem; }
.bf-step.is-active { animation: bf-in .45s var(--ease); }
@keyframes bf-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.bf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem 1.2rem; }
.bf-field { display: grid; gap: .45rem; align-content: start; border: 0; min-width: 0; }
.bf-field--wide { grid-column: 1 / -1; }
.bf-field[hidden] { display: none; }

.bf-label, .bf-field legend { font-size: .9rem; font-weight: 600; color: var(--text); padding: 0; }
.bf-field legend { margin-bottom: .45rem; }
.bf-req { color: var(--orange); }
.bf-help { font-size: .82rem; color: var(--text-muted); margin-top: -.15rem; }
.bf-field legend + .bf-help { margin: -.2rem 0 .5rem; }

.bf-input {
    width: 100%; padding: .85rem 1rem; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    font-family: inherit; font-size: .95rem; transition: border-color .2s, box-shadow .2s;
}
.bf-input::placeholder { color: #5e6a85; }
.bf-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,122,26,.15); }
select.bf-input {
    appearance: none; cursor: pointer; padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2397A3BE' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .9rem center; background-size: 18px;
}
select.bf-input option { background: var(--surface-2); }
textarea.bf-input { resize: vertical; }
.bf-other { margin-top: .5rem; }

/* Estado de erro */
.bf-error { font-size: .82rem; color: #ff6b6b; min-height: 0; }
.bf-error:empty { display: none; }
.bf-field.has-error .bf-input { border-color: #ff6b6b; }
.bf-field.has-error .bf-option span { border-color: rgba(255,107,107,.5); }

/* ----------- 4. Opções (radio / checkbox em "chips") ----------- */
.bf-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.bf-options--compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.bf-option { position: relative; cursor: pointer; display: block; }
.bf-option input { position: absolute; opacity: 0; pointer-events: none; }
.bf-option span {
    display: flex; align-items: center; gap: .65rem; height: 100%;
    padding: .7rem .9rem; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: .9rem; color: var(--text-muted); line-height: 1.35;
    transition: border-color .2s, background .2s, color .2s;
}
.bf-option span::before {
    content: ''; flex: 0 0 18px; height: 18px; border-radius: 5px;
    border: 1.5px solid #4a5672; transition: .2s var(--ease);
    background: center / 12px no-repeat;
}
.bf-option input[type="radio"] + span::before { border-radius: 50%; }
.bf-option:hover span { border-color: rgba(255,122,26,.35); color: var(--text); }
.bf-option input:checked + span {
    border-color: var(--orange); background: rgba(255,122,26,.10); color: var(--text);
}
.bf-option input:checked + span::before {
    border-color: var(--orange); background-color: var(--orange);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a0e00' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E");
}
.bf-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(255,122,26,.25); }
.bf-option--plain span { background: transparent; border-color: transparent; padding-left: 0; }

/* ----------- 5. Cards Site / Sistema ----------- */
.bf-types { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.bf-type { cursor: pointer; display: block; }
.bf-type input { position: absolute; opacity: 0; pointer-events: none; }
.bf-type__card {
    display: grid; gap: .3rem; height: 100%; padding: 1.6rem;
    border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
    transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.bf-type__card .card__icon { margin-bottom: .6rem; }
.bf-type__card strong { font-family: 'Sora', sans-serif; font-size: 1.2rem; }
.bf-type__card small { color: var(--text-muted); font-size: .9rem; }
.bf-type:hover .bf-type__card { transform: translateY(-3px); border-color: rgba(255,122,26,.4); }
.bf-type input:checked + .bf-type__card { border-color: var(--orange); box-shadow: var(--glow-orange); }
.bf-type input:focus-visible + .bf-type__card { outline: 2px solid var(--orange); outline-offset: 3px; }

.bf-notes {
    margin-top: 1.8rem; padding: 1.1rem 1.3rem; border-radius: var(--radius-sm);
    background: rgba(46,107,255,.07); border: 1px solid rgba(46,107,255,.2);
    display: grid; gap: .4rem; font-size: .86rem; color: var(--text-muted);
}
.bf-notes li { padding-left: 1.1rem; position: relative; }
.bf-notes li::before { content: '•'; position: absolute; left: 0; color: var(--blue); }

/* ----------- 6. Upload ----------- */
.bf-drop {
    display: grid; justify-items: center; gap: .3rem; text-align: center; cursor: pointer;
    padding: 1.6rem 1rem; border-radius: var(--radius-sm);
    border: 1.5px dashed rgba(255,255,255,.18); background: var(--surface-2);
    color: var(--text-muted); font-size: .92rem; transition: border-color .2s, background .2s;
}
.bf-drop strong { color: var(--orange-soft); }
.bf-drop small { font-size: .8rem; }
.bf-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bf-drop:hover, .bf-drop.is-over { border-color: var(--orange); background: rgba(255,122,26,.06); }
.bf-drop:focus-within { border-color: var(--orange); }

.bf-files { display: grid; gap: .4rem; }
.bf-files li {
    display: flex; justify-content: space-between; gap: 1rem; align-items: center;
    padding: .55rem .8rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
    font-size: .85rem;
}
.bf-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-files li small { color: var(--text-muted); flex-shrink: 0; }
.bf-files button {
    background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.bf-files button:hover { color: #ff6b6b; }

.bf-consent { margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--border); }

/* ----------- 7. Navegação ----------- */
.bf-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.bf-nav #bf-next, .bf-nav #bf-submit { margin-left: auto; }
.bf-nav .btn[disabled] { opacity: .6; cursor: wait; transform: none; }
#bf-feedback { margin-top: 1rem; }

/* Honeypot fora da tela */
.bf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ----------- 8. Sucesso ----------- */
.bf-success { border-radius: var(--radius-lg); padding: 3rem 2rem; text-align: center; outline: none; }
.bf-success__icon {
    width: 72px; height: 72px; margin: 0 auto 1.4rem; border-radius: 50%;
    display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: #1a0e00;
    background: var(--grad-brand); box-shadow: var(--glow-orange);
}
.bf-success p { color: var(--text-muted); margin-top: 1rem; }
.bf-success__protocol strong { color: var(--orange-soft); font-family: 'Sora', sans-serif; letter-spacing: .04em; }
.bf-success__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* ----------- 9. Responsivo ----------- */
@media (max-width: 760px) {
    .briefing { padding-top: calc(var(--header-h) + 2rem); }
    .bf-form { padding: 1.4rem 1.1rem; }
    .bf-grid, .bf-types { grid-template-columns: 1fr; }
    .bf-options { grid-template-columns: 1fr; }
    .bf-options--compact { grid-template-columns: 1fr 1fr; }
    .bf-nav .btn--lg { padding: .85rem 1.3rem; }
    .page-briefing .nav .btn--ghost { padding: .55rem 1rem; font-size: .85rem; }
}
