/* Funded Probability Calculator */

.fp-subtitle { color: #888; font-size: 1.05rem; max-width: 640px; margin: 0 auto 32px; line-height: 1.6; }

/* Cards */
.fp-card { background: #fff; border-radius: 14px; padding: 24px 28px; margin-bottom: 20px; border: 1px solid #dee2e6; }
.fp-card-title { color: #1a1a2e; font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.fp-card-title i { color: #6366f1; font-size: 0.95rem; }

/* Grids */
.fp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.fp-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* Fields */
.fp-field { display: flex; flex-direction: column; gap: 6px; }
.fp-label { color: #555; font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.fp-hint { color: #aaa; font-size: 0.75rem; margin-top: 2px; }

/* Select / Input */
.fp-select, .fp-input { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; color: #333; padding: 10px 14px; font-size: 0.9rem; width: 100%; transition: border-color 0.15s; }
.fp-select:focus, .fp-input:focus { border-color: #818cf8; outline: none; }
.fp-select option { background: #fff; color: #333; }

/* Sliders */
.fp-slider-wrap { display: flex; align-items: center; gap: 12px; }
.fp-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: #dee2e6; outline: none; }
.fp-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #818cf8, #6366f1); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.fp-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #818cf8, #6366f1); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.fp-slider-val { color: #6366f1; font-weight: 700; font-size: 1rem; min-width: 50px; text-align: right; }
.fp-rr-prefix { color: #888; font-size: 0.85rem; font-weight: 600; }

/* Presets */
.fp-presets { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.fp-preset { background: #fff; border: 1px solid #dee2e6; color: #555; padding: 4px 12px; border-radius: 6px; font-size: 0.78rem; cursor: pointer; transition: all 0.15s; }
.fp-preset:hover { background: rgba(129,140,248,0.1); border-color: rgba(129,140,248,0.3); color: #6366f1; }

/* Firm Search */
.fp-search-wrap { position: relative; }
.fp-search { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; color: #333; padding: 10px 14px 10px 36px; font-size: 0.9rem; width: 100%; transition: border-color 0.15s; }
.fp-search:focus { border-color: #818cf8; outline: none; }
.fp-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 0.85rem; }
.fp-search-results { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #dee2e6; border-radius: 8px; max-height: 280px; overflow-y: auto; z-index: 100; display: none; margin-top: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.fp-search-item { padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background 0.1s; color: #333; font-size: 0.88rem; }
.fp-search-item:hover { background: #f8f9fa; }
.fp-search-item img { width: 24px; height: 24px; border-radius: 4px; object-fit: contain; background: #f8f9fa; }
.fp-search-item-info { display: flex; flex-direction: column; }
.fp-search-item-name { font-weight: 600; color: #1a1a2e; }
.fp-search-item-sub { font-size: 0.75rem; color: #888; }

/* Selected firm */
.fp-selected-firm { display: none; align-items: center; gap: 12px; background: rgba(122,149,248,0.08); border: 1px solid rgba(122,149,248,0.25); border-radius: 8px; padding: 10px 14px; }
.fp-selected-firm img { width: 28px; height: 28px; border-radius: 4px; object-fit: contain; background: #f8f9fa; }
.fp-selected-firm-name { color: #1a1a2e; font-weight: 600; font-size: 0.95rem; flex: 1; }
.fp-selected-firm-remove { color: #ccc; cursor: pointer; padding: 4px; font-size: 1rem; transition: color 0.15s; }
.fp-selected-firm-remove:hover { color: #ef4444; }

/* Challenge pills */
.fp-challenge-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fp-challenge-pill { background: #fff; border: 1px solid #dee2e6; color: #555; padding: 8px 14px; border-radius: 8px; font-size: 0.82rem; cursor: pointer; transition: all 0.15s; display: flex; flex-direction: column; gap: 2px; }
.fp-challenge-pill:hover { border-color: rgba(129,140,248,0.3); background: rgba(129,140,248,0.05); }
.fp-challenge-pill.active { border-color: #818cf8; background: rgba(129,140,248,0.1); color: #1a1a2e; }
.fp-challenge-pill-size { font-weight: 700; color: #1a1a2e; }
.fp-challenge-pill-price { font-size: 0.75rem; color: #888; }
.fp-challenge-pill.active .fp-challenge-pill-price { color: #6366f1; }

/* Custom params toggle */
.fp-custom-toggle { display: flex; align-items: center; gap: 8px; margin-top: 16px; cursor: pointer; color: #888; font-size: 0.85rem; transition: color 0.15s; }
.fp-custom-toggle:hover { color: #555; }
.fp-custom-toggle i { transition: transform 0.2s; }
.fp-custom-toggle.open i { transform: rotate(90deg); }
.fp-custom-params { display: none; margin-top: 16px; }
.fp-custom-params.open { display: block; }

/* Run Button */
.fp-run-btn { width: 100%; padding: 16px 24px; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border: none; border-radius: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: all 0.2s; margin: 24px 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.fp-run-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(34,197,94,0.25); }
.fp-run-btn:active { transform: translateY(0); }
.fp-run-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Loading */
.fp-loading { display: none; flex-direction: column; align-items: center; gap: 16px; padding: 48px 0; }
.fp-spinner { width: 48px; height: 48px; border: 3px solid #dee2e6; border-top-color: #818cf8; border-radius: 50%; animation: fpSpin 0.8s linear infinite; }
@keyframes fpSpin { to { transform: rotate(360deg); } }
.fp-loading-text { color: #888; font-size: 0.9rem; }

/* Results Container */
.fp-results { display: none; }

/* Probability Gauge */
.fp-gauge-section { display: flex; align-items: center; gap: 32px; margin-bottom: 24px; }
.fp-gauge-wrap { position: relative; width: 180px; height: 180px; flex-shrink: 0; }
.fp-gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fp-gauge-bg { fill: none; stroke: #eee; stroke-width: 8; }
.fp-gauge-fill { fill: none; stroke: url(#fpGaugeGrad); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.fp-gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fp-gauge-pct { font-size: 2.2rem; font-weight: 800; color: #1a1a2e; line-height: 1; }
.fp-gauge-label { color: #888; font-size: 0.8rem; margin-top: 4px; }

/* Gauge right side metrics */
.fp-gauge-metrics { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fp-gm { background: #f8f9fa; border-radius: 10px; padding: 14px 16px; }
.fp-gm-val { font-size: 1.3rem; font-weight: 700; color: #1a1a2e; }
.fp-gm-label { font-size: 0.75rem; color: #888; margin-top: 2px; }

/* Verdict */
.fp-verdict { padding: 16px 20px; border-radius: 10px; margin-bottom: 24px; display: flex; align-items: center; gap: 12px; font-size: 0.95rem; font-weight: 600; }
.fp-verdict-good { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); color: #16a34a; }
.fp-verdict-ok { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.25); color: #b45309; }
.fp-verdict-bad { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #dc2626; }
.fp-verdict i { font-size: 1.2rem; }

/* Charts section */
.fp-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.fp-chart-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #dee2e6; }
.fp-chart-title { color: #555; font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; }
.fp-chart-canvas { width: 100%; height: 220px; }

/* Breakdown bars */
.fp-breakdown { margin-bottom: 24px; }
.fp-breakdown-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.fp-breakdown-label { color: #666; font-size: 0.82rem; width: 120px; flex-shrink: 0; }
.fp-breakdown-bar-wrap { flex: 1; height: 24px; background: #f0f0f0; border-radius: 6px; overflow: hidden; position: relative; }
.fp-breakdown-bar { height: 100%; border-radius: 6px; transition: width 0.8s ease-out; min-width: 2px; }
.fp-breakdown-bar-pass { background: linear-gradient(90deg, #22c55e, #4ade80); }
.fp-breakdown-bar-dd { background: linear-gradient(90deg, #ef4444, #f87171); }
.fp-breakdown-bar-daily { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fp-breakdown-bar-time { background: linear-gradient(90deg, #6366f1, #818cf8); }
.fp-breakdown-pct { color: #333; font-size: 0.82rem; font-weight: 600; min-width: 48px; text-align: right; }

/* What-if Section */
.fp-whatif { margin-bottom: 24px; }
.fp-whatif-title { color: #1a1a2e; font-size: 1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.fp-whatif-title i { color: #6366f1; }
.fp-whatif-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.fp-whatif-item { background: #fff; border-radius: 10px; padding: 14px; text-align: center; cursor: pointer; transition: all 0.2s; border: 1px solid #dee2e6; }
.fp-whatif-item:hover { background: rgba(129,140,248,0.05); border-color: rgba(129,140,248,0.2); }
.fp-whatif-item.fp-wi-current { border-color: rgba(129,140,248,0.3); background: rgba(129,140,248,0.05); }
.fp-whatif-risk { color: #888; font-size: 0.78rem; }
.fp-whatif-pct { font-size: 1.15rem; font-weight: 700; color: #1a1a2e; margin-top: 4px; }
.fp-whatif-delta { font-size: 0.75rem; margin-top: 2px; }
.fp-whatif-up { color: #22c55e; }
.fp-whatif-down { color: #ef4444; }
.fp-whatif-same { color: #ccc; }

/* Challenge info recap */
.fp-challenge-recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.fp-recap-item { background: #f8f9fa; border-radius: 8px; padding: 12px 14px; }
.fp-recap-val { color: #1a1a2e; font-size: 1rem; font-weight: 700; }
.fp-recap-label { color: #888; font-size: 0.75rem; margin-top: 2px; }

/* CTA */
.fp-cta-section { text-align: center; padding: 32px 0; }
.fp-cta-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; border-radius: 10px; font-weight: 700; font-size: 0.95rem; text-decoration: none; transition: all 0.2s; }
.fp-cta-primary { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.fp-cta-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34,197,94,0.25); color: #fff; text-decoration: none; }
.fp-cta-secondary { background: #f8f9fa; color: #555; border: 1px solid #dee2e6; margin-left: 12px; }
.fp-cta-secondary:hover { background: #eee; color: #1a1a2e; text-decoration: none; }

/* Explainer */
.fp-explainer { margin-top: 40px; margin-bottom: 20px; }
.fp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.fp-step { background: #fff; border-radius: 12px; padding: 20px 16px; text-align: center; border: 1px solid #dee2e6; }
.fp-step-num { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #818cf8, #6366f1); color: #fff; font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.fp-step-title { color: #1a1a2e; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.fp-step p { color: #888; font-size: 0.8rem; line-height: 1.5; margin: 0; }

.fp-section-title { color: #1a1a2e; font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }

/* Strategy Recommendations */
.fp-recs { margin-bottom: 24px; }
.fp-rec { display: flex; gap: 12px; padding: 14px 16px; background: #fff; border-radius: 10px; margin-bottom: 8px; border: 1px solid #dee2e6; }
.fp-rec-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.fp-rec-icon-tip { background: rgba(129,140,248,0.12); color: #6366f1; }
.fp-rec-icon-warn { background: rgba(234,179,8,0.12); color: #b45309; }
.fp-rec-icon-good { background: rgba(34,197,94,0.12); color: #22c55e; }
.fp-rec-text { color: #555; font-size: 0.88rem; line-height: 1.5; }
.fp-rec-text strong { color: #1a1a2e; }

/* Responsive */
@media (max-width: 768px) {
    .fp-grid-2 { grid-template-columns: 1fr; }
    .fp-grid-3 { grid-template-columns: 1fr; }
    .fp-grid-4 { grid-template-columns: 1fr 1fr; }
    .fp-gauge-section { flex-direction: column; }
    .fp-gauge-wrap { width: 140px; height: 140px; }
    .fp-charts-grid { grid-template-columns: 1fr; }
    .fp-whatif-grid { grid-template-columns: repeat(3, 1fr); }
    .fp-steps { grid-template-columns: 1fr 1fr; }
    .fp-challenge-recap { grid-template-columns: 1fr 1fr; }
    .fp-card { padding: 18px 16px; }
}

@media (max-width: 480px) {
    .fp-gauge-wrap { width: 120px; height: 120px; }
    .fp-gauge-pct { font-size: 1.6rem; }
    .fp-gauge-metrics { grid-template-columns: 1fr; }
    .fp-whatif-grid { grid-template-columns: 1fr 1fr; }
    .fp-steps { grid-template-columns: 1fr; }
    .fp-cta-btn { display: flex; justify-content: center; }
    .fp-cta-secondary { margin-left: 0; margin-top: 10px; }
    .fp-breakdown-label { width: 80px; font-size: 0.75rem; }
}
