/* ════════════════════════════════════════════════════════════════
   Freedom — Escolher Prestador (Etapa 4)
   CSS isolado — usa tokens de design-tokens.css
   ════════════════════════════════════════════════════════════════ */

/* ── Overlay (tela cheia) ─────────────────────────────────────── */
.ep-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 99000 !important;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Entrada */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow, 0.35s) var(--ease, ease),
              transform var(--dur-slow, 0.35s) var(--ease, ease);
}
.ep-overlay.ep-overlay-visible {
  opacity: 1;
  transform: translateY(0);
}
.ep-overlay.ep-overlay-exit {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

/* ── Tela (scroll interno) ───────────────────────────────────── */
.ep-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

/* ── Header fixo ─────────────────────────────────────────────── */
.ep-header {
  background: var(--surface,#1A1A1A);
  border-bottom: 1px solid var(--bd, rgba(255,255,255,0.08));
  padding: 0 0 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs, 0 1px 4px rgba(0,0,0,.06));
}

.ep-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
}

.ep-titulo {
  font-size: 20px;
  font-weight: 800;
  color: var(--tx,#fff);
  margin: 0 0 2px;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.ep-subtitulo {
  font-size: 13px;
  color: var(--tx3,#888);
  margin: 0;
  font-weight: 500;
}

.ep-btn-fechar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg2, rgba(255,255,255,0.08));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx2,#aaa);
  transition: background 0.15s;
}
.ep-btn-fechar:hover { background: var(--bd2, rgba(255,255,255,0.12)); }
.ep-btn-fechar svg { width: 16px; height: 16px; }

/* ── Ordenação ───────────────────────────────────────────────── */
.ep-sort-wrap {
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ep-sort-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx4,#555);
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}

.ep-sort-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ep-sort-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--r-pill, 9999px);
  border: 1.5px solid var(--bd, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--tx3,#888);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
  white-space: nowrap;
}
.ep-sort-pill:hover {
  border-color: var(--pr,#00C9B8);
  color: var(--pr,#00C9B8);
  background: var(--pr-lt,rgba(0,201,184,.15));
}
.ep-sort-pill.active {
  background: var(--pr,#00C9B8);
  border-color: var(--pr,#00C9B8);
  color: #fff;
}

/* ── Conteúdo (scroll) ───────────────────────────────────────── */
.ep-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* ── Lista de cards ──────────────────────────────────────────── */
.ep-lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Card do prestador ───────────────────────────────────────── */
.ep-card {
  background: var(--surface,#1A1A1A);
  border-radius: var(--r-lg, 20px);
  padding: 16px;
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,.08));
  border: 1.5px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.ep-card:hover {
  border-color: var(--pr-lt2,rgba(0,201,184,.2));
  box-shadow: var(--shadow, 0 4px 20px rgba(0,0,0,.10));
}

/* Animação de entrada escalonada */
@keyframes epCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ep-card-appear {
  animation: epCardIn 0.32s var(--ease, ease) both;
}

/* ── Badges ──────────────────────────────────────────────────── */
.ep-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ep-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill, 9999px);
  background: var(--pr-lt,rgba(0,201,184,.15));
  color: var(--pr,#00C9B8);
  border: 1px solid var(--pr-lt2,rgba(0,201,184,.2));
  letter-spacing: .02em;
}

/* ── Corpo do card ───────────────────────────────────────────── */
.ep-card-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

/* ── Foto ────────────────────────────────────────────────────── */
.ep-foto-wrap {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  position: relative;
}

.ep-foto {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--pr-lt2,rgba(0,201,184,.2));
}

.ep-foto-inicial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pr,#00C9B8), var(--pr-dk, #00A99A));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  border: 2px solid var(--pr-lt2,rgba(0,201,184,.2));
}

/* ── Informações ─────────────────────────────────────────────── */
.ep-info {
  flex: 1;
  min-width: 0;
}

.ep-nome {
  font-size: 15px;
  font-weight: 800;
  color: var(--tx,#fff);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-stars {
  font-size: 13px;
  font-weight: 600;
  color: var(--amber, #F59E0B);
  margin-bottom: 5px;
}

.ep-avalia-count {
  color: var(--tx4,#555);
  font-weight: 400;
}

.ep-avalia-novo {
  font-size: 12px;
  color: var(--tx4,#555);
  font-weight: 500;
}

.ep-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ep-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--tx3,#888);
  font-weight: 500;
}
.ep-meta-item svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--tx4,#555);
}

/* ── Valor ───────────────────────────────────────────────────── */
.ep-valor {
  font-size: 16px;
  font-weight: 800;
  color: var(--tx,#fff);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

/* ── Botão confirmar ─────────────────────────────────────────── */
.ep-btn-confirmar {
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--r, 14px);
  border: none;
  background: var(--pr,#00C9B8);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: var(--pr-shadow, 0 6px 20px rgba(0,201,184,.28));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ep-btn-confirmar:hover:not(:disabled) {
  background: var(--pr-dk, #00A99A);
  box-shadow: 0 8px 24px rgba(0,201,184,.36);
  transform: translateY(-1px);
}
.ep-btn-confirmar:active:not(:disabled) {
  transform: translateY(0);
}
.ep-btn-confirmar:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Spinner no botão ────────────────────────────────────────── */
@keyframes epSpin { to { transform: rotate(360deg); } }
.ep-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: epSpin 0.7s linear infinite;
}

/* ── Estado vazio ────────────────────────────────────────────── */
.ep-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--tx4,#555);
}
.ep-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  line-height: 1;
}
.ep-empty-txt {
  font-size: 15px;
  font-weight: 700;
  color: var(--tx2,#aaa);
  margin-bottom: 6px;
}
.ep-empty-sub {
  font-size: 13px;
  color: var(--tx4,#555);
  line-height: 1.5;
}

/* ── Skeleton loader ─────────────────────────────────────────── */
@keyframes epShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.ep-skeleton {
  height: 130px;
  border-radius: var(--r-lg, 20px);
  background: linear-gradient(90deg, var(--bg2, #000) 25%, #141e38 50%, var(--bg2, #000) 75%);
  background-size: 800px 100%;
  animation: epShimmer 1.4s linear infinite;
}

/* ── Modal de confirmação ────────────────────────────────────── */
.ep-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99500; /* acima do ep-overlay (99000) */
  background: rgba(0,0,0,.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(2px);
}
@media (min-height: 500px) {
  .ep-modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.ep-modal-box {
  background: var(--surface,#1A1A1A);
  border-radius: var(--r-xl, 24px) var(--r-xl, 24px) 0 0;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-lg, 0 16px 48px rgba(0,0,0,.14));
  animation: epModalIn 0.28s var(--spring, cubic-bezier(0.34,1.56,0.64,1)) both;
}
@media (min-height: 500px) {
  .ep-modal-box {
    border-radius: var(--r-xl, 24px);
    padding: 32px 24px;
  }
}

@keyframes epModalIn {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ep-modal-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 12px;
}

.ep-modal-titulo {
  font-size: 18px;
  font-weight: 800;
  color: var(--tx,#fff);
  margin: 0 0 10px;
}

.ep-modal-msg {
  font-size: 15px;
  color: var(--tx3,#888);
  line-height: 1.5;
  margin: 0 0 24px;
}

.ep-modal-btns {
  display: flex;
  gap: 10px;
}

/* Estado: prestador indisponível — botões empilhados */
.ep-modal-btns--col {
  flex-direction: column;
  gap: 8px;
}

.ep-modal-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--r, 14px);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}
.ep-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ep-modal-btn-cancel {
  background: var(--bg2, rgba(255,255,255,0.08));
  color: var(--tx2,#aaa);
}
.ep-modal-btn-cancel:hover:not(:disabled) {
  background: var(--bd2, rgba(255,255,255,0.12));
}

.ep-modal-btn-ok {
  background: var(--pr,#00C9B8);
  color: #fff;
  box-shadow: var(--pr-shadow, 0 6px 20px rgba(0,201,184,.28));
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-modal-btn-ok:hover:not(:disabled) {
  background: var(--pr-dk, #00A99A);
}