/* mica.digital — sober navy/slate financial-services UI */
:root {
  --navy: #0f2744;
  --navy-2: #163a5f;
  --slate: #334155;
  --slate-2: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --accent: #1d4ed8;
  --accent-hover: #1e3a8a;
  --warn-bg: #fef3c7;
  --warn-border: #f59e0b;
  --warn-text: #92400e;
  --danger-bg: #fef2f2;
  --danger-border: #ef4444;
  --danger-text: #991b1b;
  --ok-bg: #ecfdf5;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 39, 68, 0.06), 0 4px 12px rgba(15, 39, 68, 0.04);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
code, .lei, .mono { font-family: var(--mono); font-size: 0.92em; }
.wrap { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; }
.site-main { flex: 1; padding: 1.5rem 0 3rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header { background: var(--navy); color: #fff; }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1.5rem; padding: 0.85rem 0;
}
.brand {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em;
}
.brand:hover { color: #e2e8f0; }
.brand-dot { color: #94a3b8; }
.brand-tld { font-weight: 500; color: #cbd5e1; }
.nav { display: flex; flex-wrap: wrap; gap: 0.15rem 0.85rem; }
.nav a {
  color: #cbd5e1; text-decoration: none; font-size: 0.92rem; padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active { color: #fff; border-bottom-color: #93c5fd; }

.disclaimer-bar {
  background: #0b1c31; color: #94a3b8; font-size: 0.75rem; line-height: 1.4;
  padding: 0.45rem 0; border-top: 1px solid rgba(255,255,255,0.06);
}
.site-footer .disclaimer-bar { border-top: 0; border-bottom: 1px solid rgba(255,255,255,0.06); }

/* Hero / cards */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 2.25rem 0 2rem; margin: -1.5rem 0 1.75rem;
}
.hero h1 { margin: 0 0 0.5rem; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.hero p { margin: 0 0 1.25rem; color: #cbd5e1; max-width: 40rem; }
.hero a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.hero a:hover { color: #fef08a; }
.hero .search-form input { border: 0; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem; margin-top: 1.25rem;
}
.stat {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius); padding: 0.75rem 0.9rem;
}
.stat .num { font-size: 1.4rem; font-weight: 700; display: block; }
.stat .lbl { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.35rem; margin-bottom: 1rem;
}
.card h1, .card h2 { margin-top: 0; }
.grid-2 {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1fr 280px; align-items: start; }
  .grid-tools { grid-template-columns: repeat(2, 1fr); }
}
.grid-tools {
  display: grid; grid-template-columns: 1fr; gap: 0.85rem; margin: 1.25rem 0;
}
.tool-card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-card:hover { border-color: #93c5fd; box-shadow: 0 4px 16px rgba(30,74,122,0.1); color: inherit; }
.tool-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; color: var(--navy); }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Search */
.search-form {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.search-form input[type="search"] {
  flex: 1; min-width: 200px; padding: 0.7rem 0.9rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 1rem; background: #fff; color: var(--navy);
}
.search-form input:focus { outline: 2px solid #93c5fd; outline-offset: 1px; border-color: #60a5fa; }
.search-form button, .btn {
  appearance: none; border: 0; background: var(--accent); color: #fff;
  padding: 0.7rem 1.15rem; border-radius: var(--radius); font-size: 0.95rem;
  font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
}
.search-form button:hover, .btn:hover { background: var(--accent-hover); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.chip {
  display: inline-block; padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--slate); font-size: 0.85rem;
  text-decoration: none;
}
.chip:hover, .chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Tables / lists */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
}
table.data th, table.data td {
  text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top;
}
table.data th {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600; background: #f1f5f9;
}
table.data tr:hover td { background: #f8fafc; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li {
  border-bottom: 1px solid var(--line); padding: 0.85rem 0;
}
.result-list li:last-child { border-bottom: 0; }
.result-list a.title { font-weight: 600; text-decoration: none; color: var(--navy); font-size: 1.02rem; }
.result-list a.title:hover { color: var(--accent); }
.meta-row { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 0.15rem 0.45rem; border-radius: 4px;
  background: #e2e8f0; color: var(--slate);
}
.badge-svc { background: #dbeafe; color: #1e3a8a; }
.badge-type { background: #ede9fe; color: #5b21b6; }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }

/* Detail */
.dl-grid {
  display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 0.55rem 1rem;
  margin: 0;
}
.dl-grid dt { color: var(--muted); font-size: 0.85rem; margin: 0; }
.dl-grid dd { margin: 0; }
.svc-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.svc-list li {
  padding: 0.4rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 0.65rem;
}
.svc-list .code {
  font-family: var(--mono); font-weight: 700; color: var(--accent);
  min-width: 1.25rem;
}
.passport-list {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem;
}
.passport-list span {
  background: #f1f5f9; border: 1px solid var(--line); border-radius: 4px;
  padding: 0.2rem 0.45rem; font-size: 0.8rem;
}

/* Warning / NCASP */
.warn, .alert-warn {
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text);
  border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem;
}
.alert-danger {
  background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-text);
  border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem;
}
.domain-plain {
  font-family: var(--mono); font-size: 0.9rem; background: #fff;
  border: 1px dashed var(--danger-border); border-radius: 4px;
  padding: 0.35rem 0.55rem; display: inline-block; margin: 0.2rem 0.25rem 0.2rem 0;
  color: var(--danger-text); word-break: break-all;
}
.note-box {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius);
  padding: 0.85rem 1rem; margin: 1rem 0; font-size: 0.92rem; color: var(--navy-2);
}

/* Sidebar / ads */
.sidebar-card {
  background: #f1f5f9; border: 1px dashed #94a3b8; border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1rem;
}
.sidebar-card h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.ad-slot {
  min-height: 100px; margin: 1.25rem 0; padding: 0.5rem 0.35rem 0.75rem;
  border: 1px solid #e2e8f0; border-radius: var(--radius); background: #f8fafc;
  text-align: center; overflow: hidden;
}
.ad-slot .ad-label {
  display: block; font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: #94a3b8; margin-bottom: 0.35rem;
}
.ad-slot--footer { margin: 1.5rem 0 0.5rem; }
.ad-slot--home-top, .ad-slot--home-mid { max-width: 100%; }


/* Pagination */
.pager {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin-top: 1.25rem; font-size: 0.9rem;
}
.pager a, .pager span {
  padding: 0.35rem 0.65rem; border: 1px solid var(--line); border-radius: 4px;
  text-decoration: none; color: var(--slate); background: #fff;
}
.pager a:hover { border-color: #93c5fd; color: var(--accent); }
.pager .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Docs / glossary */
.doc-list, .glossary-list { list-style: none; margin: 0; padding: 0; }
.doc-list li, .glossary-list > li {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.15rem; margin-bottom: 0.75rem; box-shadow: var(--shadow);
}
.doc-list h3, .glossary-list h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.doc-list p, .glossary-list p { margin: 0; color: var(--slate-2); font-size: 0.92rem; }
.glossary-list h3 { scroll-margin-top: 1rem; }

/* Footer */
.site-footer { background: var(--navy); color: #cbd5e1; margin-top: auto; }
.footer-inner { padding: 1.75rem 0 1.25rem; }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem; margin-bottom: 1.25rem;
}
.footer-links { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.footer-links li { margin: 0.25rem 0; }
.site-footer a { color: #e0f2fe; }
.site-footer a:hover { color: #fff; }
.footer-links a { color: #e0f2fe; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; color: #fff; }
.footer-copy { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1rem; margin: 0; }

.page-title { margin: 0 0 0.35rem; font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
.page-lead { margin: 0 0 1.25rem; color: var(--muted); max-width: 42rem; }
.empty { color: var(--muted); padding: 1rem 0; }

/* Authorisation guide */
.toc { margin: 1rem 0 1.5rem; padding: 1rem 1.25rem; }
.toc ol { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.toc li { margin: 0.25rem 0; }
.guide-section { margin: 2rem 0; }
.guide-section h2 { color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.guide-section h3 { margin-top: 1.25rem; }
.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.path-card h3 { margin-top: 0; font-size: 1.05rem; }
.steps { padding-left: 1.25rem; }
.steps > li { margin: 1rem 0; }
.steps h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.pitfall-list { padding-left: 1.1rem; }
.pitfall-list li { margin: 0.65rem 0; }
.doc-list.compact { list-style: disc; padding-left: 1.2rem; }
.doc-list.compact li { margin: 0.45rem 0; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); }
table.data th, table.data td { border: 1px solid var(--line); padding: 0.55rem 0.75rem; text-align: left; vertical-align: top; }
table.data th { background: var(--navy); color: #fff; }
.callout { padding: 1.25rem; }

/* Glossary tips */
.gloss {
  position: relative;
  display: inline;
  border-bottom: 1px dotted #64748b;
  text-decoration: none;
  cursor: help;
  color: inherit;
}
.gloss .gloss-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 0;
}
.gloss:hover .gloss-link,
.gloss:focus .gloss-link,
.gloss:focus-within .gloss-link {
  color: var(--accent);
}
.gloss:focus,
.gloss:focus-within {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 2px;
}
.gloss::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%) translateY(4px);
  width: min(22rem, 70vw);
  padding: 0.55rem 0.7rem;
  background: #0b1c31;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: normal;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 39, 68, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  z-index: 40;
  text-align: left;
  white-space: normal;
}
.gloss::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.15rem);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0b1c31;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s;
  z-index: 41;
}
.gloss:hover::after,
.gloss:focus::after,
.gloss:focus-within::after,
.gloss:hover::before,
.gloss:focus::before,
.gloss:focus-within::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 640px) {
  .gloss::after {
    left: 0;
    transform: translateX(0) translateY(4px);
    width: min(18rem, calc(100vw - 2rem));
  }
  .gloss:hover::after,
  .gloss:focus::after,
  .gloss:focus-within::after {
    transform: translateX(0) translateY(0);
  }
  .gloss::before { left: 1rem; }
}

/* Homepage key terms */
.key-terms {
  margin: 0 0 1.15rem;
  padding: 0.75rem 0.9rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
}
.key-terms-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.45rem;
  font-weight: 600;
}
.key-terms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  align-items: center;
}
.key-terms .gloss {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
  font-size: 0.85rem;
  border-bottom: 0;
}
.key-terms .gloss .gloss-link { color: #e2e8f0; }
.key-terms .gloss:hover,
.key-terms .gloss:focus-within {
  background: rgba(255,255,255,0.18);
  outline-color: #93c5fd;
}
.key-terms-more {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.55);
  color: #fff;
  font-weight: 600;
}
.key-terms-more:hover { background: rgba(255,255,255,0.22); color: #fff; border-color: #fff; }

/* Diagnostic wizard */
.diag-form fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  margin: 0 0 1rem;
}
.diag-form legend {
  font-weight: 700;
  padding: 0 0.35rem;
  color: var(--navy);
}
.diag-option {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  cursor: pointer;
}
.diag-option input { margin-top: 0.25rem; }
.diag-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.65rem 0;
}
.diag-field input,
.diag-field select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  max-width: 28rem;
}
.diag-svc-grid { display: grid; gap: 0.25rem; }
.diag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}
.diag-checklist { list-style: none; margin: 1rem 0 0; padding: 0; counter-reset: diag; }
.diag-checklist > li {
  counter-increment: diag;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}
.diag-checklist > li h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.diag-checklist > li h3::before {
  content: counter(diag) ". ";
  color: var(--accent);
}
.diag-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0 0.75rem;
  align-items: center;
}
.inline-form { display: inline; }
.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  background: #f1f5f9;
  color: var(--navy);
  border-color: #93c5fd;
}


/* GRT Consulting marketing */
.brand-block { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.brand-byline { margin: 0; font-size: 0.72rem; line-height: 1.35; color: #e2e8f0; max-width: 18rem; }
.brand-byline a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1.5px; }
.brand-byline a:hover { color: #fef08a; }
.card-grt { border-color: #93c5fd; background: linear-gradient(180deg, #f0f9ff 0%, #fff 55%); }
.grt-cta { margin: 1rem 0; }
.btn-grt {
  display: inline-block; padding: 0.55rem 1rem; border-radius: 6px;
  background: #1e3a5f; color: #fff !important; text-decoration: none; font-weight: 600;
}
.btn-grt:hover { background: #0f2744; }
@media (max-width: 900px) {
  .brand-byline { max-width: none; font-size: 0.7rem; }
}


/* Authorisation promo + UK */
.auth-promo { border-color: #93c5fd; background: linear-gradient(180deg, #f8fbff 0%, #fff 40%); }
.auth-promo-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin: 1rem 0 1.25rem; }
@media (min-width: 800px) { .auth-promo-grid { grid-template-columns: 1fr 1fr; } }
.benefit-list { margin: 0.5rem 0 0; padding-left: 1.15rem; }
.benefit-list li { margin: 0.45rem 0; }
.benefit-list-lg li { margin: 0.55rem 0; }
.uk-divide { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid #fcd34d; border-radius: 8px; background: #fffbeb; }
.uk-divide h3 { margin-top: 0; }
.auth-cta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.85rem; }
.btn-primary, .btn-secondary, .btn-uk {
  display: inline-block; padding: 0.5rem 0.9rem; border-radius: 6px; font-weight: 600; text-decoration: none; font-size: 0.92rem;
}
.btn-primary { background: #1e3a5f; color: #fff !important; }
.btn-primary:hover { background: #0f2744; }
.btn-secondary { background: #e2e8f0; color: #0f172a !important; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-uk { background: #9a3412; color: #fff !important; border: none; cursor: pointer; }
.btn-uk:hover { background: #7c2d12; }
.tool-card-featured { border-color: #60a5fa; box-shadow: 0 2px 12px rgba(30,74,122,0.08); }
.tool-card-uk { border-color: #fdba74; }
.card-inner { margin-top: 0.5rem; }
.diag-form label { display: block; margin: 0.65rem 0; }
.diag-form fieldset { border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.75rem 1rem; margin: 0.85rem 0; }
.diag-form legend { font-weight: 600; padding: 0 0.35rem; }
.diag-form input[type=text] { width: 100%; max-width: 28rem; padding: 0.45rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 6px; }
.diag-form fieldset label { display: inline-block; margin-right: 1rem; font-weight: 400; }
