/* ==========================================
   FINANCIAL PROJECTION MAKER – Styles
   ========================================== */

.fp-body {
  overflow-x: hidden;
  background: #0A0A0F;
}

.fp-heading {
  grid-template-columns: minmax(0, 820px) auto;
}

.fp-workspace {
  grid-template-columns: minmax(320px, 0.9fr) minmax(560px, 1.34fr);
}

.fp-form {
  position: sticky;
  top: 84px;
}

/* -- Workflow card -- */
.fp-workflow-card,
.fp-preset-block,
.fp-section,
.fp-mini-card,
.fp-statement-block {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #111118;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.fp-preset-block {
  background: #161620;
}

.fp-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.fp-card-header strong {
  color: #EDEDF5;
  font: 800 1rem var(--font-display);
}

.fp-card-header span {
  color: #8888A0;
  font-size: 0.8rem;
  font-weight: 800;
}

/* -- Steps -- */
.fp-steps {
  display: grid;
  gap: 9px;
}

.fp-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: #161620;
}

.fp-step > span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #2A2A3A;
  color: #B8B8CC;
  font-size: 0.82rem;
  font-weight: 900;
}

.fp-step strong {
  display: block;
  color: #B8B8CC;
  font-size: 0.9rem;
  line-height: 1.25;
}

.fp-step em {
  display: block;
  margin-top: 2px;
  color: #8888A0;
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.35;
}

.fp-step.is-active {
  border-color: rgba(34, 197, 94, 0.36);
  background: rgba(34, 197, 94, 0.06);
}

.fp-step.is-active > span {
  color: #ffffff;
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
}

.fp-step.is-done > span {
  color: #ffffff;
  background: #0f766e;
}

.fp-body .brief-status.is-loading .status-dot {
  animation: fp-pulse 0.9s ease-in-out infinite;
}

@keyframes fp-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.45);
    opacity: 1;
  }
}

/* -- Presets -- */
.fp-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #111118;
  color: #EDEDF5;
  font: 800 0.78rem var(--font-display);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.preset-chip:hover {
  border-color: rgba(15, 118, 110, 0.5);
  background: rgba(15, 118, 110, 0.06);
  box-shadow: 0 8px 18px rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.preset-chip:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.22);
  outline-offset: 2px;
}

/* -- Actions -- */
.fp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* -- Output header -- */
.fp-regen-control {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.fp-regen-control select {
  padding: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: #111118;
  color: #EDEDF5;
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 220px;
}

/* -- Company header -- */
.fp-company-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.fp-company-header h3 {
  margin: 0;
  font: 800 1.3rem var(--font-display);
  color: #EDEDF5;
}

.fp-meta-line {
  color: #8888A0;
  font-size: 0.85rem;
}

/* -- Two column layout for breakdown cards -- */
.fp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 760px) {
  .fp-two-col {
    grid-template-columns: 1fr;
  }
}

.fp-mini-card h4 {
  margin: 0 0 8px;
  font: 700 0.85rem var(--font-display);
  color: #B8B8CC;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fp-statement-block h4 {
  margin: 0 0 8px;
  font: 700 0.95rem var(--font-display);
  color: #EDEDF5;
}

/* -- Tables -- */
.fp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fp-table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.fp-table-wrap th,
.fp-table-wrap td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

.fp-table-wrap th {
  background: #f1f5f9;
  color: #B8B8CC;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fp-table-wrap th:first-child,
.fp-table-wrap td:first-child {
  text-align: left;
  font-weight: 600;
  color: #B8B8CC;
}

.fp-table-wrap tr:last-child td {
  border-bottom: none;
}

.fp-table-wrap tr:hover td {
  background: rgba(34, 197, 94, 0.03);
}

/* -- KV table for assumptions -- */
.fp-kv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.fp-kv-table td {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.fp-kv-table td:first-child {
  color: #8888A0;
  font-weight: 500;
  text-transform: capitalize;
}

.fp-kv-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: #EDEDF5;
}

/* -- Insight grid -- */
.fp-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 760px) {
  .fp-insight-grid {
    grid-template-columns: 1fr;
  }
}

/* -- Tag items -- */
.fp-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(52,211,153,0.08);
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.78rem;
  margin: 3px 4px 3px 0;
  font-weight: 500;
}

.fp-tag.risk {
  background: rgba(229,77,77,0.08);
  border-color: #fecaca;
  color: #991b1b;
}

.fp-tag.action {
  background: rgba(108,92,231,0.06);
  border-color: #bfdbfe;
  color: #1e40af;
}

/* -- Loader -- */
.fp-loader {
  display: grid;
  gap: 18px;
  padding: 24px;
  text-align: center;
}

.fp-loader-visual {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.fp-loader-ring {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #ffffff 0 48%, transparent 49%),
    conic-gradient(from 0deg, #22c55e, #0ea5e9, #f59e0b, #22c55e);
  box-shadow: 0 20px 45px rgba(14, 165, 233, 0.22);
  animation: fp-spin 1.4s linear infinite;
}

.fp-loader-ring span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #111118;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

.fp-loader-ring span:nth-child(1) {
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
}

.fp-loader-ring span:nth-child(2) {
  right: 8px;
  bottom: 15px;
}

.fp-loader-ring span:nth-child(3) {
  left: 8px;
  bottom: 15px;
}

.fp-loader-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
}

.fp-loader-cell {
  display: block;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(110deg, #2A2A3A 30%, #f1f5f9 50%, #2A2A3A 70%);
  background-size: 200% 100%;
  animation: fp-shimmer 1.6s ease-in-out infinite;
  will-change: background-position;
}

.fp-loader-cell:nth-child(4) {
  grid-column: span 2;
}

.fp-loader-cell:nth-child(5) {
  grid-column: span 2;
}

@keyframes fp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes fp-spin {
  to { transform: rotate(360deg); }
}

.fp-loader strong {
  display: block;
  color: #EDEDF5;
  font: 800 1rem var(--font-display);
}

.fp-loader p {
  margin: 4px 0 0;
  color: #8888A0;
  font-size: 0.85rem;
}

/* -- Responsive workspace collapse -- */
@media (max-width: 940px) {
  .fp-workspace {
    grid-template-columns: 1fr;
  }

  .fp-form {
    position: static;
    top: auto;
  }
}
