/* ============================================================
   AlgoFruit Trading DNA Consultation
   Self-contained styles (afc- prefix) so the experience can be
   embedded on any page (index.html, templates.html, ...).
   Mobile-first, one question per screen, conversational feel.
   ============================================================ */

.afc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(8, 26, 19, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.afc-overlay.open {
  display: flex;
}

.afc-modal {
  width: 100%;
  max-width: 680px;
  max-height: 94vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: afcPop 0.28s ease;
}

@keyframes afcPop {
  from {
    transform: translateY(18px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

/* ---------- Header: the "consultant" identity ---------- */
.afc-head {
  background:
    radial-gradient(420px 160px at 90% -20%, rgba(0, 200, 83, 0.35), transparent 60%),
    linear-gradient(135deg, #0c2b20 0%, #1f4037 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.afc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.afc-head-txt b {
  display: block;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1.02rem;
  line-height: 1.25;
}

.afc-head-txt small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
}

.afc-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.afc-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Progress ---------- */
.afc-progress {
  height: 5px;
  background: #e4ede8;
  flex-shrink: 0;
}

.afc-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00c853, #009624);
  transition: width 0.35s ease;
}

/* ---------- Body ---------- */
.afc-body {
  padding: 22px 22px 26px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.afc-step {
  animation: afcSlide 0.3s ease;
}

@keyframes afcSlide {
  from {
    opacity: 0;
    transform: translateX(26px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.afc-step.afc-back-anim {
  animation: afcSlideBack 0.3s ease;
}

@keyframes afcSlideBack {
  from {
    opacity: 0;
    transform: translateX(-26px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .afc-modal,
  .afc-step,
  .afc-step.afc-back-anim {
    animation: none;
  }
}

/* ---------- Consultant speech bubble ---------- */
.afc-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.afc-msg .afc-avatar {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 150, 36, 0.25);
}

.afc-bubble {
  background: #f2f8f4;
  border: 1px solid #e4ede8;
  border-radius: 4px 16px 16px 16px;
  padding: 13px 16px;
  flex: 1;
}

.afc-bubble h3 {
  margin: 0;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1.08rem;
  line-height: 1.35;
  color: #0f1b16;
}

.afc-bubble p {
  margin: 5px 0 0;
  color: #64766d;
  font-size: 0.86rem;
  line-height: 1.45;
}

/* ---------- Options ---------- */
.afc-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.afc-opts.afc-1col {
  grid-template-columns: 1fr;
}

@media (max-width: 560px) {
  .afc-opts {
    grid-template-columns: 1fr;
  }
}

.afc-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff;
  border: 2px solid #e4ede8;
  border-radius: 12px;
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.94rem;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s, background 0.15s;
  position: relative;
}

.afc-opt:hover {
  border-color: #00c853;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 40, 30, 0.08);
}

.afc-opt:active {
  transform: translateY(0);
}

.afc-opt .ic {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.afc-opt b {
  display: block;
  color: #0f1b16;
  font-weight: 600;
  line-height: 1.3;
}

.afc-opt small {
  color: #64766d;
  display: block;
  line-height: 1.3;
  margin-top: 1px;
}

.afc-opt.sel {
  border-color: #00c853;
  background: #f0fbf4;
}

.afc-opt.sel::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  color: #009624;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---------- Free-text ---------- */
.afc-textarea {
  width: 100%;
  min-height: 96px;
  border: 2px solid #e4ede8;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #29352f;
  resize: vertical;
  box-sizing: border-box;
}

.afc-textarea:focus {
  outline: none;
  border-color: #00c853;
}

/* ---------- Actions row ---------- */
.afc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.afc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.afc-btn:active {
  transform: translateY(1px);
}

.afc-btn-primary {
  background: linear-gradient(135deg, #00c853, #009624);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 150, 36, 0.28);
}

.afc-btn-primary:hover {
  transform: translateY(-2px);
}

.afc-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.afc-btn-ghost {
  background: #fff;
  border: 1px solid #e4ede8;
  color: #1f4037;
}

.afc-btn-ghost:hover {
  border-color: #00c853;
  color: #009624;
}

.afc-back {
  background: none;
  border: none;
  color: #64766d;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  padding: 8px 4px;
}

.afc-back:hover {
  color: #009624;
}

/* ============================================================
   Report (Trading DNA)
   ============================================================ */
.afc-report-head {
  text-align: center;
  margin-bottom: 20px;
}

.afc-report-head .emoji {
  font-size: 3rem;
  line-height: 1.2;
}

.afc-report-head h3 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1.45rem;
  margin: 6px 0 2px;
  color: #0f1b16;
}

.afc-report-head .tag {
  color: #64766d;
  font-size: 0.9rem;
  margin: 0;
}

.afc-score {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  background: #f2f8f4;
  border: 1px solid #e4ede8;
  border-radius: 999px;
  padding: 6px 16px 6px 6px;
}

.afc-score-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: #0f1b16;
  background: conic-gradient(#00c853 var(--pct, 80%), #e4ede8 0);
  position: relative;
}

.afc-score-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #f2f8f4;
}

.afc-score-ring span {
  position: relative;
}

.afc-score small {
  color: #64766d;
  font-size: 0.78rem;
  text-align: left;
  line-height: 1.3;
}

.afc-sec {
  margin-top: 22px;
}

.afc-sec>h4 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 0.98rem;
  color: #0f1b16;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.afc-sec>h4 .h-ic {
  color: #009624;
}

.afc-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 560px) {
  .afc-profile-grid {
    grid-template-columns: 1fr;
  }
}

.afc-profile-item {
  background: #f7faf8;
  border: 1px solid #e4ede8;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.88rem;
}

.afc-profile-item small {
  display: block;
  color: #64766d;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.afc-profile-item b {
  color: #0f1b16;
  font-weight: 600;
}

.afc-obs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.afc-obs li {
  display: flex;
  gap: 9px;
  font-size: 0.9rem;
  color: #29352f;
  padding: 5px 0;
  line-height: 1.45;
}

.afc-obs li::before {
  content: '·';
  color: #00c853;
  font-weight: 900;
}

/* Tiered template matches */
.afc-tier {
  border: 1px solid #e4ede8;
  border-radius: 14px;
  padding: 15px 16px;
  margin-bottom: 12px;
  background: #fff;
}

.afc-tier.top {
  border-color: rgba(0, 200, 83, 0.55);
  box-shadow: 0 8px 22px rgba(0, 150, 36, 0.10);
}

.afc-tier-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 8px;
  background: #eef4f0;
  color: #1f4037;
}

.afc-tier.top .afc-tier-badge {
  background: linear-gradient(135deg, #00c853, #009624);
  color: #fff;
}

.afc-tier h5 {
  margin: 0 0 6px;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 1.05rem;
  color: #0f1b16;
}

.afc-tier-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.afc-pill {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eef4f0;
  color: #1f4037;
}

.afc-pill.risk {
  color: #fff;
}

.afc-why {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.afc-why li {
  display: flex;
  gap: 8px;
  font-size: 0.86rem;
  color: #29352f;
  padding: 3px 0;
  line-height: 1.45;
}

.afc-why li::before {
  content: '✔';
  color: #009624;
  font-size: 0.78rem;
  margin-top: 1px;
}

.afc-tier-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.afc-btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Insights */
.afc-insight {
  background: linear-gradient(135deg, #f0fbf4, #eaf7ff);
  border: 1px solid #d6ecdc;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.89rem;
  color: #29352f;
  line-height: 1.5;
  margin-bottom: 9px;
  display: flex;
  gap: 10px;
}

.afc-insight .i-ic {
  flex-shrink: 0;
}

/* Roadmap */
.afc-roadmap {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rd;
}

.afc-roadmap li {
  counter-increment: rd;
  display: flex;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.9rem;
  color: #29352f;
  line-height: 1.45;
}

.afc-roadmap li::before {
  content: counter(rd);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c853, #009624);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Share + downloads */
.afc-share {
  border-top: 1px solid #e4ede8;
  margin-top: 22px;
  padding-top: 20px;
  text-align: center;
}

.afc-share img {
  max-width: 250px;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 40, 30, 0.18);
  margin: 12px auto;
  display: block;
}

.afc-share-actions {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
}

.afc-note {
  font-size: 0.76rem;
  color: #64766d;
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

.afc-empty {
  border: 1px dashed #cdddd3;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: #64766d;
  font-size: 0.9rem;
}

/* Entry banner used on templates.html */
.afc-banner {
  background:
    radial-gradient(420px 160px at 92% -30%, rgba(0, 200, 83, 0.4), transparent 60%),
    linear-gradient(135deg, #0c2b20, #1f4037);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.afc-banner-txt {
  color: #fff;
}

.afc-banner-txt b {
  display: block;
  font-size: 1.05rem;
}

.afc-banner-txt span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
}
