/* ==========================================================================
   Entrypoint Page — Standalone Profile & Purchase Flow
   Hosted inside the full responsive layout; suppresses site chrome.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset Foundation/site-bundle body styles for this page
   (we deliberately don't render header.php or footer.php chrome)
   -------------------------------------------------------------------------- */
body.show-profile-page {
  background-color: var(--ep-bg, #F8FAFC) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Any Foundation .reveal modal must start hidden. Foundation's JS toggles
   display when opened; this rule guarantees we never see the loose holder
   divs from footer_loader.php (message-view-modal, chat-view-modal, etc.)
   if Foundation's CSS hasn't applied yet or got overridden. */
body.show-profile-page .reveal {
  display: none;
}

/* Hide site-wide floating widgets that footer_loader.php / public.js
   inject and that we don't want on the quick-profile page. */
body.show-profile-page .chat_assistant,
body.show-profile-page #caller_first_time,
body.show-profile-page #overeighteendiv,
body.show-profile-page #cookies-notice,
body.show-profile-page #notice,
body.show-profile-page #notification,
body.show-profile-page #window_fade,
body.show-profile-page #caller-menu-underlay,
body.show-profile-page #dropdown-search-underlay,
body.show-profile-page .top-offer,
body.show-profile-page #free_offer_header,
body.show-profile-page .header-utility-bar,
body.show-profile-page .header-desktop,
body.show-profile-page .header-mobile,
body.show-profile-page .footer,
body.show-profile-page .footer-mobile,
body.show-profile-page .breadcrumb,
body.show-profile-page .breadcrumbs,
body.show-profile-page .browse-toolbar,
body.show-profile-page .sticky-cta,
body.show-profile-page .stickyad,
body.show-profile-page .ad-container,
body.show-profile-page .ad-wrap,
body.show-profile-page .address_book,
body.show-profile-page #address_book {
  display: none !important;
}

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --ep-primary: #4F46E5;        /* indigo-600 */
  --ep-primary-light: #EEF2FF;
  --ep-primary-dark: #4338CA;
  --ep-success: #10B981;
  --ep-success-light: #ECFDF5;
  --ep-warning: #F59E0B;
  --ep-warning-light: #FFFBEB;
  --ep-danger: #EF4444;
  --ep-danger-light: #FEF2F2;
  --ep-text: #0F172A;
  --ep-text-muted: #64748B;
  --ep-text-light: #94A3B8;
  --ep-border: #E2E8F0;
  --ep-bg: #F8FAFC;
  --ep-card-bg: #FFFFFF;
  --ep-radius: 14px;
  --ep-radius-sm: 10px;
  --ep-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
  --ep-shadow-md: 0 4px 6px -1px rgba(15,23,42,0.05), 0 2px 4px -2px rgba(15,23,42,0.05);
  --ep-shadow-lg: 0 20px 25px -5px rgba(15,23,42,0.08), 0 10px 10px -5px rgba(15,23,42,0.04);
  --ep-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ep-text);
  background-color: var(--ep-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* --------------------------------------------------------------------------
   1. Page Container
   -------------------------------------------------------------------------- */
#ep-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  background-color: var(--ep-card-bg);
  min-height: 100vh;
  position: relative;
}

@media (min-width: 480px) {
  #ep-page {
    margin: 16px auto;
    min-height: calc(100vh - 32px);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow-lg);
    padding: 32px 24px 48px;
  }
}

/* --------------------------------------------------------------------------
   2. Profile Section
   -------------------------------------------------------------------------- */
#ep-profile {
  text-align: center;
  padding-bottom: 24px;
  position: relative;
}

/* Avatar */
.ep-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.ep-avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--ep-primary), #A78BFA, var(--ep-primary));
  opacity: 0;
  z-index: 0;
  transition: opacity 400ms ease;
}

body.ep-status-online .ep-avatar-wrap::before {
  opacity: 0.6;
  animation: ep-rotate 6s linear infinite;
}

@keyframes ep-rotate {
  to { transform: rotate(360deg); }
}

.ep-avatar {
  position: relative;
  z-index: 1;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  box-shadow: var(--ep-shadow-md);
  border: 4px solid var(--ep-card-bg);
}

/* Name */
.ep-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ep-text);
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Status badge */
.ep-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.ep-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ep-status.online {
  color: var(--ep-success);
  background-color: var(--ep-success-light);
}

.ep-status.online::before {
  background-color: var(--ep-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.ep-status.busy {
  color: var(--ep-warning);
  background-color: var(--ep-warning-light);
}

.ep-status.busy::before {
  background-color: var(--ep-warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.ep-status.offline {
  color: var(--ep-text-muted);
  background-color: var(--ep-bg);
}

.ep-status.offline::before {
  background-color: var(--ep-text-light);
}

/* Rating */
.ep-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.ep-stars {
  display: inline-flex;
  gap: 2px;
}

.ep-stars i {
  font-size: 0.95rem;
}

.ep-stars .fas {
  color: #FBBF24;
}

.ep-stars .far {
  color: var(--ep-border);
}

.ep-rating-count {
  color: var(--ep-text-muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

/* Headline */
.ep-headline {
  font-size: 1rem;
  color: var(--ep-text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
  font-style: italic;
}

/* Description */
.ep-description {
  font-size: 0.92rem;
  color: var(--ep-text);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 8px;
  transition: max-height 0.3s ease;
}

.ep-description.collapsed {
  max-height: 4.8em; /* ~3 lines */
  overflow: hidden;
  position: relative;
}

.ep-description.collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.6em;
  background: linear-gradient(transparent, var(--ep-card-bg));
}

.ep-show-more {
  display: inline-block;
  color: var(--ep-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin-bottom: 8px;
}

.ep-show-more:hover {
  text-decoration: underline;
}

/* Check status link */
.ep-check-status {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.75rem;
  color: var(--ep-text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--ep-radius-sm);
  transition: color var(--ep-transition), background-color var(--ep-transition);
}

.ep-check-status:hover {
  color: var(--ep-primary);
  background-color: var(--ep-primary-light);
}

/* --------------------------------------------------------------------------
   3. Services Section
   -------------------------------------------------------------------------- */
#ep-services {
  padding: 24px 0;
}

.ep-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 380px) {
  .ep-services-grid {
    grid-template-columns: 1fr;
  }
}

/* Service card */
.ep-service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 10px;
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform var(--ep-transition), box-shadow var(--ep-transition),
    border-color var(--ep-transition), background-color var(--ep-transition);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.ep-service-card:hover {
  border-color: var(--ep-primary);
  box-shadow: var(--ep-shadow-md);
  transform: translateY(-2px);
}

.ep-service-card:active {
  transform: translateY(0);
}

.ep-service-card.active {
  border-color: var(--ep-primary);
  background-color: var(--ep-primary-light);
  box-shadow: 0 0 0 1px var(--ep-primary);
}

.ep-service-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ep-service-icon {
  font-size: 1.3rem;
  background: var(--ep-primary-light);
  color: var(--ep-primary);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  line-height: 1;
}

.ep-service-card.active .ep-service-icon {
  color: var(--ep-primary-dark);
}

.ep-service-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ep-text);
  line-height: 1.2;
}

.ep-service-price {
  font-size: 0.75rem;
  color: var(--ep-text-muted);
}

.ep-service-minimum {
  font-size: 0.68rem;
  color: var(--ep-text-light);
  display: block;
}

/* Offline hint — only visible when the card is gated (talker not online). */
.ep-service-status {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ep-text-light);
  display: none;
}

.ep-service-card.disabled .ep-service-status { display: block; }
.ep-service-card.disabled .ep-service-minimum { display: none; }

/* --------------------------------------------------------------------------
   4. Auth Section (legacy; #ep-auth is now a .ep-modal)
   -------------------------------------------------------------------------- */

.ep-auth-step {
  display: none;
}

.ep-auth-step.active {
  display: block;
}

/* Input group */
.ep-input-group {
  margin-bottom: 16px;
}

.ep-input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ep-text);
  margin-bottom: 6px;
}

.ep-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ep-text);
  background-color: var(--ep-card-bg);
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  outline: none;
  transition: border-color var(--ep-transition), box-shadow var(--ep-transition);
  -webkit-appearance: none;
  appearance: none;
}

.ep-input::placeholder {
  color: var(--ep-text-light);
}

.ep-input:focus {
  border-color: var(--ep-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.ep-input:disabled {
  background-color: var(--ep-bg);
  color: var(--ep-text-muted);
  cursor: not-allowed;
}

/* Primary button */
.ep-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #FFFFFF;
  background-color: var(--ep-primary);
  border: none;
  border-radius: var(--ep-radius-sm);
  cursor: pointer;
  transition: background-color var(--ep-transition), opacity var(--ep-transition),
    transform var(--ep-transition);
  -webkit-tap-highlight-color: transparent;
  gap: 8px;
}

.ep-btn:hover {
  background-color: var(--ep-primary-dark);
}

.ep-btn:active {
  transform: scale(0.98);
}

.ep-btn:disabled {
  background-color: var(--ep-text-light);
  cursor: not-allowed;
  transform: none;
}

.ep-btn.loading {
  pointer-events: none;
  position: relative;
}

.ep-btn.loading::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: ep-spin 0.6s linear infinite;
}

/* Resend link */
.ep-resend {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--ep-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

.ep-resend:hover {
  color: var(--ep-primary);
  text-decoration: underline;
}

.ep-resend:disabled {
  color: var(--ep-text-light);
  cursor: not-allowed;
  text-decoration: none;
}

/* Error message */
.ep-error {
  color: var(--ep-danger);
  font-size: 0.82rem;
  margin-top: 8px;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   5. Payment Section (legacy; #ep-payment is now a .ep-modal)
   -------------------------------------------------------------------------- */

/* Payment summary */
.ep-payment-summary {
  background-color: var(--ep-bg);
  border-radius: var(--ep-radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
}

.ep-payment-summary strong {
  font-size: 1.1rem;
  color: var(--ep-text);
}

/* Saved cards */
.ep-saved-cards {
  margin-bottom: 20px;
}

.ep-saved-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--ep-transition), background-color var(--ep-transition);
}

.ep-saved-card:hover {
  border-color: var(--ep-primary);
}

.ep-saved-card.selected {
  border-color: var(--ep-primary);
  background-color: var(--ep-primary-light);
}

.ep-saved-card img,
.ep-saved-card .ep-card-brand {
  width: 36px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.ep-saved-card .ep-card-number {
  flex: 1;
  font-size: 0.9rem;
  color: var(--ep-text);
  font-variant-numeric: tabular-nums;
}

.ep-saved-card .ep-card-use {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ep-primary);
  flex-shrink: 0;
}

/* New card entry */
.ep-new-card {
  margin-top: 16px;
}

.ep-rg-container {
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  padding: 16px;
  background-color: var(--ep-card-bg);
  min-height: 120px;
  position: relative;
}

/* Style the RocketGate injected inputs */
#cardDataEntrypoint input,
#cardDataEntrypoint select {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--ep-text);
  background-color: var(--ep-card-bg);
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  outline: none;
  transition: border-color var(--ep-transition), box-shadow var(--ep-transition);
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 10px;
}

#cardDataEntrypoint input:focus,
#cardDataEntrypoint select:focus {
  border-color: var(--ep-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

#cardDataEntrypoint input::placeholder {
  color: var(--ep-text-light);
}

#cardDataEntrypoint select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

#cardDataEntrypoint label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ep-text);
  margin-bottom: 4px;
}

/* RocketGate loading state */
.ep-rg-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--ep-text-muted);
  font-size: 0.85rem;
  gap: 8px;
}

.ep-rg-loading::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ep-border);
  border-top-color: var(--ep-primary);
  border-radius: 50%;
  animation: ep-spin 0.6s linear infinite;
}

/* --------------------------------------------------------------------------
   6. Action Section
   -------------------------------------------------------------------------- */
#ep-action {
  display: none;
  padding: 24px 0;
}

/* Call UI */
.ep-call-ui {
  text-align: center;
}

.ep-call-ui .ep-input {
  text-align: center;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.ep-call-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 24px;
  margin-top: 16px;
}

.ep-call-status.ringing {
  color: var(--ep-warning);
  background-color: var(--ep-warning-light);
  animation: ep-pulse 1.5s ease-in-out infinite;
}

.ep-call-status.connected {
  color: var(--ep-success);
  background-color: var(--ep-success-light);
}

.ep-call-status.ended {
  color: var(--ep-text-muted);
  background-color: var(--ep-bg);
}

/* Message UI */
.ep-message-ui {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ep-message-ui textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ep-text);
  background-color: var(--ep-card-bg);
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color var(--ep-transition), box-shadow var(--ep-transition);
}

.ep-message-ui textarea:focus {
  border-color: var(--ep-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.ep-message-ui textarea::placeholder {
  color: var(--ep-text-light);
}

.ep-char-count {
  font-size: 0.75rem;
  color: var(--ep-text-light);
  text-align: right;
}

.ep-char-count.warning {
  color: var(--ep-warning);
}

.ep-char-count.over {
  color: var(--ep-danger);
  font-weight: 600;
}

/* Custom request UI */
.ep-custom-ui {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ep-custom-ui textarea {
  display: block;
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ep-text);
  background-color: var(--ep-card-bg);
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color var(--ep-transition), box-shadow var(--ep-transition);
}

.ep-custom-ui textarea:focus {
  border-color: var(--ep-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.ep-custom-ui .ep-price-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ep-text);
  text-align: center;
  padding: 8px 0;
}

/* Custom request type toggle */
.ep-custom-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ep-custom-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ep-text-muted);
  background-color: var(--ep-card-bg);
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  cursor: pointer;
  transition: all var(--ep-transition);
}

.ep-custom-type-btn:hover {
  border-color: var(--ep-primary);
  color: var(--ep-primary);
}

.ep-custom-type-btn.active {
  border-color: var(--ep-primary);
  background-color: var(--ep-primary-light);
  color: var(--ep-primary);
}

.ep-custom-note {
  font-size: 0.8rem;
  color: var(--ep-text-muted);
  margin: 4px 0 8px;
  line-height: 1.4;
}

/* Status back link */
.ep-status-back {
  display: block;
  margin-top: 16px;
  text-align: center;
  color: var(--ep-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px;
}

.ep-status-back:hover {
  text-decoration: underline;
}

/* Empty state */
.ep-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--ep-text-muted);
  font-size: 0.9rem;
}

/* Loading text */
.ep-loading-text {
  text-align: center;
  padding: 24px 16px;
  color: var(--ep-text-light);
  font-size: 0.9rem;
}

/* Success message */
.ep-success {
  text-align: center;
  padding: 32px 16px;
}

.ep-success i,
.ep-success .ep-success-icon {
  font-size: 3rem;
  color: var(--ep-success);
  margin-bottom: 12px;
  display: block;
}

.ep-success .ep-success-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ep-text);
  margin-bottom: 8px;
}

.ep-success .ep-success-message {
  font-size: 0.9rem;
  color: var(--ep-text-muted);
  line-height: 1.5;
}

/* Action result */
.ep-action-result {
  background-color: var(--ep-bg);
  border-radius: var(--ep-radius-sm);
  padding: 16px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--ep-text);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   7. Status Section
   -------------------------------------------------------------------------- */
#ep-status {
  display: none;
  padding: 24px 0;
}

.ep-pending-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ep-pending-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  background-color: var(--ep-card-bg);
  font-size: 0.85rem;
}

.ep-pending-item .ep-pending-date {
  font-size: 0.75rem;
  color: var(--ep-text-light);
  flex-shrink: 0;
}

.ep-pending-item .ep-pending-type {
  font-weight: 600;
  color: var(--ep-text);
  flex-shrink: 0;
}

.ep-pending-item .ep-pending-desc {
  flex: 1 1 100%;
  color: var(--ep-text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 4px;
}

.ep-pending-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.ep-pending-badge.pending {
  color: #92400E;
  background-color: var(--ep-warning-light);
}

.ep-pending-badge.completed {
  color: #166534;
  background-color: var(--ep-success-light);
}

.ep-pending-badge.refunded {
  color: var(--ep-text-muted);
  background-color: var(--ep-bg);
}

/* --------------------------------------------------------------------------
   8. Shared Form Elements
   -------------------------------------------------------------------------- */
.ep-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ep-text);
  margin-bottom: 6px;
}

.ep-textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ep-text);
  background-color: var(--ep-card-bg);
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color var(--ep-transition), box-shadow var(--ep-transition);
}

.ep-textarea:focus {
  border-color: var(--ep-primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.ep-textarea::placeholder {
  color: var(--ep-text-light);
}

.ep-btn-link {
  display: inline-block;
  color: var(--ep-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 0;
}

.ep-btn-link:hover {
  text-decoration: underline;
}

.ep-subsection-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ep-text);
  margin-bottom: 10px;
}

/* Discount pricing */
.ep-price-original {
  text-decoration: line-through;
  color: var(--ep-text-light);
  font-size: 0.7rem;
}

.ep-price-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ep-success);
  background-color: var(--ep-success-light);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

.ep-amount-needed {
  font-weight: 700;
  color: var(--ep-text);
}

/* --------------------------------------------------------------------------
   9. Utility Classes
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.ep-divider {
  border: none;
  border-top: 1px solid var(--ep-border);
  margin: 20px 0;
}

.ep-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ep-text);
  margin-bottom: 14px;
}

/* Vertical spacing for stacked form elements */
#ep-auth .ep-input,
#ep-action .ep-input,
#ep-payment .ep-input {
  margin-bottom: 12px;
}

#ep-auth .ep-btn,
#ep-action .ep-btn,
#ep-payment .ep-btn {
  margin-top: 4px;
}

.ep-action-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Loading spinner (centered) */
.ep-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
}

/* CSS-only spinner */
.ep-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--ep-border);
  border-top-color: var(--ep-primary);
  border-radius: 50%;
  animation: ep-spin 0.6s linear infinite;
}

/* Fade-in animation */
.ep-fade-in {
  animation: ep-fadeIn 0.35s ease-out both;
}

/* --------------------------------------------------------------------------
   9. Animations
   -------------------------------------------------------------------------- */
@keyframes ep-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ep-fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ep-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* --------------------------------------------------------------------------
   10. Responsive Adjustments
   -------------------------------------------------------------------------- */

/* Small phones: force single column services if really narrow */
@media (max-width: 319px) {
  .ep-services-grid {
    grid-template-columns: 1fr;
  }

  .ep-avatar {
    width: 100px;
    height: 100px;
  }

  .ep-title {
    font-size: 1.2rem;
  }
}

/* Standard mobile (320px+): 2-column services grid (default above) */

/* Wider mobile / small tablet (420px+): 3-column services grid (handled above) */

/* Desktop-ish: the max-width container with shadow is handled above at 480px+ */

/* --------------------------------------------------------------------------
   Modal framework
   -------------------------------------------------------------------------- */
.ep-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.ep-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ep-modal {
  position: fixed;
  z-index: 1001;
  background: var(--ep-card-bg);
  box-shadow: var(--ep-shadow-lg);
  transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 200ms ease;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.ep-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: bottom sheet */
@media (max-width: 600px) {
  .ep-modal {
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
  .ep-modal.is-open {
    transform: translateY(0);
  }
}

/* Desktop: centered card */
@media (min-width: 601px) {
  .ep-modal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.96);
    width: 92%;
    max-width: 440px;
    border-radius: var(--ep-radius);
  }
  .ep-modal.is-open {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Sign-in modal sits high on the page. The generic .ep-modal is a bottom sheet
   on mobile, which lands right where the on-screen keyboard opens for the phone/
   email field — too low. Anchor #ep-auth near the top instead (and slightly above
   center on desktop). Scoped to #ep-auth so the full-screen modals are untouched. */
@media (max-width: 600px) {
  #ep-auth.ep-modal {
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    bottom: auto;
    left: 12px;
    right: 12px;
    border-radius: var(--ep-radius);
    transform: translateY(-130%);
    padding-bottom: 12px;
  }
  #ep-auth.ep-modal.is-open {
    transform: translateY(0);
  }
}
@media (min-width: 601px) {
  #ep-auth.ep-modal {
    top: 42%;
  }
}

/* Fullscreen modal variant (video call, thread) */
.ep-modal.ep-modal-full {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  transform: none;
}

.ep-modal.ep-modal-full.is-open {
  transform: none;
}

.ep-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ep-border);
  flex-shrink: 0;
}

.ep-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ep-text);
  margin: 0;
}

.ep-modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--ep-text-muted);
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  border-radius: 50%;
  transition: background-color 150ms;
}

.ep-modal-close:hover {
  background-color: var(--ep-bg);
}

.ep-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Lock page scroll while any modal is open */
body.ep-modal-open {
  overflow: hidden;
}

.ep-fine-print {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--ep-text-muted);
  line-height: 1.45;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Payment modal — top-up summary & chips
   -------------------------------------------------------------------------- */
.ep-modal #ep-payment .ep-payment-summary,
.ep-modal .ep-payment-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(135deg, var(--ep-primary-light), #fff);
  border-radius: var(--ep-radius);
  padding: 16px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.ep-payment-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ep-text-muted);
  margin-bottom: 4px;
}

.ep-payment-balance,
.ep-payment-amount-needed {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ep-text);
}

.ep-payment-needed { text-align: right; }

.ep-topup-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.ep-topup-chip {
  border: 1.5px solid var(--ep-border);
  background: var(--ep-card-bg);
  border-radius: var(--ep-radius-sm);
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ep-text);
  cursor: pointer;
  transition: border-color 150ms, background-color 150ms;
}

.ep-topup-chip:hover { border-color: var(--ep-primary); }

.ep-topup-chip.active {
  border-color: var(--ep-primary);
  background: var(--ep-primary-light);
  color: var(--ep-primary-dark);
}

/* --------------------------------------------------------------------------
   Persistent balance bar
   -------------------------------------------------------------------------- */
.ep-balance-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ep-card-bg);
  border-top: 1px solid var(--ep-border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 50;
  font-variant-numeric: tabular-nums;
}

.ep-balance-bar-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ep-text-muted);
}

.ep-balance-bar-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ep-text);
}

.ep-balance-bar-info {
  flex: 1;
  min-width: 0;
}

.ep-btn-icon-plain {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--ep-text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms, color 150ms;
  flex-shrink: 0;
}

.ep-btn-icon-plain:hover {
  background: var(--ep-bg);
  color: var(--ep-danger);
}

#ep-page {
  padding-bottom: 80px;
}

/* --------------------------------------------------------------------------
   Message thread modal
   -------------------------------------------------------------------------- */
.ep-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--ep-bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ep-thread-loading {
  text-align: center;
  color: var(--ep-text-muted);
  padding: 32px;
  font-size: 1.5rem;
}

.ep-thread-empty {
  text-align: center;
  color: var(--ep-text-muted);
  padding: 48px 24px;
  font-size: 0.9rem;
}

.ep-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.35;
  word-wrap: break-word;
  animation: ep-bubble-in 200ms ease;
}

@keyframes ep-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ep-bubble.out {
  align-self: flex-end;
  background: var(--ep-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ep-bubble.in {
  align-self: flex-start;
  background: #fff;
  color: var(--ep-text);
  border: 1px solid var(--ep-border);
  border-bottom-left-radius: 4px;
}

.ep-bubble.pending {
  opacity: 0.55;
}

.ep-bubble.failed {
  opacity: 0.75;
  border: 1px dashed var(--ep-danger);
  cursor: pointer;
}

.ep-bubble.failed::after {
  content: "\f071";  /* exclamation-triangle */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--ep-danger);
  font-size: 0.7rem;
  margin-left: 6px;
  opacity: 0.9;
}

.ep-thread-day {
  align-self: center;
  font-size: 0.72rem;
  color: var(--ep-text-muted);
  margin: 12px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ep-thread-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ep-primary-light);
  border-top: 1px solid var(--ep-border);
  font-size: 0.85rem;
  color: var(--ep-text);
}

.ep-thread-notice-action {
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}

.ep-thread-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px 4px;
  background: var(--ep-card-bg);
  border-top: 1px solid var(--ep-border);
}

.ep-thread-compose textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1.5px solid var(--ep-border);
  border-radius: 20px;
  font: inherit;
  outline: none;
}

.ep-thread-compose textarea:focus {
  border-color: var(--ep-primary);
}

.ep-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ep-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms, transform 100ms;
}

.ep-btn-icon:hover { background: var(--ep-primary-dark); }
.ep-btn-icon:active { transform: scale(0.92); }
.ep-btn-icon:disabled { background: var(--ep-text-light); cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Call card modal
   -------------------------------------------------------------------------- */
.ep-call-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 12px;
  background: linear-gradient(180deg, #fafbff, #ffffff);
}

.ep-call-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.ep-call-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--ep-shadow-md);
  border: 3px solid #fff;
  margin-bottom: 4px;
}

.ep-call-avatar.pulse { animation: ep-pulse 1.4s ease-in-out infinite; }
.ep-call-avatar.ring  { box-shadow: 0 0 0 6px var(--ep-success-light), 0 4px 12px rgba(0,0,0,0.08); }

@keyframes ep-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 108, 247, 0.5); }
  50%      { transform: scale(1.04); box-shadow: 0 0 0 16px rgba(74, 108, 247, 0); }
}

.ep-call-name { font-size: 1.3rem; font-weight: 700; color: var(--ep-text); }
.ep-call-subtitle { font-size: 0.9rem; color: var(--ep-text-muted); line-height: 1.4; }

.ep-call-timer {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ep-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  margin: 8px 0;
}

.ep-call-cost-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ep-text-muted);
  margin: 4px 0 12px;
}

.ep-call-cost-strip > span:nth-child(2n) { color: var(--ep-text-light); }

.ep-btn-danger { background: var(--ep-danger); }
.ep-btn-danger:hover { background: #DC2626; }

.ep-call-check { font-size: 3rem; color: var(--ep-success); }

.ep-call-summary {
  font-size: 1rem;
  color: var(--ep-text-muted);
  font-variant-numeric: tabular-nums;
}


/* ── Direct phone number (published direct-dial line) ─────────────────────── */
.ep-direct-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--ep-card-bg);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow);
  text-decoration: none;
  transition: box-shadow var(--ep-transition), transform var(--ep-transition);
}
.ep-direct-number:hover { box-shadow: var(--ep-shadow-md); transform: translateY(-1px); }
.ep-direct-number:active { transform: translateY(0); }
.ep-direct-number-label {
  font-size: 0.85rem;
  color: var(--ep-text-muted);
}
.ep-direct-number-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ep-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ep-direct-number-value i { font-size: 0.85em; margin-right: 4px; }

/* ── Hide injected members chrome ─────────────────────────────────────────
   The show page renders the full responsive framework (for the call/payment
   flow), which injects logged-in caller chrome like the "My Contacts" bar.
   This is a clean profile page, so hide that chrome. */
.show-profile-page #contacts-button,
.show-profile-page #contacts-sidebar,
.show-profile-page #contacts-close { display: none !important; }
