/* MAGNET FACTORY — shared tool-page components. Sits ON TOP of theme.css.
   Brand tokens only: navy #0D0F2C, orange #FF492C, blue #3E57DA. No new hues. */

.tp-hero { background: var(--paper, #F7F7FB); padding: 72px 24px 40px; text-align: center; }
.tp-hero .eyebrow { display: inline-block; background: rgba(255, 73, 44, 0.08); color: var(--cta, #FF492C); border-radius: 999px; padding: 7px 18px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 18px; }
.tp-hero h1 { font-family: 'General Sans', 'Inter', sans-serif; color: var(--ink, #0D0F2C); font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -0.02em; max-width: 760px; margin: 0 auto 14px; }
.tp-hero .tp-sub { color: var(--body, #333B52); font-size: 18px; line-height: 1.6; max-width: 620px; margin: 0 auto; }

/* The magic button — the tool shell itself */
.rf-tool { max-width: 880px; margin: 32px auto 0; padding: 0 24px 8px; }
.rf-tool-card { background: var(--white, #fff); border: 1px solid var(--line, #EEF1F6); border-radius: 20px; box-shadow: 0 24px 60px rgba(13, 15, 44, 0.12), 0 2px 8px rgba(13, 15, 44, 0.05); padding: 36px; position: relative; overflow: hidden; }
.rf-tool-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--cta, #FF492C) 0%, var(--cta, #FF492C) 45%, var(--primary, #3E57DA) 100%); }
.rf-tool-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.rf-tool-head .rf-ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(62, 87, 218, 0.10); color: var(--primary, #3E57DA); display: flex; align-items: center; justify-content: center; flex: 0 0 44px; }
.rf-tool-head h2 { font-size: 19px; color: var(--ink, #0D0F2C); margin: 0; }
.rf-tool-head p { font-size: 13px; color: var(--muted, #6B7A99); margin: 2px 0 0; }

.tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.tp-field { display: flex; flex-direction: column; gap: 6px; }
.tp-field.full { grid-column: 1 / -1; }
.tp-field label { font-size: 13px; font-weight: 700; color: var(--ink, #0D0F2C); }
.tp-field .hint { font-size: 12px; color: var(--muted, #6B7A99); font-weight: 400; }
.tp-field input, .tp-field select, .tp-field textarea {
  border: 1.5px solid var(--line, #EEF1F6); border-radius: 12px; padding: 13px 14px;
  font: inherit; font-size: 15px; color: var(--ink, #0D0F2C); background: var(--white, #fff);
  transition: border-color 0.18s ease, box-shadow 0.18s ease; width: 100%;
}
.tp-field textarea { min-height: 140px; resize: vertical; font-size: 13px; }
.tp-field input::placeholder, .tp-field textarea::placeholder { color: #9AA6BF; opacity: 1; }
.tp-field input:hover:not(:focus), .tp-field select:hover:not(:focus), .tp-field textarea:hover:not(:focus) { border-color: #D9DFEC; }
.tp-field input:focus, .tp-field select:focus, .tp-field textarea:focus {
  outline: none; border-color: var(--primary, #3E57DA); box-shadow: 0 0 0 3px rgba(62, 87, 218, 0.12), 0 4px 14px rgba(13, 15, 44, 0.06);
}
.tp-field .unit-wrap { position: relative; }
.tp-field .unit-wrap .unit { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted, #6B7A99); font-size: 15px; pointer-events: none; }
.tp-field .unit-wrap input { padding-left: 30px; }

.tp-run { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.tp-run .btn-run {
  background: var(--cta, #FF492C); color: #fff; border: 0; border-radius: 13px;
  padding: 16px 28px; font-size: 16px; font-weight: 800; font-family: inherit;
  cursor: pointer; transition: background 0.15s, transform 0.15s; width: 100%;
}
.tp-run .btn-run:hover { background: var(--cta-hover, #e63d22); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255, 73, 44, 0.30); }
.tp-run .btn-run:active { transform: translateY(1px) scale(0.995); box-shadow: none; }
.tp-run .btn-run:focus-visible, .tp-save .btn-save:focus-visible { outline: 3px solid rgba(62, 87, 218, 0.45); outline-offset: 2px; }
.tp-run .btn-run:disabled { opacity: 0.7; cursor: wait; transform: none; box-shadow: none; }
.tp-run .btn-run { position: relative; }
.tp-run .tp-privacy { font-size: 12px; color: var(--muted, #6B7A99); text-align: center; }

/* Results */
.tp-result { margin-top: 26px; display: none; }
.tp-result.show { display: block; animation: tpIn 0.35s ease; }
@keyframes tpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tp-verdict { background: linear-gradient(135deg, #0D0F2C 0%, #1A1E48 100%); border-radius: 16px; color: #fff; padding: 28px 30px; display: flex; flex-wrap: wrap; gap: 24px 40px; }
.tp-verdict .kpi { min-width: 130px; }
.tp-verdict .kpi .n { font-family: 'General Sans', 'Inter', sans-serif; font-size: clamp(28px, 4.5vw, 42px); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tp-verdict .kpi .n.pos { color: #fff; }
.tp-verdict .kpi .n.hot { color: var(--cta, #FF492C); }
.tp-verdict .kpi .l { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.65); margin-top: 4px; }
.tp-breakdown { margin-top: 14px; border: 1px solid var(--line, #EEF1F6); border-radius: 16px; overflow: hidden; }
.tp-breakdown .row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 20px; font-size: 14px; color: var(--body, #333B52); border-top: 1px solid var(--line, #EEF1F6); }
.tp-breakdown .row:first-child { border-top: 0; }
.tp-breakdown .row.total { background: var(--paper, #F7F7FB); font-weight: 800; color: var(--ink, #0D0F2C); }
.tp-breakdown .row b { font-variant-numeric: tabular-nums; }
.tp-breakdown .row:not(.total):hover { background: rgba(247, 247, 251, 0.7); }
.tp-ai-output { margin-top: 14px; border: 1px solid var(--line, #EEF1F6); border-radius: 16px; padding: 24px 26px; font-size: 15px; line-height: 1.7; color: var(--body, #333B52); }
.tp-ai-output h3 { color: var(--ink, #0D0F2C); font-size: 17px; margin: 18px 0 8px; }
.tp-ai-output h3:first-child { margin-top: 0; }
.tp-error { margin-top: 14px; background: rgba(255, 73, 44, 0.06); border: 1px solid rgba(255, 73, 44, 0.25); color: var(--ink, #0D0F2C); border-radius: 12px; padding: 14px 18px; font-size: 14px; display: none; }
.tp-error.show { display: block; }
.tp-loading { display: none; margin-top: 20px; text-align: center; color: var(--muted, #6B7A99); font-size: 14px; }
.tp-loading.show { display: block; }
.tp-loading .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cta, #FF492C); margin: 0 3px; animation: tpDot 1.2s infinite ease-in-out; }
.tp-loading .dot:nth-child(2) { animation-delay: 0.15s; }
.tp-loading .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes tpDot { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* Email-me-results strip (Class A) */
.tp-save { margin-top: 14px; background: var(--paper, #F7F7FB); border: 1px solid var(--line, #EEF1F6); border-radius: 16px; padding: 20px 22px; }
.tp-save .tp-save-row { display: flex; gap: 10px; }
.tp-save input { flex: 1; border: 1.5px solid var(--line, #EEF1F6); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; }
.tp-save input:focus { outline: none; border-color: var(--primary, #3E57DA); box-shadow: 0 0 0 3px rgba(62, 87, 218, 0.12); }
.tp-save .btn-save { background: var(--ink, #0D0F2C); color: #fff; border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tp-save .btn-save:hover { background: #1A1E48; }
.tp-save p { font-size: 13px; color: var(--body, #333B52); margin: 0 0 12px; font-weight: 600; }
.tp-save .done { color: var(--ink, #0D0F2C); font-weight: 700; font-size: 14px; display: none; }

/* Page body sections */
.tp-sections { max-width: 880px; margin: 0 auto; padding: 24px 24px 40px; }
.tp-sections .sec-block { padding: 36px 0 8px; }
.tp-sections h2 { font-family: 'General Sans', 'Inter', sans-serif; color: var(--ink, #0D0F2C); font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -0.02em; margin-bottom: 14px; }
.tp-sections p { color: var(--body, #333B52); font-size: 16px; line-height: 1.7; margin-bottom: 14px; }
.tp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 10px; }
.tp-step { background: var(--white, #fff); border: 1px solid var(--line, #EEF1F6); border-radius: 16px; padding: 24px; }
.tp-step .rf-ico { width: 40px; height: 40px; border-radius: 11px; background: rgba(255, 73, 44, 0.08); color: var(--cta, #FF492C); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.tp-step h3 { font-size: 16px; color: var(--ink, #0D0F2C); margin-bottom: 6px; }
.tp-step p { font-size: 14px; margin: 0; }
.tp-vs { border: 1px solid var(--line, #EEF1F6); border-radius: 16px; overflow: hidden; margin-top: 10px; }
.tp-vs .vs-row { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line, #EEF1F6); }
.tp-vs .vs-row:first-child { border-top: 0; background: var(--paper, #F7F7FB); font-weight: 800; color: var(--ink, #0D0F2C); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.tp-vs .vs-cell { padding: 14px 20px; font-size: 14px; color: var(--body, #333B52); }
.tp-vs .vs-cell:first-child { border-right: 1px solid var(--line, #EEF1F6); }
.tp-vs .vs-row:not(:first-child):nth-child(even) { background: rgba(247, 247, 251, 0.55); }
.tp-vs .vs-row:not(:first-child):hover { background: var(--paper, #F7F7FB); }
.tp-quali { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.tp-quali .q { display: flex; gap: 10px; align-items: flex-start; background: var(--white, #fff); border: 1px solid var(--line, #EEF1F6); border-radius: 14px; padding: 16px 18px; font-size: 14px; color: var(--body, #333B52); }
.tp-quali .q svg { flex: 0 0 18px; margin-top: 2px; color: var(--primary, #3E57DA); }

/* Bridge CTA */
.tp-bridge { background: linear-gradient(135deg, #0D0F2C 0%, #1A1E48 100%); border-radius: 20px; color: #fff; padding: 44px 40px; text-align: center; margin: 40px auto 0; }
.tp-bridge h2 { color: #fff; font-family: 'General Sans', 'Inter', sans-serif; font-size: clamp(24px, 3.6vw, 32px); letter-spacing: -0.02em; margin-bottom: 12px; }
.tp-bridge p { color: rgba(255, 255, 255, 0.75); font-size: 16px; line-height: 1.65; max-width: 560px; margin: 0 auto 24px; }
.tp-bridge .btn-bridge { display: inline-block; background: var(--cta, #FF492C); color: #fff; text-decoration: none; border-radius: 13px; padding: 16px 34px; font-weight: 800; font-size: 16px; transition: background 0.15s, transform 0.15s; }
.tp-bridge .btn-bridge:hover { background: var(--cta-hover, #e63d22); transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 73, 44, 0.35); }
.tp-bridge .btn-bridge:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.55); outline-offset: 3px; }
.tp-bridge .sub { display: block; margin-top: 12px; font-size: 13px; color: rgba(255, 255, 255, 0.55); }

/* Related tools */
.tp-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; }
.tp-related a { display: block; background: var(--white, #fff); border: 1px solid var(--line, #EEF1F6); border-radius: 14px; padding: 18px 20px; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.tp-related a:hover { border-color: var(--primary, #3E57DA); transform: translateY(-2px); }
.tp-related b { display: block; color: var(--ink, #0D0F2C); font-size: 14px; margin-bottom: 4px; }
.tp-related span { color: var(--muted, #6B7A99); font-size: 12.5px; line-height: 1.5; }

/* Motion layer — everything here is decorative and reduced-motion aware */
@media (prefers-reduced-motion: no-preference) {
  .tp-result.show .tp-verdict .kpi { animation: tpIn 0.45s ease backwards; }
  .tp-result.show .tp-verdict .kpi:nth-child(2) { animation-delay: 0.07s; }
  .tp-result.show .tp-verdict .kpi:nth-child(3) { animation-delay: 0.14s; }
  .tp-result.show .tp-verdict .kpi:nth-child(4) { animation-delay: 0.21s; }
  .tp-result.show .tp-verdict .kpi:nth-child(5) { animation-delay: 0.28s; }
  .tp-result.show .tp-breakdown .row { animation: tpIn 0.35s ease backwards; }
  .tp-result.show .tp-breakdown .row:nth-child(2) { animation-delay: 0.05s; }
  .tp-result.show .tp-breakdown .row:nth-child(3) { animation-delay: 0.10s; }
  .tp-result.show .tp-breakdown .row:nth-child(4) { animation-delay: 0.15s; }
  .tp-result.show .tp-breakdown .row:nth-child(5) { animation-delay: 0.20s; }
  .tp-result.show .tp-breakdown .row:nth-child(6) { animation-delay: 0.25s; }
  .tp-result.show .tp-breakdown .row:nth-child(7) { animation-delay: 0.30s; }
  .tp-result.show .tp-breakdown .row:nth-child(n+8) { animation-delay: 0.35s; }
  .tp-error.show { animation: tpShake 0.4s ease; }
  /* Spinner inside the run button while a gated (Class B/C) run is in flight */
  .tp-run .btn-run.loading { color: transparent; }
  .tp-run .btn-run.loading::after {
    content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
    border-radius: 50%; animation: tpSpin 0.7s linear infinite;
  }
}
@keyframes tpShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
@keyframes tpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .tp-result.show { animation: none; }
  .tp-loading .dot { animation: none; opacity: 0.7; }
  .tp-run .btn-run, .tp-bridge .btn-bridge, .tp-related a { transition: background 0.15s, border-color 0.15s; }
  .tp-run .btn-run:hover, .tp-bridge .btn-bridge:hover, .tp-related a:hover { transform: none; }
}

@media (max-width: 720px) {
  .tp-hero { padding: 52px 20px 28px; }
  .rf-tool { padding: 0 16px; }
  .rf-tool-card { padding: 24px 20px; border-radius: 16px; }
  .tp-grid, .tp-quali { grid-template-columns: 1fr; }
  .tp-steps, .tp-related { grid-template-columns: 1fr; }
  .tp-verdict { padding: 22px; gap: 18px 28px; }
  .tp-save .tp-save-row { flex-direction: column; }
  .tp-bridge { padding: 34px 24px; border-radius: 16px; }
  .tp-sections { padding: 16px 20px 32px; }
}
