/* EntryPoint Public UI — Regal Navy + Amber */
.ep-wrap {
  --ep-primary: #1E3A8A;
  --ep-primary-dark: #152c6a;
  --ep-accent: #D97706;
  --ep-accent-light: #f59e0b;
  --ep-bg: #f4f6fb;
  --ep-surface: #ffffff;
  --ep-border: #e2e8f0;
  --ep-text: #0f172a;
  --ep-muted: #64748b;
  --ep-radius: 14px;
  --ep-shadow: 0 4px 24px rgba(30, 58, 138, 0.08);
  --ep-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --ep-serif: "Libre Baskerville", Georgia, serif;

  font-family: var(--ep-font);
  color: var(--ep-text);
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  background: var(--ep-bg);
  border-radius: var(--ep-radius);
  box-sizing: border-box;
}

.ep-wrap *,
.ep-wrap *::before,
.ep-wrap *::after {
  box-sizing: border-box;
}

/* Hero header */
.ep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--ep-primary) 0%, var(--ep-primary-dark) 55%, #0f2744 100%);
  border-radius: var(--ep-radius);
  color: #fff;
  box-shadow: var(--ep-shadow);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.ep-header::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.ep-brand {
  margin: 0;
  font-family: var(--ep-serif);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
}

.ep-header .ep-muted {
  color: rgba(255, 255, 255, 0.82);
  margin: 6px 0 0;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.ep-user {
  text-align: right;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.ep-user .ep-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ep-link {
  color: var(--ep-accent-light);
  margin-left: 10px;
  text-decoration: none;
  font-weight: 500;
}

.ep-link:hover {
  text-decoration: underline;
  color: #fff;
}

/* Cards */
.ep-card {
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--ep-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ep-card:hover {
  box-shadow: 0 8px 32px rgba(30, 58, 138, 0.12);
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.ep-stat {
  text-align: center;
  padding: 20px 16px;
  border-top: 3px solid var(--ep-accent);
}

.ep-stat-num {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--ep-primary);
  line-height: 1.1;
}

.ep-stat span:last-child {
  color: var(--ep-muted);
  font-size: 0.85rem;
  margin-top: 4px;
  display: block;
}

/* Tabs */
.ep-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 6px;
  background: var(--ep-surface);
  border-radius: 12px;
  border: 1px solid var(--ep-border);
  box-shadow: var(--ep-shadow);
}

.ep-tab {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ep-muted);
  font-family: inherit;
  transition: all 0.15s ease;
}

.ep-tab:hover {
  background: #f1f5f9;
  color: var(--ep-primary);
}

.ep-tab.is-active {
  background: var(--ep-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.ep-tab-panel {
  display: none;
  animation: epFadeIn 0.25s ease;
}

.ep-tab-panel.is-active {
  display: block;
}

@keyframes epFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.ep-form {
  display: grid;
  gap: 4px;
}

.ep-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .ep-form-row { grid-template-columns: 1fr; }
}

.ep-form label {
  display: block;
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--ep-text);
}

.ep-form input,
.ep-form select,
.ep-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ep-form input:focus,
.ep-form select:focus,
.ep-form textarea:focus {
  outline: none;
  border-color: var(--ep-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
  background: #fff;
}

/* Buttons */
.ep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.ep-btn-primary {
  background: linear-gradient(135deg, var(--ep-primary), var(--ep-primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.35);
}

.ep-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
  color: #fff;
}

.ep-btn-outline {
  background: #fff;
  color: var(--ep-primary);
  border: 2px solid var(--ep-primary);
}

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

.ep-btn-block {
  width: 100%;
  margin-top: 8px;
}

/* Notices */
.ep-notice {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.ep-notice.ep-success {
  background: #ecfdf5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.ep-notice.ep-error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.ep-muted {
  color: var(--ep-muted);
  margin: 4px 0 0;
}

.ep-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8edf8;
  color: var(--ep-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.ep-badge--accent {
  background: #fef3c7;
  color: #92400e;
}

/* Tables */
.ep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ep-table th {
  text-align: left;
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--ep-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--ep-border);
}

.ep-table td {
  padding: 14px;
  border-bottom: 1px solid var(--ep-border);
}

.ep-table tbody tr:hover {
  background: #f8fafc;
}

/* Services */
.ep-services-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ep-service-card {
  margin-bottom: 0;
  border-left: 4px solid var(--ep-accent);
}

.ep-service-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ep-service-head h3 {
  margin: 0;
  color: var(--ep-primary);
  font-family: var(--ep-serif);
  font-size: 1.1rem;
}

.ep-service-meta {
  margin: 12px 0 0;
  color: var(--ep-muted);
  font-size: 0.9rem;
}

.ep-service-meta strong {
  color: var(--ep-primary);
  font-size: 1.05rem;
}

.ep-footer {
  text-align: center;
  color: var(--ep-muted);
  margin-top: 32px;
  font-size: 0.8rem;
}

/* Auth layouts */
.ep-auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 520px;
  border-radius: var(--ep-radius);
  overflow: hidden;
  box-shadow: var(--ep-shadow);
  border: 1px solid var(--ep-border);
}

@media (max-width: 768px) {
  .ep-auth-layout { grid-template-columns: 1fr; }
  .ep-auth-side { min-height: 160px; }
}

.ep-auth-side {
  background: linear-gradient(160deg, var(--ep-primary) 0%, var(--ep-primary-dark) 100%);
  color: #fff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ep-auth-side h2 {
  font-family: var(--ep-serif);
  font-size: 1.75rem;
  margin: 0 0 12px;
  color: #fff;
}

.ep-auth-side p {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin: 0;
}

.ep-auth-side ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.ep-auth-side li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  font-size: 0.9rem;
}

.ep-auth-side li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ep-accent-light);
  font-weight: 700;
}

.ep-auth-form {
  padding: 40px 36px;
  background: var(--ep-surface);
}

.ep-auth-form h3 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--ep-primary);
}

.ep-hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Login form overrides */
.ep-login-wrap .ep-card,
.ep-login-prompt .ep-card {
  max-width: 440px;
  margin: 0 auto;
}

.ep-login-wrap #entrypoint-loginform p {
  margin-bottom: 14px;
}

.ep-login-wrap #entrypoint-loginform label {
  font-weight: 500;
  font-size: 0.875rem;
}

.ep-login-wrap #entrypoint-loginform input[type="text"],
.ep-login-wrap #entrypoint-loginform input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  font-family: inherit;
  margin-top: 4px;
}

.ep-login-wrap #entrypoint-loginform input[type="submit"] {
  background: linear-gradient(135deg, var(--ep-primary), var(--ep-primary-dark));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  width: 100%;
  margin-top: 8px;
}

.ep-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.ep-register-card {
  max-width: none;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.ep-wrap.ep-auth-only {
  background: transparent;
  padding: 0;
  max-width: 900px;
}

.ep-badge--accent { background: #fef3c7; color: #92400e; }
.ep-badge--muted { background: #f1f5f9; color: #64748b; }

.ep-entity-cell { display: inline-flex; align-items: center; gap: 8px; }
.ep-entity-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.ep-entity-logo--sm { width: 28px; height: 28px; font-size: 12px; }
.ep-entity-logo--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ep-primary), var(--ep-accent));
  color: #fff;
  font-weight: 700;
}

.ep-messaging-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: 420px;
}
@media (max-width: 768px) {
  .ep-messaging-layout { grid-template-columns: 1fr; }
}
.ep-conv-list { margin-bottom: 0; }
.ep-conv-items { list-style: none; margin: 12px 0 0; padding: 0; }
.ep-conv-items li { margin-bottom: 4px; }
.ep-conv-items a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ep-text);
  font-size: 0.9rem;
}
.ep-conv-items li.is-active a,
.ep-conv-items a:hover { background: #f1f5f9; }
.ep-chat-panel { display: flex; flex-direction: column; min-height: 400px; margin-bottom: 0; }
.ep-chat-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ep-chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.ep-chat-bubble.is-mine {
  align-self: flex-end;
  background: var(--ep-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ep-chat-bubble.is-theirs {
  align-self: flex-start;
  background: #f1f5f9;
  border-bottom-left-radius: 4px;
}
.ep-chat-bubble small { opacity: 0.8; font-size: 0.75rem; display: block; }
.ep-chat-bubble p { margin: 4px 0; }
.ep-chat-bubble time { font-size: 0.7rem; opacity: 0.7; }
.ep-chat-compose {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--ep-border);
  align-items: flex-end;
}
.ep-chat-compose textarea { flex: 1; resize: vertical; min-height: 44px; padding: 10px; border-radius: 8px; border: 1px solid var(--ep-border); font-family: inherit; }
.ep-chat-empty { padding: 40px 20px; text-align: center; }
.ep-payment-fields { margin: 12px 0; padding: 12px; background: #f8fafc; border-radius: 8px; }
.ep-admin-logo { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; vertical-align: middle; }
