/**
 * CTA Cards CSS — 24help.org CTA AI Engine
 * Design System: "Institutional Warmth"
 * 
 * Colors: Navy (#1B2A4A), Gold (#D4A843), Cream (#FAF8F5), Forest Green (#276749)
 * Font: Source Sans 3 / Source Serif 4 (matching navigator template)
 * Mobile-first, inline cards (not pop-ups)
 */

/* ═══════════════════════════════════════════
   BASE CARD STYLES
   ═══════════════════════════════════════════ */

.cta-engine-card {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(27, 42, 74, 0.08);
  padding: 0;
  margin: 24px 0;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  max-width: 680px;
  width: 100%;
  opacity: 0;
  transform: translateY(12px);
  animation: ctaFadeSlideIn 0.5s ease forwards;
  line-height: 1.6;
  color: #2D2D2D;
  box-sizing: border-box;
}

.cta-engine-card *,
.cta-engine-card *::before,
.cta-engine-card *::after {
  box-sizing: border-box;
}

.cta-engine-card:hover {
  box-shadow: 0 4px 20px rgba(27, 42, 74, 0.14);
}

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

/* ═══════════════════════════════════════════
   CARD ACCENT STRIPE (top border)
   ═══════════════════════════════════════════ */

.cta-engine-card[data-cta-type="email_capture"] {
  border-top: 4px solid #D4A843;
}

.cta-engine-card[data-cta-type="sms_optin"] {
  border-top: 4px solid #2471A3;
}

.cta-engine-card[data-cta-type="expert_appointment"] {
  border-top: 4px solid #1B2A4A;
}

.cta-engine-card[data-cta-type="tip_jar"] {
  border-top: 4px solid #D4A843;
}

.cta-engine-card[data-cta-type="chapter_medicare"] {
  border-top: 4px solid #276749;
}

.cta-engine-card[data-cta-type="youtube_subscribe"] {
  border-top: 4px solid #C0392B;
}

.cta-engine-card[data-cta-type="facebook_follow"] {
  border-top: 4px solid #2471A3;
}

.cta-engine-card[data-cta-type="share_guide"] {
  border-top: 4px solid #D4A843;
}

.cta-engine-card[data-cta-type="hero_benefits"] {
  border-top: 4px solid #276749;
}

.cta-engine-card[data-cta-type="community_referral"] {
  border-top: 4px solid #1B2A4A;
}

.cta-engine-card[data-cta-type="policy_alerts"] {
  border-top: 4px solid #D4940A;
}

/* ═══════════════════════════════════════════
   CARD INNER LAYOUT
   ═══════════════════════════════════════════ */

.cta-card-inner {
  padding: 24px 24px 20px;
}

.cta-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.cta-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: #FAF8F5;
}

.cta-card-icon.gold-bg { background: rgba(212, 168, 67, 0.12); }
.cta-card-icon.navy-bg { background: rgba(27, 42, 74, 0.08); }
.cta-card-icon.green-bg { background: rgba(39, 103, 73, 0.1); }
.cta-card-icon.blue-bg { background: rgba(36, 113, 163, 0.1); }
.cta-card-icon.red-bg { background: rgba(192, 57, 43, 0.1); }

.cta-card-headline {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
  color: #1B2A4A;
  line-height: 1.3;
  margin: 0;
  flex: 1;
  padding-top: 4px;
}

.cta-card-body {
  font-size: 15px;
  color: #5A5A5A;
  line-height: 1.65;
  margin-bottom: 18px;
}

/* ═══════════════════════════════════════════
   EMAIL / SMS INPUT FORMS
   ═══════════════════════════════════════════ */

.cta-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.cta-input-group input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0dcd6;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: #2D2D2D;
  background: #FAF8F5;
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
  min-width: 0;
}

.cta-input-group input:focus {
  border-color: #D4A843;
  background: #FFFFFF;
}

.cta-input-group input::placeholder {
  color: #8A8A8A;
}

/* ═══════════════════════════════════════════
   CTA BUTTONS
   ═══════════════════════════════════════════ */

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

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

/* Primary — Navy */
.cta-btn-primary {
  background: #1B2A4A;
  color: #FFFFFF;
}
.cta-btn-primary:hover {
  background: #2C3E6B;
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.25);
}

/* Gold */
.cta-btn-gold {
  background: #D4A843;
  color: #1B2A4A;
}
.cta-btn-gold:hover {
  background: #E8C96A;
  box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3);
}

/* Green */
.cta-btn-green {
  background: #276749;
  color: #FFFFFF;
}
.cta-btn-green:hover {
  background: #2D7A56;
  box-shadow: 0 2px 8px rgba(39, 103, 73, 0.25);
}

/* Outline */
.cta-btn-outline {
  background: transparent;
  color: #1B2A4A;
  border: 2px solid #1B2A4A;
  padding: 11px 22px;
}
.cta-btn-outline:hover {
  background: rgba(27, 42, 74, 0.05);
}

/* Red (YouTube) */
.cta-btn-red {
  background: #C0392B;
  color: #FFFFFF;
}
.cta-btn-red:hover {
  background: #D44637;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.25);
}

/* Blue (Facebook) */
.cta-btn-blue {
  background: #2471A3;
  color: #FFFFFF;
}
.cta-btn-blue:hover {
  background: #2E86C1;
  box-shadow: 0 2px 8px rgba(36, 113, 163, 0.25);
}

/* Full-width button inside input group */
.cta-input-group .cta-btn {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   MICROCOPY (small text below CTA)
   ═══════════════════════════════════════════ */

.cta-microcopy {
  font-size: 13px;
  color: #8A8A8A;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cta-microcopy svg {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   PRICING TIERS (Expert Appointment)
   ═══════════════════════════════════════════ */

.cta-tiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.cta-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #FAF8F5;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cta-tier:hover {
  border-color: #D4A843;
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.08);
}

.cta-tier-info {
  display: flex;
  flex-direction: column;
}

.cta-tier-label {
  font-weight: 600;
  color: #1B2A4A;
  font-size: 15px;
}

.cta-tier-desc {
  font-size: 13px;
  color: #5A5A5A;
  margin-top: 2px;
}

.cta-tier-price {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: #1B2A4A;
  white-space: nowrap;
  margin-left: 16px;
}

/* ═══════════════════════════════════════════
   TIP AMOUNTS (Buy Me a Coffee)
   ═══════════════════════════════════════════ */

.cta-tip-amounts {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.cta-tip-btn {
  flex: 1;
  padding: 12px 8px;
  background: #FAF8F5;
  border: 2px solid #e0dcd6;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Source Sans 3', sans-serif;
}

.cta-tip-btn:hover {
  border-color: #D4A843;
  background: #FFFFFF;
}

.cta-tip-btn.selected {
  border-color: #D4A843;
  background: rgba(212, 168, 67, 0.1);
}

.cta-tip-amount {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #1B2A4A;
  display: block;
}

.cta-tip-label {
  font-size: 12px;
  color: #8A8A8A;
  display: block;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   SHARE BUTTONS
   ═══════════════════════════════════════════ */

.cta-share-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.cta-share-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  color: #FFFFFF;
}

.cta-share-btn.sms { background: #276749; }
.cta-share-btn.sms:hover { background: #2D7A56; }

.cta-share-btn.email { background: #1B2A4A; }
.cta-share-btn.email:hover { background: #2C3E6B; }

.cta-share-btn.facebook { background: #1877F2; }
.cta-share-btn.facebook:hover { background: #166FE5; }

.cta-share-btn.copy-link {
  background: #FAF8F5;
  color: #1B2A4A;
  border: 2px solid #e0dcd6;
}
.cta-share-btn.copy-link:hover {
  border-color: #D4A843;
  background: #FFFFFF;
}

/* ═══════════════════════════════════════════
   DISMISS / CLOSE
   ═══════════════════════════════════════════ */

.cta-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: #8A8A8A;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.cta-dismiss:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #5A5A5A;
}

.cta-card-inner {
  position: relative;
}

/* ═══════════════════════════════════════════
   SUCCESS STATE
   ═══════════════════════════════════════════ */

.cta-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(39, 103, 73, 0.08);
  border-radius: 8px;
  margin-top: 12px;
}

.cta-success-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #276749;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.cta-success-text {
  font-size: 15px;
  color: #276749;
  font-weight: 500;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════
   INSIDER BADGE (authority marker)
   ═══════════════════════════════════════════ */

.cta-insider-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #D4A843;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}

.cta-insider-badge svg {
  width: 13px;
  height: 13px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile-first adjustments
   ═══════════════════════════════════════════ */

@media (max-width: 480px) {
  .cta-card-inner {
    padding: 20px 18px 16px;
  }

  .cta-card-header {
    gap: 10px;
  }

  .cta-card-icon {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .cta-input-group {
    flex-direction: column;
  }

  .cta-input-group .cta-btn {
    width: 100%;
  }

  .cta-tiers {
    gap: 8px;
  }

  .cta-tier {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
  }

  .cta-tier-price {
    margin-left: 0;
    font-size: 18px;
  }

  .cta-share-row {
    flex-wrap: wrap;
  }

  .cta-share-btn {
    flex: 1 1 45%;
    min-width: 0;
  }

  .cta-tip-amounts {
    gap: 8px;
  }

  .cta-tip-btn {
    padding: 10px 6px;
  }

  .cta-tip-amount {
    font-size: 19px;
  }
}

/* ═══════════════════════════════════════════
   EXIT ANIMATION
   ═══════════════════════════════════════════ */

.cta-engine-card.cta-dismissed {
  animation: ctaFadeSlideOut 0.3s ease forwards;
}

@keyframes ctaFadeSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
}

/* ═══ MOBILE TOUCH TARGET FIXES ═══ */
@media (max-width: 768px) {
  .cta-dismiss {
    width: 44px !important;
    height: 44px !important;
    font-size: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
