/* ==========================================================================
   PROPTRAIL GLOBAL — 4-ROLE SAAS PORTAL PROTOTYPE (portal.css)
   ========================================================================== */

#portalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 11, 36, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

#portalOverlay.show {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.portal-window {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: min(1080px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 2.25rem;
  box-shadow: var(--shadow-elevated);
  position: relative;
}

.portal-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-light);
  gap: 1.5rem;
}

.portal-title-block h2 {
  font-size: 1.5rem;
  font-weight: 850;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.portal-title-block p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.375rem 0.875rem;
  background: var(--brand-accent-soft);
  border: 1px solid var(--border-brand-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.portal-proto-notice {
  background: var(--status-blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  color: var(--status-blue-text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Role Selector Screen */
.role-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.role-card-btn {
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  text-align: left;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.role-card-btn:hover {
  background: #ffffff;
  border-color: var(--border-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.role-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-accent-soft);
  display: grid;
  place-items: center;
  color: var(--brand-primary);
}

.role-name {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text-main);
}

.role-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Login Form Screen */
.portal-form-wrap {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.demo-creds-box {
  background: var(--brand-accent-soft);
  border: 1px solid var(--border-brand-subtle);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  margin: 1.25rem 0;
  font-size: 0.75rem;
  color: var(--brand-primary);
}

.demo-fill-btn {
  font-size: 0.6875rem;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}

/* Dashboard UI Components */
.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-box {
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
}

.metric-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.metric-box-val {
  font-size: 1.75rem;
  font-weight: 850;
  color: var(--brand-primary);
}

.dash-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dash-card-panel {
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.dash-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.pipeline-step {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.5rem;
  text-align: center;
}

.pipeline-step-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.pipeline-step-name {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.list-item-row:last-child {
  border-bottom: none;
}

.status-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--status-emerald-bg);
  color: var(--status-emerald-text);
}

/* Portal Responsive Breakpoints */
@media (max-width: 1024px) {
  .role-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-sections-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .role-cards-grid {
    grid-template-columns: 1fr;
  }
  .pipeline-track {
    grid-template-columns: repeat(2, 1fr);
  }
  .portal-window {
    padding: 1.25rem;
  }
}
