/* Correção: atributo hidden não era respeitado em elementos com display definido */
[hidden] { display: none !important; }

/* Logo branco sem caixa (topo do formulário) */
.application-identity .brand-mark {
  width: 52px; height: 52px; padding: 0; overflow: visible;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}

/* ===== Área do cliente com sidebar ===== */
.portal-shell { display: flex; min-height: 100vh; }

.portal-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: 248px;
  display: flex; flex-direction: column; gap: 22px;
  padding: 26px 16px 20px;
  color: #fff;
  background: linear-gradient(180deg, #04142e, #071b3a 70%, #08214b);
  border-right: 1px solid rgba(226, 197, 127, .14);
}

.portal-sidebar-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.portal-sidebar-brand img { width: 96px; height: 96px; object-fit: contain; }
.portal-sidebar-brand small { color: var(--gold-400, #e2c57f); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.portal-sidebar-nav, .portal-sidebar-foot { display: flex; flex-direction: column; gap: 4px; }
.portal-sidebar-nav { flex: 1; }

.portal-sidebar a, .portal-sidebar button:not(.logout-button) {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 14px;
  border: 0; border-radius: 12px;
  color: rgba(255,255,255,.74); background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.portal-sidebar a span, .portal-sidebar button span { width: 18px; text-align: center; color: var(--gold-400, #e2c57f); }
.portal-sidebar a:hover, .portal-sidebar button:not(.logout-button):hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(3px); }
.portal-sidebar a.is-active { color: #fff; background: rgba(211,173,91,.14); box-shadow: inset 3px 0 0 var(--gold-400, #e2c57f); }

.portal-sidebar-foot { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.portal-sidebar .logout-button { margin-top: 10px; width: 100%; min-height: 42px; }

.portal-body { flex: 1; min-width: 0; margin-left: 248px; display: flex; flex-direction: column; }

.portal-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  min-height: 68px; padding: 0 32px;
  background: rgba(245,247,250,.9);
  border-bottom: 1px solid #e3e8ef;
  backdrop-filter: blur(14px);
}
.portal-topbar-right { display: flex; align-items: center; gap: 16px; }
.portal-topbar .client-portal-email { color: #6d7889; font-size: 12px; }

.portal-menu-toggle { display: none; margin-right: auto; width: 42px; height: 42px; border: 1px solid #dfe5ec; border-radius: 12px; background: #fff; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.portal-menu-toggle span { width: 18px; height: 2px; background: #0b1d38; border-radius: 2px; }

.portal-bell-wrap { position: relative; }
.portal-bell {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid #dfe5ec; border-radius: 50%;
  color: #0b1d38; background: #fff; cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}
.portal-bell:hover { box-shadow: 0 8px 22px rgba(11,29,56,.12); transform: translateY(-1px); }
.portal-bell.has-unread svg { animation: bellRing 2.4s ease-in-out infinite; transform-origin: 50% 4px; }
@keyframes bellRing { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }
.portal-bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px; border: 2px solid #f5f7fa;
  color: #04142e; background: linear-gradient(135deg, #ecd595, #d3ad5b);
  font-size: 10px; font-weight: 800;
}
.portal-bell-panel {
  position: absolute; right: 0; top: 52px; width: 330px; max-width: calc(100vw - 32px);
  padding: 8px; border: 1px solid #e0e5eb; border-radius: 18px;
  background: #fff; box-shadow: 0 24px 60px rgba(11,29,56,.18);
}
.portal-bell-title { padding: 10px 12px 8px; font-family: "Manrope", sans-serif; font-size: 14px; font-weight: 800; color: #0b1d38; }
.portal-bell-item { display: block; padding: 11px 12px; border-radius: 12px; color: #0b1d38; text-decoration: none; transition: background .2s ease; }
.portal-bell-item:hover { background: #f5f7fa; }
.portal-bell-item.is-new::before { content: ""; float: right; width: 8px; height: 8px; margin: 5px 0 0 8px; border-radius: 50%; background: #d3ad5b; }
.portal-bell-item strong { display: block; font-size: 13px; }
.portal-bell-item small { display: block; margin-top: 3px; color: #6d7889; font-size: 12px; line-height: 1.45; }
.portal-bell-empty { margin: 0; padding: 16px 12px; color: #6d7889; font-size: 13px; }

.portal-sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .portal-sidebar { transform: translateX(-100%); transition: transform .3s ease; }
  .portal-sidebar.is-open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.35); }
  .portal-sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(4,20,46,.55); }
  .portal-body { margin-left: 0; }
  .portal-menu-toggle { display: flex; }
  .portal-topbar { padding: 0 16px; }
  .portal-topbar .client-portal-email { display: none; }
}

/* Botão voltar do formulário */
.form-back {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px; padding: 9px 16px;
  border: 1px solid #dfe5ec; border-radius: 999px;
  color: #0b1d38; background: #fff;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.form-back:hover { transform: translateX(-3px); border-color: #d3ad5b; box-shadow: 0 8px 20px rgba(11,29,56,.08); }

/* Acompanhamento de status */
.portal-tracking-section { margin-top: 44px; }
.track-card { padding: 24px 28px; border: 1px solid #e0e5eb; border-radius: 22px; background: #fff; box-shadow: 0 12px 36px rgba(11,29,56,.05); margin-bottom: 16px; }
.track-card.needs-info { border-color: #ecd9a8; background: linear-gradient(180deg, #fffdf6, #fff); }
.track-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.track-head h2 { margin: 0; font-family: "Manrope", sans-serif; font-size: 22px; letter-spacing: -.02em; }
.track-card .applicant-label { margin: 8px 0 0; font-size: 13px; font-weight: 700; }
.track-steps { display: flex; align-items: flex-start; list-style: none; margin: 24px 0 8px; padding: 0; }
.track-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.track-step::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: #e3e8ef; z-index: 0; }
.track-step:first-child::before { display: none; }
.track-step.is-done::before, .track-step.is-current::before { background: linear-gradient(90deg, #d3ad5b, #ecd595); }
.track-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #e3e8ef; background: #fff; color: #98a3b3; font-size: 13px; font-weight: 800; }
.track-step.is-done .track-dot { border-color: #d3ad5b; background: #d3ad5b; color: #04142e; }
.track-step.is-current .track-dot { border-color: #d3ad5b; color: #0b1d38; box-shadow: 0 0 0 6px rgba(211,173,91,.2); animation: trackPulse 2s ease-in-out infinite; }
.track-step.is-alert .track-dot { border-color: #c9812b; box-shadow: 0 0 0 6px rgba(201,129,43,.2); }
.track-label { font-size: 12px; font-weight: 700; color: #98a3b3; }
.track-step.is-done .track-label, .track-step.is-current .track-label { color: #0b1d38; }
.track-note { margin: 14px 0 0; color: #6d7889; font-size: 13px; }
@keyframes trackPulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(211,173,91,.22); } 50% { box-shadow: 0 0 0 9px rgba(211,173,91,.08); } }

/* Indicador de salvamento: ícone de nuvem */
.save-dot.save-cloud { width: 18px; height: 18px; border-radius: 0; background: none !important; animation: none !important; display: inline-grid; place-items: center; color: #7a8798; }
.save-indicator .cloud-check { opacity: 0; transition: opacity .25s ease; }
.save-indicator.saved .save-cloud { color: #3aa879; }
.save-indicator.saved .cloud-check { opacity: 1; }
.save-indicator.saving .save-cloud { color: #d3ad5b; animation: cloudPulse 1.1s ease-in-out infinite !important; }
@keyframes cloudPulse { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-2px); opacity: .55; } }

/* Pedido de informações adicionais */
.info-box { margin-top: 16px; padding: 16px 18px; border: 1px solid #ecd9a8; border-radius: 16px; background: #fffdf6; }
.info-box.is-answered { border-color: #e0e5eb; background: #f8fafc; }
.info-ask small { display: block; color: #9c752e; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.info-ask p { margin: 6px 0 0; color: #0b1d38; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.info-done { margin-top: 10px; color: #216745; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.info-form { margin-top: 14px; }
.info-form textarea { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid #dfe5ec; border-radius: 14px; background: #fff; font: inherit; font-size: 14px; resize: vertical; }
.info-form textarea:focus { outline: none; border-color: #d3ad5b; box-shadow: 0 0 0 4px rgba(211,173,91,.15); }
.info-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.info-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 8px 6px 12px; border-radius: 999px; background: #eef2f7; color: #0b1d38; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-chip button { border: 0; background: none; color: #6d7889; font-size: 16px; line-height: 1; cursor: pointer; }
.info-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.info-plus { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #dfe5ec; border-radius: 50%; background: #fff; color: #0b1d38; font-size: 24px; line-height: 1; cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.info-plus:hover { border-color: #d3ad5b; transform: rotate(90deg); }
.info-status { flex: 1; color: #6d7889; font-size: 12px; }
.info-send { min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #ecd595, #d3ad5b); color: #04142e; font-weight: 800; font-size: 13px; cursor: pointer; }
.info-send:disabled, .info-plus:disabled { opacity: .55; cursor: wait; }

/* Ícones da sidebar */
.portal-sidebar .nav-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; }
.portal-sidebar .nav-icon svg { width: 20px; height: 20px; }
.portal-sidebar a.is-active .nav-icon { color: var(--gold-300, #ecd9a8); }

/* Aviso de sessão prestes a expirar */
.session-toast { position: fixed; left: 20px; bottom: 20px; z-index: 90; max-width: 340px; padding: 14px 16px; border: 1px solid #ecd9a8; border-radius: 14px; background: #04142e; color: #fff; font-size: 13px; line-height: 1.5; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
@media (max-width: 900px) { .session-toast { left: 12px; right: 12px; max-width: none; bottom: 90px; } }

/* Botões de novo questionário bloqueados enquanto há um em andamento */
.button.is-locked, .button.is-locked:hover { background: #e6e9ee !important; color: #9aa4b2 !important; box-shadow: none !important; transform: none !important; cursor: not-allowed; }
.portal-sidebar button.is-locked, .portal-sidebar button.is-locked:hover { opacity: .4; cursor: not-allowed; background: transparent; transform: none; color: rgba(255,255,255,.74); }
.button.is-locked::after { display: none !important; }
