/* Link de Login no Header */
.login { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #3a4780; border-radius: 12px; padding: 10px 16px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .2s ease, border-color .2s ease; }
.login:hover { background: rgba(79,107,255,.16); border-color: #4f6bff; text-decoration: none; }
@media (max-width: 1040px) { .login { padding: 9px 13px; } }

/* Estrutura do Portal */
.portal-page { min-height: 100vh; display: flex; flex-direction: column; }
.portal-page .ptl { flex: 1 0 auto; width: 100%; min-height: 0; display: flex; flex-direction: column; }
.portal-page #v-login, .portal-page #v-reset { width: 100%; max-width: 440px; margin: auto; }
.portal-page #v-app { width: 100%; }
.ptl { max-width: 1100px; margin: 0 auto; padding: 56px 24px 96px; min-height: 70vh; }
.ptl.ptw { max-width: 1320px; }

/* Card de Login / Recuperar Senha */
.pt-card { max-width: 440px; margin: 40px auto; background: #fff; color: #141a36; border-radius: 20px; padding: 34px; color-scheme: light; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.pt-card h1, .pt-card h2 { color: #141a36; font-size: 2rem; }
.pt-card h2 { font-size: 1.5rem; }
.pt-card .sub { color: #4a5170; margin: 8px 0 10px; font-size: 16px; }
.pt-card label { display: block; font-weight: 600; font-size: 15px; margin-top: 14px; }
.pt-card .opt { font-weight: 400; color: #5b6385; }
.pt-card input, .pt-card select, .pt-card textarea { display: block; width: 100%; margin-top: 6px; font: 400 16px "Instrument Sans", system-ui, sans-serif; color: #141a36; background: #f5f7ff; border: 1px solid #c5cdea; border-radius: 10px; padding: 12px 14px; }
.pt-card input:focus, .pt-card select:focus, .pt-card textarea:focus { outline: 3px solid #4f6bff; outline-offset: 1px; background: #fff; }
.pt-card ::placeholder { color: #6a7396; }
.pt-card .fbtn { margin-top: 20px; }
.pt-link { background: none; border: 0; color: #3b4fd6; font: 500 15px "Instrument Sans", sans-serif; cursor: pointer; padding: 8px 0 0; text-decoration: underline; }
.pt-msg { min-height: 1.3em; font-size: 15px; margin: 12px 0 0; color: #4a5170; }
.pt-msg.err { color: #b91c1c; } .pt-msg.ok { color: #15803d; }

/* Mostrar/Ocultar Senha */
.pt-pw { position: relative; display: block; margin-top: 6px; }
.pt-card .pt-pw input { margin-top: 0; padding-right: 78px; }
.pt-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #3b4fd6; font: 600 14px "Instrument Sans", system-ui, sans-serif; padding: 8px 10px; cursor: pointer; border-radius: 8px; }
.pt-eye:hover { background: #e8ecff; }
.pt-eye:focus-visible { outline: 3px solid #4f6bff; outline-offset: 1px; }

/* Dashboard do Cliente */
.pt-top h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.pt-top p { color: var(--mute); margin-top: 8px; }
.pt-tabs { display: flex; gap: 6px; margin: 28px 0 26px; border-bottom: 1px solid var(--line); }
.pt-tabs button { background: none; border: 0; color: var(--mute); font: 600 17px Jost, sans-serif; padding: 12px 20px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pt-tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--accent); }
.pt-tabs button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.pt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.pt-stat { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: rgba(255,255,255,.04); }
.pt-stat small { display: block; color: var(--mute); font-size: 15px; }
.pt-stat b { display: block; font: 600 2.3rem/1.2 Jost, sans-serif; }
@media (max-width: 860px) { .pt-stats { grid-template-columns: 1fr 1fr; } .pt-card { padding: 26px; } .ptl { padding: 36px 20px 72px; } }

/* Produtos e Serviços */
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.pt-prod { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: linear-gradient(160deg, rgba(99,102,241,.14), rgba(255,255,255,.02)); }
.pt-prod h3 { font-size: 1.3rem; }
.pt-prod p { color: var(--mute); font-size: 16px; margin: 0; }
.pt-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; }
.pt-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--mute); font-size: 14px; }

/* Status Pills */
.pt-pill { flex: none; display: inline-block; font: 600 13px "Instrument Sans", sans-serif; padding: 3px 11px; border-radius: 20px; border: 1px solid; white-space: nowrap; }
.p-ok { color: #34d399; border-color: #1f7a5a; background: rgba(52,211,153,.12); }
.p-dev { color: #8fa2ff; border-color: #3a4780; background: rgba(124,140,255,.14); }
.p-new { color: #22d3ee; border-color: #157a8c; background: rgba(34,211,238,.12); }
.p-warn { color: #fbbf24; border-color: #8a6a14; background: rgba(251,191,36,.12); }
.p-mute { color: #b8c2e4; border-color: #3a4780; background: rgba(255,255,255,.05); }

/* Lista de Pedidos (Requests) */
.pt-empty { border: 1px dashed var(--line); border-radius: 18px; padding: 40px 24px; text-align: center; color: var(--mute); }
.pt-form { max-width: none; margin: 0 0 28px; }
.pt-reqs { display: grid; gap: 14px; }
.pt-req { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: start; border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px; background: rgba(255,255,255,.04); }
.pt-req h3 { font-size: 1.15rem; }
.pt-req p { color: var(--mute); margin: 4px 0 0; font-size: 15px; }
.pt-note { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--accent); background: rgba(34,211,238,.08); border-radius: 0 10px 10px 0; font-size: 15px; }
.pt-steps { display: flex; gap: 4px; margin-top: 6px; }
.pt-steps i { flex: 1; height: 4px; border-radius: 2px; background: #26315f; }
.pt-steps i.on { background: var(--grad); }
@media (max-width: 860px) { .pt-req { grid-template-columns: 1fr; } }

/* Ações do Pedido (Confirmar, etc) */
.pt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pt-actions .pt-hint { flex-basis: 100%; margin: 0 0 2px; color: var(--ink); font-size: 15px; }
.pt-actions .btn { padding: 10px 18px; font-size: 15px; }
.pt-changes { flex-basis: 100%; display: grid; gap: 10px; justify-items: start; }
.pt-changes[hidden] { display: none; }

/* Formulário Colapsável de Novo Pedido */
.pt-bar { margin: 0 0 24px; }
.pt-formact { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.pt-formact .fbtn { margin-top: 0; flex: 1 1 220px; }
.pt-cancel { background: none; border: 0; color: #3b4fd6; font: 600 15px "Instrument Sans", system-ui, sans-serif; cursor: pointer; padding: 10px 6px; text-decoration: underline; }
.pt-cancel:focus-visible { outline: 3px solid #4f6bff; outline-offset: 2px; border-radius: 6px; }

/* Comentários no Portal */
.pt-cmitem { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 10px; background: rgba(255,255,255,.04); }
.pt-cmitem.team { border-left: 3px solid var(--accent); }
.pt-cmitem.me { border-left: 3px solid #8fa2ff; }
.pt-cmhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--mute); }
.pt-cmhead b { color: var(--ink); font-weight: 600; }
.pt-req .pt-cmbody { margin: 6px 0 0; font-size: 15px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-cm { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.pt-cmtoggle { background: none; border: 0; color: var(--accent); font: 600 15px "Instrument Sans", system-ui, sans-serif; cursor: pointer; padding: 6px 0; }
.pt-cmtoggle:hover { text-decoration: underline; }
.pt-cmtoggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.pt-cmform { display: grid; gap: 10px; justify-items: start; margin-top: 12px; }
.pt-cmform textarea { width: 100%; }
.pt-cmform .btn { padding: 10px 18px; font-size: 15px; }
.pt-req .pt-cmempty { margin: 10px 0 0; font-size: 14px; }
.pt-cmform .ops-attbox { width: 100%; }

/* Componentes de Input do Portal (compartilhados com Admin) */
.ops-attbox { margin-top: 10px; }
.ops-attrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ops-attbtn { background: rgba(255,255,255,.06); border: 1px dashed #3a4780; border-radius: 10px; color: var(--ink); font: 600 14px "Instrument Sans", system-ui, sans-serif; padding: 8px 14px; cursor: pointer; }
.ops-attbtn:hover { background: rgba(79,107,255,.18); }
.ops-attbtn:focus-visible, .ops-chipx:focus-visible, .ops-fbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ops-atthint { font-size: 13px; color: var(--mute); }
.ops-attlist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ops-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 13px; color: var(--ink); max-width: 100%; }
.ops-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ops-chipx { background: none; border: 0; color: #fca5a5; font: 600 12px "Instrument Sans", sans-serif; cursor: pointer; padding: 4px 8px; border-radius: 12px; }
.ops-chipx:hover { background: rgba(252,165,165,.15); }
.ops-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ops-fbtn { background: rgba(79,107,255,.16); border: 1px solid #3a4780; border-radius: 10px; color: var(--ink); font: 500 13px "Instrument Sans", system-ui, sans-serif; padding: 6px 12px; cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ops-fbtn:hover { background: rgba(79,107,255,.3); }
/* Correções Portal Mobile */
@media (max-width: 640px) {
  .ptl { padding: 32px 16px 64px; }
  .pt-card { padding: 24px 20px; margin: 20px auto; border-radius: 16px; }
  .pt-tabs { margin: 20px 0; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .pt-tabs button { padding: 10px 14px; font-size: 15px; }
  .pt-stats { grid-template-columns: 1fr; gap: 12px; }
  .pt-req { padding: 16px; grid-template-columns: 1fr; }
  .pt-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pt-actions { flex-direction: column; align-items: stretch; }
  .pt-actions .btn { width: 100%; text-align: center; }
}