/* =========================================================
   YourNode Finance Widget (tool styling)
   File: assets/tools/finance-widget.css
   Scope: ONLY .hc-finance-widget and children
   Goal: clean UX, conversion focused, conflict-proof
========================================================= */

.hc-finance-widget {
  --hc-fin-bg: #ffffff;
  --hc-fin-card: #ffffff;
  --hc-fin-border: rgba(17, 24, 39, 0.10);
  --hc-fin-text: #0f172a;
  --hc-fin-muted: rgba(15, 23, 42, 0.70);
  --hc-fin-soft: rgba(15, 23, 42, 0.06);

  /* YourNode / RND accent hint (can be overridden by parent if desired) */
  --hc-fin-accent: #f59e0b; /* warm orange */
  --hc-fin-accent-2: #111827; /* near-black */
  --hc-fin-success: #16a34a; /* green for result highlight */

  --hc-fin-radius: 18px;
  --hc-fin-radius-sm: 12px;
  --hc-fin-shadow: 0 10px 30px rgba(17, 24, 39, 0.10);
  --hc-fin-shadow-soft: 0 6px 18px rgba(17, 24, 39, 0.08);

  --hc-fin-gap: 16px;
  --hc-fin-gap-lg: 22px;

  color: var(--hc-fin-text);
  background: var(--hc-fin-bg);
  border: 1px solid var(--hc-fin-border);
  border-radius: var(--hc-fin-radius);
  box-shadow: var(--hc-fin-shadow-soft);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Header */
.hc-finance-widget .hc-finance-head {
  margin-bottom: 14px;
}

.hc-finance-widget .hc-finance-title {
  margin: 0 0 6px 0;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.hc-finance-widget .hc-finance-subtitle {
  margin: 0;
  color: var(--hc-fin-muted);
  font-size: 14px;
  line-height: 1.4;
}

/* Layout: mobile first */
.hc-finance-widget .hc-finance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--hc-fin-gap-lg);
  margin-top: 16px;
}

/* Inputs card */
.hc-finance-widget .hc-finance-form {
  background: var(--hc-fin-card);
  border: 1px solid var(--hc-fin-border);
  border-radius: var(--hc-fin-radius);
  padding: 16px;
}

/* Input rows */
.hc-finance-widget .hc-fin-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.hc-finance-widget .hc-fin-label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.85);
}

.hc-finance-widget .hc-fin-hint {
  font-size: 12px;
  color: var(--hc-fin-muted);
  margin-top: -6px;
}

/* Inputs */
.hc-finance-widget .hc-fin-input,
.hc-finance-widget .hc-fin-select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--hc-fin-border);
  background: #fff;
  border-radius: var(--hc-fin-radius-sm);
  padding: 12px 12px;
  font-size: 15px;
  line-height: 1.2;
  color: var(--hc-fin-text);
  outline: none;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.hc-finance-widget .hc-fin-input:focus,
.hc-finance-widget .hc-fin-select:focus {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.hc-finance-widget .hc-fin-input[readonly],
.hc-finance-widget .hc-fin-input[disabled],
.hc-finance-widget .hc-fin-select[disabled] {
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.65);
  cursor: not-allowed;
}

/* Optional: hide rate entirely (if markup includes a rate row) */
.hc-finance-widget .hc-fin-row.hc-fin-row--rate {
  display: none;
}

/* Result card - visually dominant */
.hc-finance-widget .hc-finance-result {
  border-radius: var(--hc-fin-radius);
  padding: 18px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  background:
    radial-gradient(1200px 200px at 10% -20%, rgba(245, 158, 11, 0.20), transparent 55%),
    radial-gradient(900px 220px at 90% -40%, rgba(22, 163, 74, 0.22), transparent 50%),
    #0b1220;
  color: #fff;
  box-shadow: var(--hc-fin-shadow);
}

.hc-finance-widget .hc-fin-result-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.75;
  margin: 0 0 8px 0;
}

.hc-finance-widget .hc-fin-result-value {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.0;
}

.hc-finance-widget .hc-fin-result-meta {
  margin: 10px 0 0 0;
  font-size: 13px;
  opacity: 0.78;
  line-height: 1.4;
}

/* CTA */
.hc-finance-widget .hc-fin-cta {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.hc-finance-widget .hc-fin-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 14px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Primary = black with orange accent hint */
.hc-finance-widget .hc-fin-btn--primary {
  background: linear-gradient(180deg, #0b0f1a 0%, #090d16 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30);
  position: relative;
  overflow: hidden;
}

.hc-finance-widget .hc-fin-btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 200px at 30% 0%, rgba(245, 158, 11, 0.22), transparent 55%);
  pointer-events: none;
}

.hc-finance-widget .hc-fin-btn--primary:hover {
  transform: translateY(-1px);
}

.hc-finance-widget .hc-fin-btn--primary:active {
  transform: translateY(0);
  opacity: 0.96;
}

/* Secondary */
.hc-finance-widget .hc-fin-btn--ghost {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hc-finance-widget .hc-fin-btn--ghost:hover {
  transform: translateY(-1px);
}

/* Trust line / disclaimer */
.hc-finance-widget .hc-fin-trust {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.hc-finance-widget .hc-fin-disclaimer {
  margin-top: 10px;
  font-size: 12px;
  color: var(--hc-fin-muted);
}

/* Desktop layout */
@media (min-width: 920px) {
  .hc-finance-widget {
    padding: 22px;
  }

  .hc-finance-widget .hc-finance-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .hc-finance-widget .hc-finance-form {
    padding: 18px;
  }

  .hc-finance-widget .hc-finance-result {
    padding: 20px;
    position: sticky;
    top: 18px;
  }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hc-finance-widget .hc-fin-input,
  .hc-finance-widget .hc-fin-select,
  .hc-finance-widget .hc-fin-btn {
    transition: none;
  }
}
