/* The 2.0 "night shift" look for the free-tool widgets on their tool pages
 * (/resources/tools/<slug>/, src/pages/resources/tools/ToolPage.jsx).
 *
 * Every tool widget links this file, but every rule needs html.embed-page,
 * which the widget sets only when it is framed with ?embed=page. Blog posts
 * embed the widgets without the parameter, so they keep their own look.
 *
 * Colours are the night.css tokens: a white panel, the inputs in a light
 * grey box with 2.0 fields, the result in a dark lobby-green tile with mint
 * figures (like the "Will it pay for itself?" calculator on /pricing/). The
 * widgets' own CSS variables carry most of it; the result tile re-maps them
 * to the dark set. Always light, whatever the visitor's colour scheme, since
 * the page around it is. The widget's own audit box is hidden: the page has
 * Book a demo under it.
 *
 * Neue Montreal: the font files are hashed build assets, so the page injects
 * the @font-face into the frame (useWidgetFrames, css option). Until then the
 * text falls back to Lato or the system sans. */

html:root.embed-page {
  --bg: #FFFFFF; --card: #F7F9F7; --card-soft: #EEF3F0;
  --ink: #0E1A16; --ink-70: #4F5F58; --ink-50: #6B7A73; --rule: #DCE3DE; --field: #FFFFFF;
  --green: #0C281F; --green-tint: #1F6B55; --green-hover: #12392E;
  --accent-text: #1F6B55;
  --bar-a: #1F6B55; --bar-b: #6FBFAE; --bar-track: #E6EBE8;
  --bar-spill: #1F6B55; --bar-spoil: #6FBFAE; --row-hi: #DDF4F2;
  --ok: #1F6B55; --ok-soft: #DDF4F2; --warn: #7A5200; --warn-soft: #FDF1D8;
  --bad: #B4232C; --bad-soft: #FDECEC; --none: #4F5F58; --none-soft: #EEF3F0;
  --focus: rgba(242, 180, 65, 0.75); --note: #145647; --invalid: #8E1A22;
  --shadow: none; --btn-text: #F3F7F5;
  --ill-bg: #FFFFFF; --ill-line: #DCE3DE; --ill-fill: #EEF3F0; --ill-text: #6B7A73;
  --ill-hi: #1F6B55; --ill-hi-soft: rgba(31, 107, 85, 0.1);
  color-scheme: light;
}
html.embed-page, html.embed-page body { background: #FFFFFF; }
html.embed-page body {
  color: var(--ink-70);
  font-family: 'NeueMontreal', 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* One family throughout: no Fraunces or DM Sans in the 2.0 look. */
html.embed-page body *:not(code):not(pre) { font-family: inherit !important; }

/* The panel's padding is the widget's own. */
html.embed-page body > main { max-width: none; padding: 32px 32px 28px; }
@media (max-width: 559px) {
  html.embed-page body > main { padding: 20px 16px 22px; }
}

/* Headings, labels, figures: Neue Montreal at 600. */
html.embed-page main h2, html.embed-page main h3 { font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
html.embed-page :is(.t-label, .t-eyebrow, .lr-eyebrow, .gc-eyebrow, .bx-eyebrow, .bx-label) {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; color: var(--accent-text);
}
html.embed-page :is(.o-number, .lr-number, .gc-number, .t-verdict-word) { font-weight: 600; letter-spacing: -0.04em; }
html.embed-page :is(.r-headline, .s-headline) { font-weight: 600; letter-spacing: -0.025em; }
html.embed-page :is(.t-stat, .gc-stat, .o-pocket) b { font-weight: 600; letter-spacing: -0.03em; }
html.embed-page :is(.t-empty, .lr-empty, .gc-empty) strong { font-weight: 600; letter-spacing: -0.02em; }

/* Inputs: a light grey box with white 2.0 fields. */
html.embed-page :is(.t-inputs, .lr-inputs, .gc-inputs) { background: var(--card); border: 1px solid #E6EBE8; border-radius: 24px; }
@media (min-width: 480px) {
  html.embed-page :is(.t-inputs, .lr-inputs, .gc-inputs) { padding: 30px 32px 34px; }
}
html.embed-page :is(.t-field, .lr-field, .gc-field) label { font-size: 15.5px; }
html.embed-page :is(.t-control, .lr-control, .gc-control) {
  min-height: 50px; border: 1px solid var(--rule); border-radius: 12px; background: #FFFFFF;
}
html.embed-page :is(.t-control, .lr-control, .gc-control) select { border-right-width: 1px; }
html.embed-page :is(.t-control, .lr-control, .gc-control):focus-within {
  border-color: transparent; box-shadow: none; outline: 3px solid #F2B441; outline-offset: 1px;
}
html.embed-page :is(.t-control, .lr-control, .gc-control).is-invalid { border-color: var(--invalid); }
html.embed-page input[type="range"] { accent-color: var(--green-tint); }

/* Cards: 2.0 corners, no drop shadows. */
html.embed-page :is(.t-card, .lr-card, .gc-card, .bx-card) { border-radius: 24px; box-shadow: none; }
html.embed-page :is(.t-card, .lr-card, .gc-card).is-empty { background: #FFFFFF; border: 1.5px dashed var(--rule); }

/* The result, once there is one: a dark tile with mint figures. The widget's
 * variables switch to the dark set inside it. */
html.embed-page :is(.t-side, .lr-side, .gc-side, .bx-side) > :is(.t-card, .lr-card, .gc-card, .bx-card):not(.is-empty):not(.is-muted) {
  /* --card is also the cut-out colour inside the verdict icons. */
  --card: #0C281F; --card-soft: rgba(243, 247, 245, 0.07);
  --ink: #F3F7F5; --ink-70: #C4CFCA; --ink-50: #8FA39B; --rule: rgba(171, 232, 229, 0.18); --field: #0A1D17;
  --green: #ABE8E5; --green-tint: #ABE8E5; --green-hover: #C8F2F0;
  --accent-text: #ABE8E5;
  --bar-a: #ABE8E5; --bar-b: #4E9C86; --bar-track: rgba(243, 247, 245, 0.1);
  --bar-spill: #ABE8E5; --bar-spoil: #4E9C86; --row-hi: rgba(171, 232, 229, 0.12);
  --ok: #ABE8E5; --ok-soft: rgba(171, 232, 229, 0.14); --warn: #F2B441; --warn-soft: rgba(242, 180, 65, 0.14);
  --bad: #F59A9A; --bad-soft: rgba(180, 35, 44, 0.24); --none: #C4CFCA; --none-soft: rgba(243, 247, 245, 0.08);
  --note: #ABE8E5; --invalid: #F2B441;
  --ill-bg: #0A1D17; --ill-line: rgba(171, 232, 229, 0.22); --ill-fill: rgba(243, 247, 245, 0.08); --ill-text: #8FA39B;
  --ill-hi: #ABE8E5; --ill-hi-soft: rgba(171, 232, 229, 0.14);
  color-scheme: dark;
  color: var(--ink-70);
  background: radial-gradient(ellipse 90% 120% at 85% 0%, #22624D 0%, #12392E 45%, #0C281F 100%);
  border-color: transparent;
}

/* Buttons: dark pills on white, mint ones on the dark tile. */
html.embed-page :is(.t-btn, .lr-btn, .gc-btn, .bx-btn) {
  min-height: 50px; padding: 0 26px; border: 0; border-radius: 999px;
  background: #0C281F; color: #F3F7F5 !important; box-shadow: none;
  font-size: 16px; font-weight: 600; transition: background 0.18s;
}
html.embed-page :is(.t-btn, .lr-btn, .gc-btn, .bx-btn):hover { background: #12392E; transform: none; }
html.embed-page :is(.t-btn, .lr-btn, .gc-btn, .bx-btn):disabled { opacity: 0.4; cursor: not-allowed; }
html.embed-page :is(.t-side, .lr-side, .gc-side, .bx-side) > :not(.is-empty):not(.is-muted) :is(.t-btn, .lr-btn, .gc-btn, .bx-btn) {
  background: #ABE8E5; color: #06231B !important;
}
html.embed-page :is(.t-side, .lr-side, .gc-side, .bx-side) > :not(.is-empty):not(.is-muted) :is(.t-btn, .lr-btn, .gc-btn, .bx-btn):hover { background: #C8F2F0; }
html.embed-page :is(.t-link, .lr-link, .gc-link) { color: var(--accent-text); }

/* The page carries the call to action (Book a demo), so the widget's own
 * revenue-audit box is hidden here. */
html.embed-page :is(.t-gate, .lr-gate, .gc-gate, .bx-gate) { display: none !important; }

html.embed-page :is(.t-foot, .lr-foot, .gc-foot, .bx-foot) { color: var(--ink-50); }
