/* Envio de arquivos — fluxo orientado ao pedido (cliente) */

.pc-fa {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pc-fa-msg {
  margin: 0;
  font-size: 0.88rem;
  min-height: 1.25rem;
}

.pc-fa-msg:empty {
  display: none;
  min-height: 0;
}

/* —— módulo pl-fa (inline — sem dependência externa) —— */

.pl-fa-shell {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 52rem;
}

.pl-fa-status {
  padding: 1.35rem 1.5rem;
  border-radius: 14px;
  border: none;
  background: #f8fafc;
}

.pl-fa-status--gray { background: #f1f5f9; color: #334155; }
.pl-fa-status--yellow { background: #fffbeb; color: #78350f; }
.pl-fa-status--purple { background: #f5f3ff; color: #5b21b6; }
.pl-fa-status--orange { background: #fff7ed; color: #9a3412; }
.pl-fa-status--blue { background: #eff6ff; color: #1e40af; }
.pl-fa-status--green { background: #ecfdf5; color: #047857; }

.pl-fa-status__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.pl-fa-status__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.pl-fa-status__desc {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.88;
  max-width: 38rem;
}

.pl-fa-status__meta {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.75;
}

.pl-fa-block__title {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.pl-fa-files {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pl-fa-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pl-fa-file-row__main {
  min-width: 0;
  flex: 1 1 12rem;
}

.pl-fa-file-row__role {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.pl-fa-file-row__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.pl-fa-file-row__meta {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.pl-fa-file-row__pill {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
}

.pl-fa-file-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.pl-fa-file-row__actions .btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.pl-fa-files-empty {
  margin: 0;
  padding: 1.25rem 1.15rem;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
}

.pl-fa-action {
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.pl-fa-action__title {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.pl-fa-action__msg {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #334155;
}

.pl-fa-action__msg--green { color: #047857; font-weight: 600; }
.pl-fa-action__msg--muted { color: #64748b; }

.pl-fa-action__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pl-fa-team-msg {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  background: #f8fafc;
  border-left: 3px solid #1a5af5;
}

.pl-fa-team-msg__title {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.pl-fa-team-msg__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #334155;
  white-space: pre-line;
}

.pl-fa-upload-form,
.pl-fa-replace-form,
.pl-fa-send-form__grid {
  display: grid;
  gap: 0.75rem;
}

.pl-fa-upload-form {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  margin-top: 0.5rem;
}

.pl-fa-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.pl-fa-field__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.pl-fa-field input[type='file'] {
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fafbfc;
}

.pl-fa-services__list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.pl-fa-service-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.pl-fa-history__title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.pl-fa-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Histórico — horizontal */
.pl-fa-timeline--horizontal {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.pl-fa-timeline--horizontal .pl-fa-timeline__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 0;
  min-width: 5.5rem;
  padding: 0 0.4rem;
  position: relative;
}

.pl-fa-timeline--horizontal .pl-fa-timeline__item:not(.is-last)::before {
  content: '';
  position: absolute;
  top: 0.55rem;
  left: calc(50% + 0.7rem);
  right: calc(-50% + 0.7rem);
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}

.pl-fa-timeline--horizontal .pl-fa-timeline__item:not(.is-last)::after {
  display: none;
}

.pl-fa-timeline--horizontal .pl-fa-timeline__check {
  margin-bottom: 0.35rem;
}

.pl-fa-timeline--horizontal .pl-fa-timeline__label {
  font-size: 0.78rem;
  line-height: 1.3;
}

.pl-fa-timeline--horizontal .pl-fa-timeline__time {
  font-size: 0.68rem;
  white-space: nowrap;
}

.pl-fa-timeline__item {
  position: relative;
}

.pl-fa-timeline__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.65rem;
  font-weight: 800;
  z-index: 1;
  flex-shrink: 0;
}

.pl-fa-timeline__label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
}

.pl-fa-timeline__time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  color: #94a3b8;
}

/* Preview PDF */
.pc-fa-preview {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: none;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.pc-fa-preview:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-fa-preview__card {
  width: min(920px, 100%);
  height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

.pc-fa-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8edf2;
}

.pc-fa-preview__head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.pc-fa-preview__frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #f8fafc;
}

/* Modal contratar */
.pc-fa-hire-modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  padding: 1.25rem 1.35rem;
}

.pc-fa-hire-modal h3 {
  margin: 0 0 1rem;
}

.pc-fa-hire-modal__services {
  display: grid;
  gap: 0.85rem;
}

.pc-fa-hire-line {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  cursor: pointer;
}

.pc-fa-hire-pages {
  margin: -0.35rem 0 0 1.9rem;
}

.pc-fa-hire-pages input {
  width: 100%;
  max-width: 180px;
  margin-top: 0.35rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.pc-fa-hire-summary {
  margin-top: 1rem;
  padding: 0.85rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 0.92rem;
}

.pc-fa-hire-modal__actions {
  margin-top: 1rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .pl-fa-upload-form {
    grid-template-columns: 1fr;
  }

  .pl-fa-status__title {
    font-size: 1.15rem;
  }
}

/* Mobile painel — envio de arquivo (≤960px) */
@media (max-width: 960px) {
  .pl-fa-shell {
    max-width: 100%;
    gap: 1.25rem;
  }

  .pl-fa-status {
    padding: 1rem 0.85rem;
  }

  .pl-fa-status__title {
    font-size: 1.1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .pl-fa-status__desc {
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .pl-fa-file-row {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
  }

  .pl-fa-file-row__main {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .pl-fa-file-row__name {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .pl-fa-file-row__actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .pl-fa-file-row__actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Histórico: vertical no mobile */
  .pl-fa-timeline--horizontal {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .pl-fa-timeline--horizontal .pl-fa-timeline__item {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    text-align: left !important;
    flex: none !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0.55rem 0 !important;
    gap: 0.65rem;
  }

  .pl-fa-timeline--horizontal .pl-fa-timeline__item:not(.is-last)::before,
  .pl-fa-timeline--horizontal .pl-fa-timeline__item:not(.is-last)::after {
    display: none !important;
  }

  .pl-fa-timeline--horizontal .pl-fa-timeline__check {
    margin: 0.15rem 0 0 !important;
    flex-shrink: 0;
  }

  .pl-fa-timeline--horizontal .pl-fa-timeline__label {
    font-size: 0.8125rem;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal !important;
  }

  .pl-fa-timeline--horizontal .pl-fa-timeline__time {
    white-space: normal !important;
  }

  .pl-fa-upload-form {
    grid-template-columns: 1fr !important;
  }

  .pc-fa-hire-modal {
    width: calc(100% - 1rem);
    max-width: 100%;
    margin: 0 auto;
  }
}
