/**
 * pivot-widget.css — Pivot Flow UI Styles
 * 
 * 24Help.org Design System:
 * - Navy: #0B3D91 | Gold: #F5A623 | Cream: #FDF8F0 | Text: #3A3A3A
 * - Fonts: Source Serif 4 (headings) / Source Sans 3 (body)
 * - Min body text: 20px | Touch targets: 48px+
 * - WRITTEN IN STONE: Senior-friendly, large text, clear navigation
 */

/* =========================================================================
   BUBBLE SELECTOR — Single & Multi-Select
   ========================================================================= */

.pf-bubble-wrapper {
  padding: 8px 0 16px 0;
  max-width: 100%;
}

.pf-bubble-question {
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 18px;
  color: #3A3A3A;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.pf-bubble-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pf-bubble-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;     /* WRITTEN IN STONE: 48px+ touch targets */
  padding: 10px 20px;
  border: 2px solid #e8e0d4;
  border-radius: 24px;
  background: #ffffff;
  color: #3A3A3A;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pf-bubble-btn:hover:not(:disabled) {
  border-color: #0B3D91;
  background: #f0f4fa;
}

.pf-bubble-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.pf-bubble-btn.pf-selected {
  border-color: #0B3D91;
  background: #0B3D91;
  color: #ffffff;
}

.pf-bubble-btn.pf-disabled {
  opacity: 0.45;
  cursor: default;
}

.pf-bubble-icon {
  font-size: 20px;
  line-height: 1;
}

.pf-bubble-label {
  line-height: 1.3;
}

/* Confirm button for multi-select */
.pf-confirm-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: #F5A623;
  color: #ffffff;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}

.pf-confirm-btn:hover:not(:disabled) {
  background: #FFB940;
}

.pf-confirm-btn.pf-disabled {
  opacity: 0.5;
  cursor: default;
}

/* "Other" text input row */
.pf-other-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.pf-other-input {
  flex: 1;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid #e8e0d4;
  border-radius: 12px;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 17px;
  color: #3A3A3A;
  background: #ffffff;
  outline: none;
  transition: border-color 200ms ease;
}

.pf-other-input:focus {
  border-color: #0B3D91;
}

.pf-other-submit {
  min-height: 48px;
  min-width: 64px;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #0B3D91;
  color: #ffffff;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}

.pf-other-submit:hover {
  background: #072B6A;
}

/* =========================================================================
   EMAIL CAPTURE
   ========================================================================= */

.pf-email-wrapper {
  padding: 8px 0 16px 0;
  max-width: 100%;
}

.pf-email-input-row {
  margin-bottom: 12px;
}

.pf-email-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid #e8e0d4;
  border-radius: 12px;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 18px;
  color: #3A3A3A;
  background: #ffffff;
  outline: none;
  transition: border-color 200ms ease;
  box-sizing: border-box;
}

.pf-email-input:focus {
  border-color: #0B3D91;
}

.pf-email-input.pf-input-error {
  border-color: #d73a49;
  animation: pf-shake 300ms ease;
}

@keyframes pf-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.pf-email-submit {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: #0B3D91;
  color: #ffffff;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}

.pf-email-submit:hover:not(:disabled) {
  background: #072B6A;
}

.pf-email-submit.pf-disabled {
  opacity: 0.5;
  cursor: default;
}

.pf-skip-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 15px;
  color: #999;
  text-decoration: none;
  cursor: pointer;
}

.pf-skip-link:hover {
  color: #666;
  text-decoration: underline;
}

/* =========================================================================
   STATE SELECT
   ========================================================================= */

.pf-state-wrapper {
  padding: 8px 0 16px 0;
}

.pf-state-select {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid #e8e0d4;
  border-radius: 12px;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 18px;
  color: #3A3A3A;
  background: #ffffff;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233A3A3A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.pf-state-select:focus {
  border-color: #0B3D91;
}

.pf-state-select:disabled {
  opacity: 0.6;
  cursor: default;
}

/* =========================================================================
   PROGRAM RESULT CARDS
   ========================================================================= */

.pf-results-wrapper {
  padding: 8px 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pf-program-card {
  background: #ffffff;
  border: 2px solid #e8e0d4;
  border-radius: 16px;
  padding: 20px;
  transition: border-color 200ms ease;
}

.pf-program-card:hover {
  border-color: #0B3D91;
}

.pf-program-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.pf-program-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: #0B3D91;
  margin: 0;
  line-height: 1.3;
}

.pf-program-value {
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #F5A623;
  white-space: nowrap;
  background: #FDF8F0;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #F5A623;
}

.pf-program-desc {
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 17px;
  color: #3A3A3A;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.pf-program-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pf-action-btn {
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  border: 2px solid transparent;
}

/* "Get It" — Primary action (Apply First) */
.pf-action-apply_first {
  background: #0B3D91;
  color: #ffffff;
  border-color: #0B3D91;
}

.pf-action-apply_first:hover {
  background: #072B6A;
}

/* "Learn More" — Secondary */
.pf-action-guide_link {
  background: #ffffff;
  color: #0B3D91;
  border-color: #0B3D91;
}

.pf-action-guide_link:hover {
  background: #f0f4fa;
}

/* "Keep It" — Protection flow */
.pf-action-protection_flow {
  background: #ffffff;
  color: #F5A623;
  border-color: #F5A623;
}

.pf-action-protection_flow:hover {
  background: #FDF8F0;
}

.pf-action-btn.pf-action-selected {
  opacity: 0.7;
  transform: scale(0.97);
}

/* Chapter Medicare CTA — Special card-within-card */
.pf-chapter-cta {
  margin-top: 16px;
  padding: 16px;
  background: #FDF8F0;
  border: 2px solid #F5A623;
  border-radius: 12px;
  text-align: center;
}

.pf-chapter-msg {
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 16px;
  color: #3A3A3A;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.pf-chapter-phone {
  display: inline-block;
  min-height: 48px;
  line-height: 48px;
  padding: 0 24px;
  background: #F5A623;
  color: #ffffff;
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  transition: background 200ms ease;
}

.pf-chapter-phone:hover {
  background: #FFB940;
}

/* =========================================================================
   PROGRESS BAR
   ========================================================================= */

.pf-progress-wrapper {
  margin-bottom: 12px;
}

.pf-progress-label {
  font-family: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  font-size: 14px;
  color: #999;
  margin-bottom: 6px;
}

.pf-progress-bar {
  width: 100%;
  height: 6px;
  background: #e8e0d4;
  border-radius: 3px;
  overflow: hidden;
}

.pf-progress-fill {
  height: 100%;
  background: #0B3D91;
  border-radius: 3px;
  transition: width 400ms ease;
}

/* =========================================================================
   RESPONSIVE — Mobile-first (chat widget is already narrow)
   ========================================================================= */

@media (max-width: 480px) {
  .pf-bubble-btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    font-size: 16px;
  }

  .pf-program-header {
    flex-direction: column;
  }

  .pf-program-value {
    align-self: flex-start;
  }

  .pf-program-actions {
    flex-direction: column;
  }

  .pf-action-btn {
    width: 100%;
    text-align: center;
  }
}
