/* ============================================================
   Free trading calculators.

   Layers on top of ../blog/blog.css so the tools inherit the
   brand, the shell, the nav, and the footer. Only what is new
   to a calculator page lives here.
   ============================================================ */

.tool-head { max-width: 880px; padding: 80px 0 34px; }
.tool-head h1 { font-size: clamp(38px, 6vw, 62px); line-height: 1.05; letter-spacing: -.045em; margin: 14px 0 0; }
.tool-head .lead { margin-top: 18px; font-size: 17px; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 28px;
  align-items: start;
  padding-bottom: 40px;
}

.tool-card {
  padding: 26px;
  border: 1px solid var(--line, #2a2a2e);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(25, 28, 33, .96), rgba(14, 15, 18, .98));
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
}

.tool-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tool-field { display: grid; gap: 7px; min-width: 0; }
.tool-field label { color: #d4d4d8; font-size: 12.5px; font-weight: 650; }
.tool-field .hint { color: #71717a; font-size: 11px; line-height: 1.5; }
.tool-field input,
.tool-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line, #2a2a2e);
  border-radius: 12px;
  background: rgba(14, 15, 18, .75);
  color: #fff;
  font-family: var(--tr-font-mono, ui-monospace, monospace);
  font-size: 15px;
  font-weight: 600;
}
.tool-field input:focus,
.tool-field select:focus { outline: none; border-color: rgba(163, 230, 53, .55); }
/* Spinners on a money field are noise, and dragging one by accident
   silently changes the answer. */
.tool-field input[type="number"] { -moz-appearance: textfield; }
.tool-field input[type="number"]::-webkit-outer-spin-button,
.tool-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tool-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--line, #2a2a2e);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: #d4d4d8;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .7, .3, 1), border-color .18s ease, color .18s ease;
}
.tool-btn:hover { transform: translateY(-2px); border-color: rgba(163, 230, 53, .4); color: #fff; }
.tool-btn.primary { border: 0; color: #0e0f12; background: linear-gradient(135deg, #a3e635, #bef264); font-weight: 750; }

/* Results ---------------------------------------------------- */
.tool-results { display: grid; gap: 12px; }
.tool-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid rgba(163, 230, 53, .13);
  border-radius: 15px;
  background: rgba(163, 230, 53, .045);
}
.tool-result .r-label { color: #a1a1aa; font-size: 12px; font-weight: 650; }
.tool-result .r-value {
  color: #fff;
  font-family: var(--tr-font-mono, ui-monospace, monospace);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-align: right;
  overflow-wrap: anywhere;
}
.tool-result.is-headline { border-color: rgba(163, 230, 53, .42); background: rgba(163, 230, 53, .1); }
.tool-result.is-headline .r-value { color: #a3e635; font-size: 30px; }
.tool-result.is-warn { border-color: rgba(244, 82, 95, .4); background: rgba(244, 82, 95, .08); }
.tool-result.is-warn .r-value { color: #f4525f; }
.tool-result .r-note { display: block; margin-top: 3px; color: #71717a; font-size: 11px; font-weight: 500; }

.tool-error {
  padding: 14px 16px;
  border: 1px solid rgba(250, 204, 21, .3);
  border-radius: 14px;
  background: rgba(250, 204, 21, .07);
  color: #facc15;
  font-size: 13px;
  font-weight: 600;
}

.tool-side { display: grid; gap: 16px; position: sticky; top: 24px; }
.tool-cta {
  padding: 24px;
  border: 1px solid rgba(163, 230, 53, .22);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(163, 230, 53, .09), rgba(14, 15, 18, .98));
}
.tool-cta h3 { margin: 8px 0 10px; font-size: 21px; line-height: 1.2; letter-spacing: -.03em; }
.tool-cta p { margin: 0 0 18px; color: #a1a1aa; font-size: 13.5px; line-height: 1.65; }
.tool-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a3e635, #bef264);
  color: #0e0f12;
  font-size: 13.5px;
  font-weight: 750;
  text-decoration: none;
}

.tool-related { padding: 22px 24px; border: 1px solid var(--line, #2a2a2e); border-radius: 22px; background: rgba(24, 24, 27, .6); }
.tool-related h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.tool-related a { display: block; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); color: #d4d4d8; font-size: 13px; text-decoration: none; }
.tool-related a:last-child { border-bottom: 0; }
.tool-related a:hover { color: #a3e635; }

/* The written part below the calculator. This is what search engines
   actually rank; the calculator is what makes people stay. */
.tool-copy { max-width: 760px; padding: 10px 0 100px; color: #d4d4d8; font-size: 16px; line-height: 1.8; }
.tool-copy h2 { margin: 42px 0 12px; color: #fff; font-size: 27px; line-height: 1.18; letter-spacing: -.035em; }
.tool-copy h3 { margin: 28px 0 8px; color: #d4d4d8; font-size: 18px; }
.tool-copy p { margin: 0 0 18px; }
.tool-copy ul, .tool-copy ol { margin: 0 0 20px; padding-left: 22px; }
.tool-copy li { margin-bottom: 9px; }
.tool-copy code { padding: 2px 6px; border-radius: 6px; background: rgba(163, 230, 53, .09); color: #a3e635; font-family: var(--tr-font-mono, monospace); font-size: 14px; }

/* Hub -------------------------------------------------------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; padding-bottom: 90px; }
.tool-tile {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line, #2a2a2e);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(25, 28, 33, .96), rgba(14, 15, 18, .98));
  color: inherit;
  text-decoration: none;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), border-color .22s ease;
}
.tool-tile:hover { transform: translateY(-5px); border-color: rgba(163, 230, 53, .3); }
.tool-tile h2 { margin: 12px 0 8px; font-size: 21px; line-height: 1.2; letter-spacing: -.03em; }
.tool-tile p { margin: 0; color: #71717a; font-size: 13px; line-height: 1.65; }
.tool-tile .go { margin-top: auto; padding-top: 20px; color: #a3e635; font-size: 12px; font-weight: 750; }

@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; }
}

/* Conversion block under the results --------------------------------
   Named "block", not "card": blog.css repaints [class*="card"] and
   [class*="panel"] with !important, which flattened this to the same grey
   as every other panel. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.tool-card .capture-block {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(163, 230, 53, .22);
  border-radius: 16px;
  background: rgba(163, 230, 53, .05);
}
.tool-card .capture-block strong { display: block; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.tool-card .capture-block p { margin: 8px 0 0; color: #a1a1aa; font-size: 13.5px; line-height: 1.65; }
.capture-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tool-card .capture-block .capture-primary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  background: linear-gradient(135deg, #a3e635, #bef264);
  color: #0e0f12;
  font-size: 13.5px;
  font-weight: 750;
  text-decoration: none;
}
.tool-card .capture-block .capture-primary { color: #0e0f12 !important; }
.tool-card .capture-block .capture-toggle {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #2a2a2e;
  border-radius: 11px;
  background: transparent;
  color: #d4d4d8;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
}
.tool-card .capture-block .capture-toggle:hover { border-color: rgba(163, 230, 53, .4); color: #fff; }
.capture-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.capture-form[hidden] { display: none; }
.capture-form input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #2a2a2e;
  border-radius: 11px;
  background: rgba(14, 15, 18, .75);
  color: #fff;
  font-size: 14px;
}
.capture-form input[type="email"]:focus { outline: none; border-color: rgba(163, 230, 53, .55); }
/* The honeypot. Clipped rather than pushed off-screen with a negative
   offset - that widened the document and gave every calculator page a
   horizontal scrollbar. Still rendered, so bots that skip display:none
   fields fill it in. */
.capture-form #captureCompany {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
  overflow: hidden;
}
.tool-card .capture-block .capture-form button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  background: #a3e635;
  color: #0e0f12;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.capture-form button:disabled { opacity: .6; cursor: default; }
.capture-note { margin: 10px 0 0 !important; color: #71717a !important; font-size: 11.5px !important; }
.capture-note.is-good { color: #a3e635 !important; }

/* Phone. Measured at 375px: nine controls sat under 36px tall, which is
   below what a thumb reliably hits. */
@media (max-width: 640px) {
  .tool-head { padding: 46px 0 24px; }
  .tool-head h1 { font-size: clamp(30px, 8vw, 40px); }
  .tool-btn,
  .tool-related a,
  .tool-related-link,
  .capture-toggle,
  .tool-card .capture-block .capture-primary,
  .tool-card .capture-block .capture-form button { min-height: 44px; }
  .tool-related a { padding: 11px 0; }
  .tool-actions .tool-btn { flex: 1 1 100%; justify-content: center; }
  .tool-result { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tool-result .r-value { text-align: left; }
  .capture-actions > * { flex: 1 1 100%; justify-content: center; text-align: center; }
}
