/* ==========================================================================
   finance-layer.css
   Additive-only financial layer for catblob2.
   Never overrides or reuses existing catblob2 classes — new .fl- namespace.
   Colors intentionally mirror style.css's own palette:
     hotpink accent, #0ee2f1c7 translucent cyan panels, #024272 navy text,
     'Quicksand' font, 14px rounded corners — so this feels native, not bolted on.
   ========================================================================== */

.fl-hidden {
  display: none !important;
}

.fl-overlay,
.fl-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ---------- onboarding / guide full-screen overlay ---------- */

.fl-overlay {
  z-index: 10000;
  background: radial-gradient(circle at 50% 30%, rgba(45, 28, 36, 0.86), rgba(20, 10, 15, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Quicksand', sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.fl-card {
  background-color: #0ee2f1c7;
  color: #024272;
  border-radius: 14px;
  padding: 36px 40px;
  max-width: min(480px, calc(100% - 32px));
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: fl-pop 0.35s ease;
}

@keyframes fl-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.fl-card h1 {
  font-size: 1.8em;
  letter-spacing: 2px;
  margin-bottom: 14px;
  color: #024272;
  display: block;
}

.fl-card p {
  display: block;
  letter-spacing: 0.5px;
  line-height: 1.5;
  margin-bottom: 18px;
  font-size: 1em;
}

.fl-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: none;
  border-radius: 90px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1em;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 16px;
  outline: 2px solid transparent;
  transition: outline-color 0.2s;
}

.fl-name-input:focus {
  outline-color: hotpink;
}

.fl-btn {
  padding: 10px 28px;
  border: 0;
  border-radius: 90px;
  letter-spacing: 2px;
  background-color: white;
  color: hotpink;
  font-size: 1em;
  text-transform: uppercase;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.fl-btn:hover,
.fl-btn:focus-visible {
  background-color: hotpink;
  color: white;
}

.fl-btn-secondary {
  background-color: transparent;
  color: #024272;
  border: 2px solid #024272;
}

.fl-btn-secondary:hover,
.fl-btn-secondary:focus-visible {
  background-color: #024272;
  color: white;
}

/* ---------- guide character ---------- */

.fl-guide {
  position: fixed;
  left: 20px;
  bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: min(560px, calc(100% - 40px));
}

.fl-guide-avatar {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
}

.fl-guide-avatar svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.fl-guide-bubble {
  background-color: #0ee2f1c7;
  color: #024272;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  animation: fl-pop 0.3s ease;
}

.fl-guide-bubble p {
  margin: 0 0 14px;
  letter-spacing: 0.3px;
  line-height: 1.5;
  font-size: 0.98em;
}

.fl-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fl-guide-progress {
  display: flex;
  gap: 6px;
}

.fl-guide-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: rgba(2, 66, 114, 0.25);
}

.fl-guide-dot.fl-active {
  background-color: #024272;
}

/* ---------- HUD ---------- */

.fl-hud {
  position: fixed;
  top: 24px;
  right: 20px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: 'Quicksand', sans-serif;
  color: white;
  text-align: right;
}

.fl-hud-name {
  font-size: 0.8em;
  letter-spacing: 1px;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.fl-hud-portfolio {
  border: 0;
  border-radius: 90px;
  padding: 8px 18px;
  background-color: hotpink;
  color: white;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1em;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  min-height: 44px;
}

.fl-hud-portfolio:hover,
.fl-hud-portfolio:focus-visible {
  background-color: #ff1493;
}

/* ---------- help icon ---------- */

.fl-help-btn {
  position: fixed;
  left: 20px;
  bottom: 190px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background-color: rgba(255, 105, 180, 0.85);
  color: white;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.fl-help-btn:hover,
.fl-help-btn:focus-visible {
  background-color: hotpink;
}

/* ---------- analysis modal ---------- */

.fl-modal-backdrop {
  z-index: 9000;
  background: rgba(20, 10, 15, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Quicksand', sans-serif;
}

.fl-modal {
  background-color: #eaf9fbf0;
  color: #024272;
  border-radius: 14px;
  width: min(560px, calc(100% - 32px));
  max-height: min(640px, calc(100% - 64px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  animation: fl-pop 0.25s ease;
}

.fl-modal-header {
  background-color: #0ee2f1c7;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fl-modal-header h2 {
  font-size: 1.2em;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #024272;
}

.fl-modal-close {
  border: 0;
  background: transparent;
  font-size: 1.4em;
  line-height: 1;
  color: #024272;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.fl-tabs {
  display: flex;
  border-bottom: 2px solid rgba(2, 66, 114, 0.12);
}

.fl-tab {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  padding: 12px 8px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85em;
  letter-spacing: 0.5px;
  color: rgba(2, 66, 114, 0.55);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  min-height: 44px;
}

.fl-tab.fl-active {
  color: #024272;
  font-weight: 700;
  border-bottom-color: hotpink;
}

.fl-tab-panel {
  padding: 20px 22px;
  overflow-y: auto;
}

.fl-empty-state {
  text-align: center;
  color: rgba(2, 66, 114, 0.6);
  padding: 24px 8px;
  letter-spacing: 0.3px;
  line-height: 1.5;
}

.fl-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px dashed rgba(2, 66, 114, 0.2);
}

.fl-total-row .fl-total-label {
  font-size: 0.9em;
  letter-spacing: 0.5px;
}

.fl-total-row .fl-total-value {
  font-size: 1.5em;
  font-weight: 700;
}

.fl-investment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fl-investment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background-color: rgba(2, 66, 114, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
}

.fl-investment-row .fl-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fl-investment-row .fl-row-value {
  font-weight: 700;
}

.fl-sector-row {
  margin-bottom: 14px;
}

.fl-sector-row .fl-sector-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.fl-sector-bar-track {
  height: 12px;
  border-radius: 8px;
  background-color: rgba(2, 66, 114, 0.1);
  overflow: hidden;
}

.fl-sector-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, hotpink, #0ee2f1);
  transition: width 0.4s ease;
}

.fl-news-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(2, 66, 114, 0.12);
}

.fl-news-item:last-child {
  border-bottom: 0;
}

.fl-news-headline {
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}

.fl-news-source {
  font-size: 0.8em;
  opacity: 0.65;
  font-style: italic;
}

.fl-risk-note {
  margin-top: 16px;
  font-size: 0.85em;
  opacity: 0.7;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ---------- responsive ---------- */

@media screen and (max-width: 520px) {
  .fl-card {
    padding: 26px 22px;
  }

  .fl-guide {
    flex-direction: column;
    align-items: flex-start;
    bottom: 14px;
    left: 14px;
  }

  .fl-guide-avatar {
    width: 52px;
    height: 52px;
  }

  .fl-hud {
    top: 12px;
    right: 12px;
  }

  .fl-help-btn {
    bottom: 172px;
    left: 14px;
  }
}
