/* ── Professional Summary Modal ─────────────────────────────────────────────── */

.ps-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 50, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ps-overlay.open { display: flex; }

.ps-modal {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.ps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  flex-shrink: 0;
}

.ps-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #6B7A8D;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.ps-close:hover { background: #f0f0f0; color: #1C2B3A; }

.ps-step-label {
  font-size: 13px;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.3px;
}

/* ── Body ── */
.ps-body {
  padding: 24px 24px 0;
  flex: 1;
}

/* ── Step title ── */
.ps-question {
  font-size: 22px;
  font-weight: 800;
  color: #1C2B3A;
  line-height: 1.3;
  margin-bottom: 6px;
}

.ps-sub {
  font-size: 13px;
  color: #6B7A8D;
  margin-bottom: 20px;
}

/* ── Single-select option cards (Steps 1 & 5) ── */
.ps-option-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.ps-option-card {
  padding: 14px 18px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #1C2B3A;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ps-option-card:hover { border-color: #0FBDA1; background: #f5fffe; }
.ps-option-card.selected {
  border-color: #0FBDA1;
  background: #0FBDA1;
  color: #fff;
  font-weight: 700;
}

.ps-card-check { display: none; flex-shrink: 0; }
.ps-option-card.selected .ps-card-check { display: block; }

/* Cards with description line (Step 5) */
.ps-card-inner { display: flex; flex-direction: column; gap: 3px; }
.ps-card-desc {
  font-size: 12px;
  font-weight: 400;
  color: #6B7A8D;
}
.ps-option-card.selected .ps-card-desc { color: rgba(255, 255, 255, 0.78); }

/* ── Multi-select chips (Steps 2, 3, 4) ── */
.ps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.ps-chip {
  padding: 10px 18px;
  border: 1.5px solid #E2E8F0;
  border-radius: 100px;
  cursor: pointer;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1C2B3A;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.ps-chip:hover { border-color: #0FBDA1; }
.ps-chip.selected {
  border-color: #0FBDA1;
  background: #0FBDA1;
  color: #fff;
  font-weight: 600;
}
.ps-chip.ps-chip-at-max:not(.selected) {
  opacity: 0.38;
  pointer-events: none;
}

/* ── Max reached warning ── */
.ps-max-warning {
  display: none;
  align-items: center;
  gap: 8px;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #C2410C;
  margin-bottom: 14px;
}
.ps-max-warning.visible { display: flex; }

/* ── Other free-text textarea ── */
.ps-other-wrap {
  margin-bottom: 8px;
  display: none;
}
.ps-other-wrap.visible { display: block; }

.ps-other-input {
  width: 100%;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  color: #1C2B3A;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  box-sizing: border-box;
  resize: none;
  transition: border-color 0.15s;
  height: 64px;
}
.ps-other-input:focus { border-color: #0FBDA1; }
.ps-other-input::placeholder { color: #94A3B8; }

.ps-char-count {
  text-align: right;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
}

/* ── Footer ── */
.ps-footer {
  padding: 20px 24px 24px;
  flex-shrink: 0;
}

.ps-btn-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: #0FBDA1;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: 'Figtree', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-bottom: 12px;
}
.ps-btn-next:disabled { opacity: 0.3; cursor: not-allowed; }
.ps-btn-next:not(:disabled):hover { opacity: 0.88; }

.ps-btn-skip {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #94A3B8;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  transition: color 0.15s;
}
.ps-btn-skip:hover { color: #6B7A8D; }

/* ── Loading screen ── */
.ps-loading-wrap {
  padding: 48px 32px 52px;
  text-align: center;
  flex: 1;
}

/* Orbit animation */
.ps-orbit-scene {
  width: 110px;
  height: 110px;
  margin: 0 auto 36px;
  position: relative;
}

.ps-orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at 38% 38%, #4DE8D0, #0FBDA1);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(15, 189, 161, 0.55), 0 0 40px rgba(15, 189, 161, 0.2);
  animation: ps-core-pulse 1.8s ease-in-out infinite;
}

.ps-orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ps-orbit-ring-1 {
  width: 66px;
  height: 66px;
  margin-top: -33px;
  margin-left: -33px;
  border-top-color: #0FBDA1;
  border-right-color: rgba(15, 189, 161, 0.25);
  animation: ps-ring-spin 1.5s linear infinite;
}

.ps-orbit-ring-2 {
  width: 98px;
  height: 98px;
  margin-top: -49px;
  margin-left: -49px;
  border-top-color: rgba(15, 189, 161, 0.45);
  border-left-color: rgba(15, 189, 161, 0.18);
  animation: ps-ring-spin 2.2s linear infinite reverse;
}

.ps-orbit-dot {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: #0FBDA1;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(15, 189, 161, 0.7);
}

.ps-orbit-dot-2 {
  background: #4DE8D0;
  width: 6px;
  height: 6px;
  top: auto;
  bottom: -3px;
  box-shadow: none;
}

@keyframes ps-ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes ps-core-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(15, 189, 161, 0.55), 0 0 40px rgba(15, 189, 161, 0.2);
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    box-shadow: 0 0 32px rgba(15, 189, 161, 0.8), 0 0 60px rgba(15, 189, 161, 0.3);
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.ps-loading-items {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  display: inline-block;
}

.ps-loading-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #1C2B3A;
  padding: 7px 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.ps-loading-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.ps-check-circle {
  width: 24px;
  height: 24px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.ps-generating-text {
  font-size: 13px;
  color: #94A3B8;
  font-style: italic;
  margin-top: 4px;
}

/* ── Result screen ── */
.ps-result-wrap {
  padding: 20px 24px 0;
  flex: 1;
}
.ps-result-header-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 14px;
}
.ps-result-title {
  font-size: 20px;
  font-weight: 800;
  color: #1C2B3A;
  margin-bottom: 16px;
}
.ps-result-textarea {
  width: 100%;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  color: #1C2B3A;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  resize: none;
  line-height: 1.65;
  min-height: 130px;
  box-sizing: border-box;
  background: #FAFBFC;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
}
.ps-result-textarea:not([readonly]) {
  background: #fff;
  border-color: #0FBDA1;
}
.ps-result-textarea[readonly] { cursor: default; }

.ps-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.ps-btn-looks-good {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ps-btn-looks-good:hover { opacity: 0.88; }

.ps-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: #fff;
  color: #1C2B3A;
  border: 1.5px solid #D1D9E0;
  border-radius: 100px;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ps-btn-outline:hover { border-color: #1C2B3A; }
.ps-btn-outline:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.ps-version-label {
  text-align: center;
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 16px;
}

.ps-grounded-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #92400E;
  margin-bottom: 4px;
}

/* ── Success screen ── */
.ps-success-wrap {
  padding: 24px;
  flex: 1;
}

.ps-success-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #DCFCE7;
  border: 1px solid #BBF7D0;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.ps-success-icon {
  width: 40px;
  height: 40px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  margin-top: 1px;
}

.ps-success-text-block {}
.ps-success-title {
  font-size: 15px;
  font-weight: 800;
  color: #15803D;
  margin-bottom: 3px;
}
.ps-success-sub {
  font-size: 13px;
  color: #166534;
}

.ps-visitors-heading {
  font-size: 15px;
  font-weight: 700;
  color: #1C2B3A;
  margin-bottom: 14px;
}

.ps-preview-card {
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  background: #FAFBFC;
}
.ps-preview-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1C2B3A;
  margin-bottom: 10px;
}
.ps-preview-text {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 10px;
}
.ps-preview-more {
  color: #0FBDA1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ps-ai-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94A3B8;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ps-ai-badge-sep {
  width: 3px;
  height: 3px;
  background: #D1D9E0;
  border-radius: 50%;
}

.ps-btn-done {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px;
  background: #0FBDA1;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}
.ps-btn-done:hover { opacity: 0.88; }

/* ── Profile page — populated summary ── */
.summary-text.ps-has-summary {
  color: #374151;
  font-size: 15px;
  line-height: 1.7;
}

.ps-ai-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #94A3B8;
  margin-top: 8px;
}

/* ── Responsive ── */
@media (max-width: 500px) {
  .ps-overlay { align-items: flex-end; padding: 0; }
  .ps-modal {
    border-radius: 24px 24px 0 0;
    max-height: 95vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .ps-question { font-size: 19px; }
  .ps-loading-wrap { padding: 36px 24px 40px; }
}
