/* Is My Page Better? - tool widget styles, on Hawk Academy brand.
   Relies on ../css/styles.css for the site :root tokens (--color-*, --font-*,
   --radius-*, --gradient-cta) + chrome (header/footer/.container).
   Defines the form + results widget in brand, and aliases the status tokens
   the tool script already references (--good/warn/bad) so the JS is unchanged. */
:root {
  --good-fg:#0e9f6e; --good-bg:#e6f6ef;
  --warn-fg:#b45309; --warn-bg:#fdf3d7;
  --bad-fg:#dc2626;  --bad-bg:#fdecec;
  --paper-2:#ECEAE6; --line:#E8E6E2; --line-2:#D5D3CF;
}

/* ---------- hero ---------- */
.tool-hero { background: var(--color-black); padding: 120px 0 80px; text-align: center; position: relative; overflow: hidden; }
.tool-hero::before { content:''; position:absolute; top:30px; right:8%; width:100px; height:100px; border-radius:50%; background: var(--color-yellow); opacity:.6; }
.tool-hero::after { content:''; position:absolute; bottom:40px; left:6%; width:50px; height:50px; border-radius:50%; background: var(--color-lavender); opacity:.4; }
.tool-hero .hero__label { display:inline-block; font-family: var(--font-body); font-size:13px; font-weight:600; text-transform:uppercase; letter-spacing:2px; color: var(--color-cyan); margin-bottom:16px; }
.tool-hero h1 { font-family: var(--font-heading); font-size: clamp(32px,5vw,48px); font-weight:600; color: var(--color-white); line-height:1.15; max-width:760px; margin:0 auto 16px; }
.tool-hero h1 span { color: var(--color-lavender); }
.tool-hero p { color: var(--color-light-body); max-width:580px; margin:0 auto 32px; font-size:17px; line-height:1.7; }

/* ---------- form - lives IN the dark hero (ad-spend-calculator style) ---------- */
.tool-form { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; text-align: left; position: relative; z-index: 2; }
.tool-form .field { margin: 0; }
.tool-form .field label { display:block; font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--color-light-body); margin-bottom: 7px; }
.tool-form .field .hint { color: rgba(255,255,255,.45); font-weight: 400; font-size: 12.5px; }
.tool-form .field input, .tool-form .field select {
  width: 100%; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: #fff;
  padding: 15px 16px; border-radius: 10px; font-family: var(--font-body); font-size: 15px; outline: none; transition: border-color .2s;
}
.tool-form .field input::placeholder { color: rgba(255,255,255,.38); }
.tool-form .field select { cursor: pointer; }
.tool-form .field select option { background: #111; color: #fff; }
.tool-form .field input:focus, .tool-form .field select:focus { border-color: var(--color-cyan); }
.tool-form .btn {
  appearance:none; cursor:pointer; border:0; width:100%; margin-top:4px;
  border-radius: var(--radius-pill); padding: 16px; background: var(--gradient-cta); color: var(--color-black);
  font-family: var(--font-body); font-weight: 600; font-size: 15px; transition: opacity .2s;
}
.tool-form .btn:hover { opacity:.85; }
.tool-form .btn:disabled { opacity:.55; cursor:progress; }
.hero-note { color: rgba(255,255,255,.45); font-size: 12.5px; max-width: 560px; margin: 16px auto 0; position:relative; z-index:2; }
.hero-note a { color: rgba(255,255,255,.7); text-decoration: underline; }

/* ---------- results band (off-white, revealed after a run) ---------- */
.tool-results { background: var(--color-off-white); padding: 56px 0 90px; display: none; }
.tool-results.visible { display: block; }
.tool-wrap { max-width: 880px; margin: 0 auto; }
.card { background: var(--color-white); border:1px solid var(--line); border-radius: var(--radius-card); padding: 28px; margin: 18px 0; }
.card:first-child { margin-top: 0; }

/* ---------- states ---------- */
.hint { font-family: var(--font-body); font-size:13px; color: var(--color-body-text); }
.hidden { display:none !important; }
.err { background: var(--bad-bg); color: var(--bad-fg); border:1px solid rgba(220,38,38,.25); padding:14px 16px; border-radius:10px; font-size:14px; margin-top:16px; }
.foot { color: var(--color-body-text); font-size:13px; text-align:center; padding:34px 0 0; }
.foot a { color: var(--color-dark-text); text-decoration:underline; }
.spinner { display:inline-block; width:16px; height:16px; border:2px solid rgba(0,0,0,.25); border-top-color: var(--color-black); border-radius:50%; animation:spin .7s linear infinite; vertical-align:-2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- section heading ---------- */
.sec-h { display:flex; align-items:baseline; gap:10px; margin: 30px 0 6px; }
.sec-h h2 { font-family: var(--font-heading); font-weight:600; font-size:20px; color: var(--color-dark-text); margin:0; }
.sec-h .meta { font-size:13px; color: var(--color-body-text); margin-left:auto; }

/* ---------- score ring + grade ---------- */
.scorebar { display:flex; align-items:center; gap:24px; flex-wrap:wrap; }
.ring { --p:0; --c: var(--good-fg); position:relative; width:104px; height:104px; flex:0 0 auto; border-radius:50%; background: conic-gradient(var(--c) calc(var(--p)*1%), var(--paper-2) 0); }
.ring::after { content:''; position:absolute; inset:9px; background: var(--color-white); border-radius:50%; }
.ring .num { position:absolute; inset:0; display:grid; place-items:center; font-family: var(--font-heading); font-size:2rem; font-weight:700; z-index:1; }
.grade { font-family: var(--font-heading); font-size:1.4rem; font-weight:600; color: var(--color-dark-text); }
.grade small { display:block; font-family: var(--font-body); font-weight:400; font-size:.85rem; color: var(--color-body-text); margin-top:3px; word-break:break-all; }

/* ---------- check rows ---------- */
.checks { display:grid; gap:0; }
.check { display:grid; grid-template-columns:26px 1fr auto; gap:12px; padding:14px 2px; border-top:1px solid var(--line); align-items:start; }
.check:first-child { border-top:0; }
.check .ico { width:22px; height:22px; border-radius:50%; display:grid; place-items:center; font-size:.78rem; font-weight:800; margin-top:2px; }
.check.pass .ico { background: var(--good-bg); color: var(--good-fg); }
.check.warn .ico { background: var(--warn-bg); color: var(--warn-fg); }
.check.fail .ico { background: var(--bad-bg);  color: var(--bad-fg); }
.check .t { font-weight:700; font-size:.95rem; color: var(--color-dark-text); }
.check .d { font-size:.88rem; color: var(--color-body-text); margin-top:2px; line-height:1.55; }
.check .d code { font-family: ui-monospace, Menlo, monospace; font-size:.82em; background: var(--color-off-white); padding:1px 5px; border-radius:5px; }
.check .pts { font-size:.8rem; color: var(--color-body-text); white-space:nowrap; font-variant-numeric:tabular-nums; }

/* ---------- stat tiles ---------- */
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:12px; margin:20px 0 0; }
.stat { background: var(--color-off-white); border-radius:12px; padding:14px 16px; }
.stat .v { font-family: var(--font-heading); font-size:1.4rem; font-weight:600; color: var(--color-dark-text); letter-spacing:-.01em; }
.stat .l { font-size:.74rem; color: var(--color-body-text); text-transform:uppercase; letter-spacing:.05em; margin-top:2px; }

/* ---------- tables ---------- */
.tbl { width:100%; border-collapse:collapse; font-size:.92rem; }
.tbl th, .tbl td { text-align:left; padding:11px 12px; border-bottom:1px solid var(--line); color: var(--color-dark-text); }
.tbl th { font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color: var(--color-body-text); font-weight:700; }
.tbl .num { text-align:right; font-variant-numeric:tabular-nums; }
.dr { display:inline-block; min-width:34px; text-align:center; font-weight:800; font-size:.8rem; padding:2px 7px; border-radius:6px; }
.dr.hi { background: var(--good-bg); color: var(--good-fg); }
.dr.mid { background: var(--warn-bg); color: var(--warn-fg); }
.dr.lo { background: var(--paper-2); color: var(--color-body-text); }

/* ---------- compare ---------- */
.cmp-head { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:16px; }
.cmp-side { text-align:center; display:flex; flex-direction:column; align-items:center; gap:8px; }
.cmp-side .ring { width:88px; height:88px; } .cmp-side .ring .num { font-size:1.5rem; }
.cmp-label { font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color: var(--color-body-text); }
.cmp-url { font-size:.8rem; color: var(--color-body-text); word-break:break-all; max-width:34ch; }
.cmp-vs { font-family: var(--font-heading); font-weight:600; color: var(--color-light-body); }
.cmp-tbl { margin-top:18px; }
@media (max-width:560px){ .cmp-head { grid-template-columns:1fr; } .cmp-vs { display:none; } }

/* ---------- chips ---------- */
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-block; background: var(--color-off-white); border:1px solid var(--line); border-radius:8px; padding:6px 11px; font-size:.86rem; color: var(--color-dark-text); }
.chip-good { background: var(--good-bg); border-color: var(--good-bg); color: var(--good-fg); }
.kw-term { font-family: var(--font-heading); font-size:1.15rem; font-weight:600; color: var(--color-dark-text); margin-bottom:4px; }

/* ---------- info note ---------- */
.note { background: rgba(173,186,255,.14); border:1px solid rgba(173,186,255,.4); color: var(--color-dark-text); padding:12px 14px; border-radius:10px; font-size:.9rem; }

/* ---------- verdict banner (Yes / No / Draw) ---------- */
.verdict { border-radius: var(--radius-card); padding: 26px 30px; margin: 0 0 18px; border: 1px solid; }
.verdict-head { font-family: var(--font-heading); font-weight: 600; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.12; }
.verdict-sub { margin-top: 8px; font-size: 1rem; line-height: 1.55; color: var(--color-body-text); }
.verdict.win  { background: var(--good-bg); border-color: rgba(14,159,110,.3); }
.verdict.win  .verdict-head { color: var(--good-fg); }
.verdict.lose { background: var(--bad-bg);  border-color: rgba(220,38,38,.28); }
.verdict.lose .verdict-head { color: var(--bad-fg); }
.verdict.draw { background: rgba(173,186,255,.16); border-color: rgba(173,186,255,.45); }
.verdict.draw .verdict-head { color: var(--color-dark-text); }

/* ---------- educational CTA ---------- */
.cta { background: var(--color-black); color: var(--color-white); border-radius: var(--radius-card); padding:30px 28px; margin:30px 0 0; text-align:center; }
.cta h3 { font-family: var(--font-heading); font-weight:600; font-size:1.4rem; margin:0 0 8px; color: var(--color-white); }
.cta p { margin:0 auto 18px; max-width:52ch; color: var(--color-light-body); font-size:.98rem; }
.cta .btn { display:inline-block; cursor:pointer; border:0; border-radius: var(--radius-pill); padding:14px 34px; background: var(--gradient-cta); color: var(--color-black); font-family: var(--font-body); font-weight:600; font-size:15px; text-decoration:none; transition: opacity .2s; }
.cta .btn:hover { opacity:.85; }

@media (max-width:600px){ .card { padding:22px 20px; } .tool-body { padding:40px 0 70px; } }
