/* UK Deadline Checker — shared styles */
:root {
  --ink: #14212b;
  --ink-soft: #46555f;
  --bg: #f7f6f2;
  --card: #ffffff;
  --line: #e2dfd6;
  --brand: #0f5c4a;
  --brand-dark: #0a4537;
  --brand-tint: #e5f1ec;
  --accent: #f2b234;
  --warn-bg: #fff6e0;
  --warn-line: #f2d48a;
  --ok-bg: #e8f5ee;
  --ok-line: #9fd2b6;
  --no-bg: #eef1f4;
  --no-line: #c8d1d9;
  --radius: 12px;
  --max: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--ink); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.logo:hover { color: #fff; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.site-nav a { color: #cfd8de; text-decoration: none; font-size: 15px; margin-left: 16px; }
.site-nav a:hover { color: #fff; }

/* Breadcrumb */
.crumbs { font-size: 14px; color: var(--ink-soft); padding-top: 18px; }
.crumbs a { color: var(--ink-soft); }

/* Headings & text */
h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 14px 0 10px; }
h2 { font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; margin: 40px 0 12px; }
h3 { font-size: 19px; margin: 24px 0 8px; }
.lede { font-size: 19px; color: var(--ink-soft); margin: 0 0 22px; }
.updated { font-size: 14px; color: var(--ink-soft); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.tool { margin: 22px 0 8px; box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 8px 24px -16px rgba(20,33,43,.25); }

/* Form */
.q { border: 0; padding: 0; margin: 0 0 22px; }
.q legend, .q > label.qlabel { font-weight: 700; font-size: 17px; margin-bottom: 4px; display: block; padding: 0; }
.hint { font-size: 15px; color: var(--ink-soft); margin: 0 0 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 16px; transition: border-color .15s, background .15s; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.money { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.money:focus-within { border-color: var(--brand); outline: 3px solid var(--brand-tint); }
.money b { padding: 0 0 0 12px; color: var(--ink-soft); font-weight: 600; }
.money input { border: 0; outline: 0; padding: 11px 12px 11px 6px; font: inherit; width: 100%; min-width: 0; background: transparent; }
.year-block { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.year-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.year-title { font-weight: 700; font-size: 16px; margin: 0 0 2px; }
.year-note { font-size: 14px; color: var(--ink-soft); margin: 0 0 10px; }

.btn { display: inline-block; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; padding: 13px 22px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand-dark); }
.error { color: #a23b1d; font-size: 15px; margin: 10px 0 0; min-height: 1em; }

/* Result */
.result { margin-top: 22px; border-radius: var(--radius); padding: 20px; border: 1.5px solid var(--no-line); background: var(--no-bg); }
.result[hidden] { display: none; }
.result.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.result.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.result h3 { margin-top: 0; font-size: 21px; }
.result p { margin: 8px 0; }
.result .big { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 4px 0 10px; }
.timeline { list-style: none; padding: 0; margin: 12px 0 4px; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(20,33,43,.1); font-size: 16px; }
.timeline li:first-child { border-top: 0; }
.timeline .d { flex: 0 0 132px; font-weight: 700; }
.timeline .past { color: var(--ink-soft); text-decoration: line-through; }
.timeline .next .d::after { content: "Next"; display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--accent); color: var(--ink); border-radius: 4px; padding: 1px 5px; vertical-align: 2px; }
.tally { font-size: 15px; color: var(--ink-soft); }

/* Callouts */
.note { font-size: 15px; color: var(--ink-soft); border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 16px 0; }
.cta-box { margin: 18px 0 0; padding: 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.cta-box p { margin: 0 0 10px; }

/* Reminder form */
.remind { margin-top: 36px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px; }
.remind h2 { margin-top: 0; color: #fff; font-size: 22px; }
.remind p { color: #cfd8de; margin-top: 0; }
.remind form { display: flex; flex-wrap: wrap; gap: 10px; }
.remind input[type=email] { flex: 1 1 220px; border: 0; border-radius: 10px; padding: 13px 14px; font: inherit; }
.remind .btn { background: var(--accent); color: var(--ink); }
.remind .btn:hover { background: #ffc84f; color: var(--ink); }
.remind small { display: block; margin-top: 10px; color: #9fb0bb; font-size: 13px; }
.hp { position: absolute; left: -9999px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 16px; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--brand-tint); border-top: 0; font-size: 15px; }

/* FAQ */
details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--brand); font-weight: 800; }
details[open] summary::after { content: "–"; }
details > div { padding-bottom: 14px; }
details p:first-child { margin-top: 0; }

/* Home tool grid */
.section-label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--brand); margin: 34px 0 10px; }
.tool-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-link { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
a.tool-link:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-1px); }
.tool-link strong { display: block; font-size: 17px; margin-bottom: 4px; }
.tool-link span { font-size: 15px; color: var(--ink-soft); }
.tool-link.soon { opacity: .6; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; padding: 2px 6px; margin-bottom: 6px; background: var(--brand-tint); color: var(--brand-dark); }
.tag.soon { background: #ece9e0; color: var(--ink-soft); }

/* Ad slot placeholder (remove border once AdSense is live) */
.ad-slot { margin: 28px 0; min-height: 0; }

/* Footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 14px; color: var(--ink-soft); }
.site-footer a { color: var(--ink-soft); margin-right: 14px; }
.site-footer p { margin: 8px 0; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .money-grid, .tool-list { grid-template-columns: 1fr; }
  .site-nav a:not(:last-child) { display: none; }
  .timeline .d { flex-basis: 112px; }
  .card { padding: 18px; }
}

/* ---------- v2 usability additions ---------- */
.skip { position: absolute; left: 16px; top: -60px; background: var(--accent); color: var(--ink); padding: 10px 14px; border-radius: 8px; font-weight: 700; z-index: 10; text-decoration: none; }
.skip:focus { top: 10px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.quick { background: var(--brand-tint); border-radius: var(--radius); padding: 16px 18px; margin: 4px 0 8px; }
.quick-title { margin: 0 0 6px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dark); }
.quick ul { margin: 0; padding-left: 20px; }
.quick li { margin: 3px 0; }
.quick-foot { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); }

.tool { scroll-margin-top: 12px; }
.tool:focus { outline: none; }
.tool-title { margin-top: 0; font-size: 21px; }
.q legend { display: flex; align-items: center; gap: 10px; }
.step { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; display: grid; place-items: center; }
.choice span { min-height: 44px; display: inline-flex; align-items: center; }
.choice span:hover { border-color: var(--brand); }

.year-row { display: grid; grid-template-columns: 1fr 200px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.year-row:first-of-type { border-top: 0; }
.year-row label strong { display: block; font-size: 17px; }
.year-row label small { display: block; font-size: 14px; color: var(--ink-soft); }
.money input { font-size: 17px; }
.btn-big { width: 100%; margin-top: 16px; padding: 15px 22px; font-size: 18px; }
.btn-link { background: none; color: var(--ink-soft); text-decoration: underline; padding-left: 6px; padding-right: 6px; }
.btn-link:hover { background: none; color: var(--ink); }

.result { scroll-margin-top: 12px; }
.result:focus { outline: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }
.actions .btn { padding: 12px 18px; }

/* Home */
.feature { display: block; background: var(--card); border: 1.5px solid var(--brand); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); margin: 6px 0 0; box-shadow: 0 8px 24px -16px rgba(20,33,43,.35); transition: transform .15s; }
.feature:hover { color: var(--ink); transform: translateY(-1px); }
.feature strong { display: block; font-size: 22px; margin: 4px 0 6px; letter-spacing: -0.01em; }
.feature p { margin: 0 0 14px; color: var(--ink-soft); }
.feature .btn { pointer-events: none; }
.dates { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.dates li { display: flex; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.dates li:first-child { border-top: 0; }
.dates .when { flex: 0 0 96px; font-weight: 800; line-height: 1.25; }
.dates .when small { display: block; font-weight: 600; color: var(--ink-soft); font-size: 13px; }
.dates .what small { display: block; color: var(--ink-soft); font-size: 14px; }
.soon-line { color: var(--ink-soft); font-size: 15px; }

@media (max-width: 560px) {
  .year-row { grid-template-columns: 1fr; gap: 6px; }
  .actions .btn { flex: 1 1 100%; text-align: center; }
  .btn-link { flex: 1 1 100%; }
}

@media print {
  .site-header, .site-footer, .skip, .quick, #mtd, .actions, .cta-box, .remind, .ad-slot, details, .crumbs { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .card, .result { border: 1px solid #999; box-shadow: none; }
}

/* Contact form */
.contact-form { margin: 18px 0 10px; }
.cf-field { margin-bottom: 16px; }
.cf-field label { display: block; font-weight: 700; margin-bottom: 5px; }
.cf-field input, .cf-field select, .cf-field textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint); }
.cf-field textarea { resize: vertical; min-height: 140px; }
.cf-field small { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.contact-form .btn-big { margin-top: 4px; }

/* ---------- v3: shared tool elements ---------- */
.date-in { font: inherit; font-size: 17px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: 46px; width: 100%; max-width: 240px; }
.date-in:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint); }
.date-in:disabled { opacity: .5; }
.tick { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; margin: 10px 0 0; cursor: pointer; }
.tick input { width: 20px; height: 20px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--brand); }
.ticks .tick { margin-top: 8px; }
select { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: 46px; }

.cert-row { padding: 16px 0; border-top: 1px solid var(--line); }
.cert-row:first-of-type { border-top: 0; padding-top: 0; }
.cert-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.cert-head small { display: block; font-size: 14px; color: var(--ink-soft); }
.cert-icon { font-size: 22px; line-height: 1.2; flex: 0 0 28px; text-align: center; }
.interval { margin-top: 12px; }
.interval label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.interval small { display: block; font-size: 14px; color: var(--ink-soft); margin-top: 4px; }

.cert-list { list-style: none; padding: 0; margin: 14px 0; }
.cert-out { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--ok-line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.cert-out.soon { border-left-color: var(--accent); }
.cert-out.overdue { border-left-color: #c2410c; }
.cert-out p { margin: 0; }
.co-name { font-weight: 700; }
.co-date { font-size: 20px; font-weight: 800; margin: 2px 0 4px !important; }
.co-date small { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.co-note { font-size: 15px; color: var(--ink-soft); }
.pill { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 4px; vertical-align: 2px; margin-left: 4px; }
.pill.fine { background: var(--ok-bg); color: #14532d; }
.pill.soon { background: var(--accent); color: var(--ink); }
.pill.overdue { background: #c2410c; color: #fff; }

.rating-choices .r { min-width: 48px; justify-content: center; font-weight: 800; color: #fff; border-color: transparent; }
.r.rA { background: #0b7a3b; } .r.rB { background: #1a8f3a; } .r.rC { background: #5a9b1d; }
.r.rD { background: #8a7a00; } .r.rE { background: #b45309; } .r.rF { background: #c2410c; } .r.rG { background: #b91c1c; }
.rating-choices .choice input:checked + .r { outline: 3px solid var(--ink); outline-offset: 2px; color: #fff; background-clip: padding-box; }
.rating-choices .choice input:checked + .r.rA { background: #0b7a3b; } .rating-choices .choice input:checked + .r.rB { background: #1a8f3a; }
.rating-choices .choice input:checked + .r.rC { background: #5a9b1d; } .rating-choices .choice input:checked + .r.rD { background: #8a7a00; }
.rating-choices .choice input:checked + .r.rE { background: #b45309; } .rating-choices .choice input:checked + .r.rF { background: #c2410c; }
.rating-choices .choice input:checked + .r.rG { background: #b91c1c; }

.cap { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.cap p { margin: 4px 0; }
.cap ul { margin: 6px 0; padding-left: 20px; }

.countdown { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 20px; margin: 6px 0 8px; }
.countdown p { margin: 0; }
.cd-label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--accent); }
.cd-days { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 !important; }
.cd-days #cd-unit { font-size: 20px; font-weight: 600; color: #cfd8de; letter-spacing: 0; }
.cd-what { color: #cfd8de; }
.cd-what strong { color: #fff; }
.past-row td { color: var(--ink-soft); }
.past-row strong { text-decoration: line-through; }
td small { color: var(--ink-soft); font-size: 14px; }
.steps-list { padding-left: 22px; margin: 12px 0; }
.steps-list li { margin-bottom: 10px; }

/* Home tool grid (v3) */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-1px); }
.tool-card strong { font-size: 17px; margin: 2px 0 4px; }
.tool-card span.desc { font-size: 15px; color: var(--ink-soft); flex: 1; }
.tool-card .go { margin-top: 10px; font-weight: 700; color: var(--brand); font-size: 15px; }
.tool-card .ico { font-size: 22px; }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } .cd-days { font-size: 38px; } }
.related { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-block; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.related a:hover { border-color: var(--brand); }
.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; }
.feature + .tool-grid { margin-top: 12px; }
#deadlines { scroll-margin-top: 12px; }
.tool + .quick { margin-top: 16px; }
.lede { margin-bottom: 16px; }

/* Day / Month / Year date entry */
.dmy { display: flex; gap: 10px; align-items: flex-start; }
.dmy-f select { height: 50px; }
.dmy-f input { height: 50px; }
.dmy-f label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 3px; }
.dmy-f input, .dmy-f select { font: inherit; font-size: 17px; padding: 10px; min-height: 46px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.dmy-f input { width: 62px; text-align: center; }
.dmy-y input { width: 84px; }
.dmy-m select { width: 104px; }
.dmy-f input:focus, .dmy-f select:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint); }
.dmy-f input:disabled, .dmy-f select:disabled { opacity: .5; }
.dmy-bad input, .dmy-bad select { border-color: #c2410c; }
.dmy-bad::after { content: "Check this date"; align-self: center; color: #c2410c; font-size: 14px; font-weight: 600; }

/* Tighter tool cards */
.tool-card { display: block; }
.tool-card .ico { display: inline-block; font-size: 18px; vertical-align: middle; margin-right: 6px; }
.tool-card .tag { display: inline-block; vertical-align: middle; margin: 0; }
.tool-card strong { display: block; margin: 8px 0 4px; }
.tool-card span.desc { display: block; }
.tool-card .go { display: block; margin-top: 8px; }
@media (max-width: 560px) { .tool-card { padding: 14px 16px; } .tool-card .go { display: none; } .tool-card strong::after { content: " →"; color: var(--brand); } }
