/* Portal Pagamento — ECO Ubatuba
   Usa os mesmos tokens visuais do PrimeNG / tema emerald do portal */

/* ═══════════════════════════════════════════════════
   LISTA DE VEÍCULOS — Status + Pagamento
   ═══════════════════════════════════════════════════ */

.pp-status-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Badge — imita p-tag p-tag-warning do PrimeNG */
.pp-debito-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .6rem;
  background-color: #f97316;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.5;
}
.pp-debito-badge svg {
  width: .75rem;
  height: .75rem;
  stroke: #fff;
  flex-shrink: 0;
}

/* Valor — destaque */
.pp-debito-valor {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color, #4b5563);
  white-space: nowrap;
}

/* Botão Pagar — imita p-button do PrimeNG */
.pp-btn-pagar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65625rem 1.09375rem;
  font-size: .875rem;
  font-weight: 700;
  font-family: var(--font-family);
  color: #fff;
  background: var(--primary-color, #10b981);
  border: 1px solid var(--primary-color, #10b981);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.pp-btn-pagar:hover {
  background: #059669;
  border-color: #059669;
}
.pp-btn-pagar:active {
  background: #047857;
  border-color: #047857;
}
.pp-btn-pagar:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .2rem #a7f3d0;
}

/* ═══════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pp-status-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .pp-debito-badge {
    justify-content: center;
    padding: .3rem .6rem;
  }
  .pp-debito-valor {
    text-align: center;
    font-size: 1.1rem;
  }
  .pp-btn-pagar {
    width: 100%;
    padding: .75rem 1.25rem;
    font-size: 1rem;
  }
}

/* ═══════════════════════════════════════════════════
   MODAL DE PAGAMENTO
   ═══════════════════════════════════════════════════ */

.pp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--maskbg, rgba(0,0,0,.4));
  opacity: 0;
  transition: opacity .2s ease;
  padding: 16px;
}
.pp-overlay.pp-visible {
  opacity: 1;
}

/* Card — imita p-card + p-dialog do PrimeNG */
.pp-modal {
  background: var(--surface-overlay, #fff);
  color: var(--text-color, #4b5563);
  border-radius: 6px;
  box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), 0 24px 38px 3px rgba(0,0,0,.14), 0 9px 46px 8px rgba(0,0,0,.12);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform .2s ease;
}
.pp-overlay.pp-visible .pp-modal {
  transform: scale(1);
}

/* Header — imita p-dialog-header */
.pp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--surface-border, #dfe7ef);
  gap: 8px;
}
.pp-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--surface-900, #111827);
  font-family: var(--font-family);
}
.pp-header .pp-valor-header {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color, #10b981);
  white-space: nowrap;
}
.pp-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-color-secondary, #6b7280);
  cursor: pointer;
  transition: background-color .2s, color .2s;
  flex-shrink: 0;
}
.pp-close-btn:hover {
  background: var(--surface-hover, #f6f9fc);
  color: var(--surface-900, #111827);
}

/* Body — formulário */
.pp-body {
  padding: 1.5rem;
}
.pp-field {
  margin-bottom: 1rem;
}
.pp-field label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--surface-900, #111827);
  margin-bottom: .5rem;
}
/* Inputs — imita p-inputtext */
.pp-field input,
.pp-field select {
  width: 100%;
  padding: .75rem .75rem;
  font-size: 1rem;
  font-family: var(--font-family);
  color: var(--surface-900, #111827);
  background: var(--surface-0, #fff);
  border: 1px solid var(--surface-border, #dfe7ef);
  border-radius: 6px;
  outline: none;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.pp-field input:focus,
.pp-field select:focus {
  border-color: var(--primary-color, #10b981);
  box-shadow: 0 0 0 .2rem #a7f3d0;
}
.pp-field input.pp-error,
.pp-field select.pp-error {
  border-color: var(--red-500, #ff3d32);
}
.pp-row {
  display: flex;
  gap: .75rem;
}
.pp-row .pp-field {
  flex: 1;
}

/* reCAPTCHA */
.pp-recaptcha {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

/* Footer — botões do modal */
.pp-footer {
  display: flex;
  gap: .75rem;
  padding: 0 1.5rem 1.5rem;
}
/* Botão submit — imita p-button */
.pp-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-family);
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.pp-btn:disabled {
  opacity: .6;
  cursor: default;
  pointer-events: none;
}
.pp-btn-submit {
  background: var(--primary-color, #10b981);
  border-color: var(--primary-color, #10b981);
  color: #fff;
}
.pp-btn-submit:hover:not(:disabled) {
  background: #059669;
  border-color: #059669;
}
.pp-btn-cancel {
  background: var(--surface-0, #fff);
  color: var(--surface-700, #374151);
  border-color: var(--surface-border, #dfe7ef);
}
.pp-btn-cancel:hover {
  background: var(--surface-hover, #f6f9fc);
}

/* ═══════════════════════════════════════════════════
   SUCESSO
   ═══════════════════════════════════════════════════ */
.pp-sucesso {
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.pp-sucesso svg {
  width: 4rem;
  height: 4rem;
  color: var(--primary-color, #10b981);
  margin-bottom: 1rem;
}
.pp-sucesso h3 {
  margin: 0 0 .5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--surface-900, #111827);
}
.pp-sucesso p {
  margin: 0 0 1.5rem;
  color: var(--text-color-secondary, #6b7280);
}
.pp-sucesso .pp-codigo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color, #10b981);
  margin-bottom: 1.5rem;
}

/* Spinner */
.pp-spinner {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pp-spin .6s linear infinite;
  vertical-align: middle;
  margin-right: .5rem;
}
@keyframes pp-spin {
  to { transform: rotate(360deg); }
}

/* Mensagem de erro */
.pp-erro-msg {
  color: var(--red-500, #ff3d32);
  font-size: .875rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   MODAL — MOBILE
   ═══════════════════════════════════════════════════ */
@media (max-width: 576px) {
  .pp-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .pp-modal {
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 92vh;
  }
  .pp-header {
    padding: 1.25rem 1rem;
    flex-wrap: wrap;
  }
  .pp-header h2 {
    font-size: 1.1rem;
  }
  .pp-body {
    padding: 1.25rem 1rem;
  }
  .pp-row {
    flex-direction: column;
    gap: 0;
  }
  .pp-footer {
    padding: 0 1rem 1.25rem;
    flex-direction: column;
    gap: .5rem;
  }
  .pp-footer .pp-btn-cancel {
    order: 2;
  }
  .pp-footer .pp-btn-submit {
    order: 1;
  }
}
