/* FormKit website. Light, clean, mobile first. No web fonts: system fonts load instantly. */
:root {
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-soft: #eef0ff;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e7e9f0;
  --text: #121826;
  --muted: #5f6779;
  --ok: #12b76a;
  --ok-bg: #ecfdf3;
  --warn: #b54708;
  --warn-bg: #fff7e8;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(18, 24, 38, .04), 0 8px 24px rgba(18, 24, 38, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
img, svg, canvas { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); margin: .2em 0 .35em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.12rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: .25em 0; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.brand img { width: 34px; height: 34px; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); line-height: 1.1; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 10px; font-size: .95rem; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }
.nav .lang { border: 1px solid var(--border); }
@media (max-width: 720px) { .nav .hide-sm { display: none; } }

/* Breadcrumbs */
.crumbs { font-size: .85rem; color: var(--muted); padding: 14px 0 0; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: #9aa1b2; }
.crumbs a { color: var(--muted); text-decoration: none; }

/* Hero */
.hero { padding: 10px 0 8px; }
.hero .lead { font-size: 1.08rem; color: var(--muted); max-width: 720px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; padding: 0; list-style: none; }
.badges li { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--muted); }
.badges li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* Layout */
.layout { display: grid; gap: 28px; grid-template-columns: 1fr; padding-bottom: 32px; }
@media (min-width: 980px) { .layout.with-side { grid-template-columns: minmax(0, 1fr) 300px; } }
.content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 22px 20px; }
.content > h2:first-child { margin-top: .8em; }
.side .card { position: sticky; top: 76px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.grid-tools { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 12px 0 8px; }
.tool-link { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.tool-link:hover { border-color: #c9cdf7; box-shadow: var(--shadow); color: var(--text); }
.tool-link .ico { flex: 0 0 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.tool-link strong { display: block; }
.tool-link span { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.ico.c0 { background: #eef0ff; color: #4f46e5; } .ico.c1 { background: #e8f7fe; color: #0a6c9c; }
.ico.c2 { background: #fdedf3; color: #a8194f; } .ico.c3 { background: #e9f9f1; color: #08703f; }
.ico.c4 { background: #fff4e5; color: #8f4c00; } .ico.c5 { background: #f2eeff; color: #6a46f0; }

.exam-list { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.exam-list a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--text); }
.exam-list a:hover { border-color: #c9cdf7; }
.exam-list small { display: block; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f1f2f7; font-weight: 600; }
caption { text-align: left; color: var(--muted); font-size: .85rem; padding: 6px 0; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: 14px; padding: 4px 16px; margin: 0 0 10px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; padding: 10px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }

.note { background: var(--warn-bg); border-radius: 14px; padding: 12px 16px; color: #5c3b00; font-size: .95rem; }
.tip { background: var(--brand-soft); border-radius: 14px; padding: 12px 16px; }

.doc-cards { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 4px 0 6px; }
@media (min-width: 760px) { .doc-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.doc-card { border: 1px solid var(--border); border-radius: 16px; padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.doc-card strong { font-size: .95rem; line-height: 1.3; }
.doc-card span { color: var(--muted); font-size: .82rem; line-height: 1.35; flex: 1; }
.doc-card .fk-btn { min-height: 38px; padding: 8px 10px; font-size: .88rem; margin-top: 6px; }

/* App promo */
.app-promo { display: flex; gap: 16px; align-items: center; background: linear-gradient(135deg, #4f46e5, #6d5df6); color: #fff; border-radius: var(--radius); padding: 18px 20px; margin: 22px 0; }
.app-promo h2, .app-promo h3 { margin: 0 0 4px; color: #fff; }
.app-promo p { margin: 0; opacity: .92; }
.app-promo ul { margin: 6px 0 0; padding-left: 1.1em; opacity: .95; }
.app-promo .fk-btn { background: #fff; color: var(--brand-dark); margin-left: auto; flex: 0 0 auto; }
@media (max-width: 640px) { .app-promo { flex-direction: column; align-items: flex-start; } .app-promo .fk-btn { margin-left: 0; } }

/* Ads: fixed space so pages don't jump when an ad loads */
.ad-slot { margin: 18px 0; min-height: 120px; text-align: center; }
.ad-slot .ad-label { display: block; font-size: .7rem; color: #9aa1b2; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }

/* Footer */
.site-footer { background: #0f1324; color: #c9cfdd; margin-top: 40px; padding: 34px 0 24px; font-size: .92rem; }
.site-footer a { color: #e6e9f2; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.foot-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h2 { font-size: .95rem; color: #fff; margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer .legal { border-top: 1px solid #262c45; margin-top: 24px; padding-top: 16px; color: #98a0b5; font-size: .82rem; }

/* ---------------- Tool widget ---------------- */
.tool-area { display: grid; gap: 14px; margin: 8px 0 6px; }
/* Space for the tool before JS fills it, so text below doesn't jump (CLS). Height set per page by build.py. */
[data-tool]:empty { min-height: var(--h-sm, 700px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
@media (min-width: 640px) { [data-tool]:empty { min-height: var(--h-lg, 600px); } }
.fk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.fk-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fk-card-head h2 { margin: 0; font-size: 1.05rem; }
.fk-summary { margin: 0; color: var(--brand-dark); font-weight: 600; font-size: .95rem; }
.fk-error-text { color: #d92d20; }
.fk-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.fk-field { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.fk-field input, .fk-field select {
  font: inherit; font-size: 1rem; color: var(--text); padding: 10px 12px; border: 1px solid #d0d4de; border-radius: 12px; background: #fff; width: 100%;
}
.fk-field input:focus, .fk-field select:focus { outline: 2px solid #c7c3fb; border-color: var(--brand); }
.fk-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; }
.fk-switch input { width: 20px; height: 20px; accent-color: var(--brand); }
.fk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fk-chip { font: inherit; font-size: .85rem; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--text); }
.fk-chip:hover, .fk-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fk-drop { border: 2px dashed #c7cbe0; border-radius: 16px; padding: 28px 16px; text-align: center; cursor: pointer; display: grid; gap: 4px; background: #fafbff; }
.fk-drop strong { color: var(--brand-dark); font-size: 1.05rem; }
.fk-drop span { color: var(--muted); font-size: .9rem; }
.fk-drop.over, .fk-drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.fk-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fk-btn {
  font: inherit; font-weight: 600; font-size: .98rem; border: 0; border-radius: 14px; padding: 12px 18px; cursor: pointer;
  background: var(--brand); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px;
}
.fk-btn:hover { background: var(--brand-dark); color: #fff; }
.fk-btn:disabled { opacity: .5; cursor: not-allowed; }
.fk-btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.fk-btn-soft:hover { background: #e0e3ff; color: var(--brand-dark); }
.fk-btn-text { background: transparent; color: var(--brand); padding: 10px 8px; min-height: 40px; }
.fk-btn-text:hover { background: var(--brand-soft); color: var(--brand-dark); }
.fk-wide { width: 100%; }
.fk-note { margin: 0; color: var(--muted); font-size: .85rem; }
.fk-center { text-align: center; }
.fk-crop-wrap { display: flex; justify-content: center; }
.fk-crop { border-radius: 12px; touch-action: none; cursor: grab; background: #eef0f5; }
.fk-crop:active { cursor: grabbing; }
.fk-result { gap: 12px; }
.fk-preview { background: #eef0f5; border-radius: 14px; padding: 18px; display: flex; justify-content: center; }
.fk-preview img { max-height: 320px; width: auto; height: auto; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); border-radius: 4px; background: #fff; }
.fk-status { margin: 0; font-weight: 700; border-radius: 12px; padding: 8px 12px; }
.fk-status.ok { background: var(--ok-bg); color: #05603a; }
.fk-status.ok::before { content: "✓ "; }
.fk-status.warn { background: var(--warn-bg); color: var(--warn); }
.fk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.fk-stats div { background: #f1f2f7; border-radius: 12px; padding: 8px 10px; }
.fk-stats dt { font-size: .75rem; color: var(--muted); }
.fk-stats dd { margin: 0; font-weight: 700; font-size: .95rem; }
.fk-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fk-file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 10px; margin: 0; }
.fk-file-kind { font-size: .7rem; font-weight: 800; background: var(--brand-soft); color: var(--brand-dark); border-radius: 6px; padding: 3px 6px; }
.fk-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.fk-icon { font: inherit; font-size: 1.1rem; width: 38px; height: 38px; border: 0; border-radius: 10px; background: #f1f2f7; cursor: pointer; }
.fk-appbox { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px dashed #c9cdf7; border-radius: var(--radius); padding: 12px 14px; }
.fk-appbox-text { flex: 1; display: grid; font-size: .9rem; color: var(--muted); line-height: 1.4; }
.fk-appbox-text strong { color: var(--text); font-size: .95rem; }
.fk-btn-app { padding: 10px 14px; min-height: 40px; font-size: .9rem; }
.fk-dialog { border: 0; border-radius: 20px; padding: 18px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.fk-dialog::backdrop { background: rgba(15, 19, 36, .5); }
.fk-dialog h3 { margin: 0 0 4px; }
.fk-dialog .fk-row { margin-top: 10px; }
.fk-pad { width: 100%; height: 220px; border: 1px solid var(--border); border-radius: 14px; touch-action: none; background: #fff; display: block; }
.fk-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.fk-dot.on { box-shadow: 0 0 0 3px #c7c3fb; }
.fk-toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: #121826; color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; transition: .25s; z-index: 50; max-width: 92vw; }
.fk-toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { background: var(--warn-bg); padding: 12px 16px; border-radius: 12px; }
