/* 3EGates - shared styles. Mobile first, no external assets. */
:root {
  --ink: #0f1b2d;
  --ink-2: #3b4a5e;
  --ink-3: #6a7789;
  --line: #e3e8ef;
  --bg: #ffffff;
  --bg-2: #f5f7fa;
  --bg-3: #eef2f7;
  --brand: #0b3d5c;
  --brand-2: #0f5a86;
  --accent: #12a38a;
  --accent-ink: #0b6e5d;
  --good: #1f8a4c;  --good-bg: #e7f6ed;
  --info: #1f5fa8;  --info-bg: #e8f0fb;
  --warn: #a8620a;  --warn-bg: #fdf3e2;
  --bad:  #b3261e;  --bad-bg:  #fbeaea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 4px 16px rgba(15,27,45,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 17px; line-height: 1.55; }
img, svg { max-width: 100%; }
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-3); }
.small { font-size: .9rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.nav { display: none; gap: 6px; align-items: center; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav-toggle { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 1rem; cursor: pointer; }
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: 8px 20px 16px; background: #fff; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 12px 4px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--bg-3); font-weight: 500; }
@media (min-width: 860px) { .nav { display: flex; } .nav-toggle { display: none; } .mobile-nav { display: none !important; } }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-good { background: var(--good); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { font-size: .88rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #cdd5df; border-radius: 10px; background: #fff; color: var(--ink); min-height: 48px; }
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 0 0 3px rgba(15,90,134,.15); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .96rem; }
.alert-good { background: var(--good-bg); color: var(--good); }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.captcha { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg-2); }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.captcha-img { background: #f4f6f8; border-radius: 8px; border: 1px solid var(--line); width: 220px; height: 70px; }

/* ---------- public sections ---------- */
.hero { background: linear-gradient(160deg, #0b3d5c 0%, #0f5a86 55%, #12a38a 140%); color: #fff; padding: 72px 0 80px; }
.hero p.lead { font-size: 1.2rem; color: #dbe9f3; max-width: 640px; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.hero-card .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--bg-3); font-size: .98rem; }
.hero-card .row:last-child { border-bottom: none; }
section.block { padding: 64px 0; }
section.alt { background: var(--bg-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent-ink); margin-bottom: 8px; }
.grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-5 { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 700px) and (max-width: 999px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35em; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-3); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px; }
.icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-3); margin-bottom: 12px; }
.cta-band { background: var(--brand); color: #fff; border-radius: 18px; padding: 40px 28px; text-align: center; }
.cta-band p { color: #d4e4ef; }
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--ink-3); font-size: .93rem; margin-top: 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--ink-2); text-decoration: none; margin-right: 18px; }
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; background: var(--bg-2); }
.auth-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; box-shadow: var(--shadow); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; font-size: 1.3rem; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-good { background: var(--good-bg); color: var(--good); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad  { background: var(--bad-bg);  color: var(--bad); }
.tone-muted { background: var(--bg-3); color: var(--ink-3); }

/* ---------- dashboard shell ---------- */
.shell { display: flex; min-height: 100vh; background: var(--bg-2); }
.side { display: none; width: 248px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 10px 18px; }
.side nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; margin-bottom: 2px; }
.side nav a:hover { background: var(--bg-2); color: var(--ink); }
.side nav a.active { background: var(--bg-3); color: var(--brand); font-weight: 700; }
.side .group { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 14px 12px 6px; font-weight: 700; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--warn); color: #fff; font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.main { flex: 1; min-width: 0; padding: 0 0 90px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 1.25rem; margin: 0; }
.content { padding: 20px 16px; max-width: 1180px; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.tabbar a { flex: 1; text-align: center; font-size: .72rem; color: var(--ink-3); text-decoration: none; padding: 4px 2px; border-radius: 8px; position: relative; }
.tabbar a .ti { display: block; font-size: 1.25rem; line-height: 1.2; }
.tabbar a.active { color: var(--brand); font-weight: 700; }
.tabbar .dot { position: absolute; top: 2px; right: 22%; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
@media (min-width: 900px) { .side { display: block; } .tabbar { display: none; } .main { padding-bottom: 0; } .content { padding: 28px 32px; } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat .l { font-size: .92rem; margin-top: 6px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-h h2 { font-size: 1.08rem; margin: 0; }
.panel-b { padding: 16px 18px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--bg-3); cursor: pointer; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg-2); }
.list-item .t { font-weight: 600; }
.list-item .s { font-size: .88rem; color: var(--ink-3); }
.empty { padding: 34px 18px; text-align: center; color: var(--ink-3); }
.attention { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; cursor: pointer; text-decoration: none; }
.check-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--bg-3); }
.check-row:last-child { border-bottom: none; }
.check-row .note { grid-column: 1 / -1; font-size: .9rem; color: var(--ink-3); }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.steps .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.steps .done .tick { background: var(--good); border-color: var(--good); color: #fff; }
.keybox { font-family: var(--mono); font-size: .9rem; background: var(--bg-3); border-radius: 8px; padding: 12px; word-break: break-all; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bg-3); vertical-align: top; }
.tbl th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--bg-2); }
.mono { font-family: var(--mono); font-size: .85rem; word-break: break-all; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 14px; background: var(--bg-2); border-radius: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg .who { font-size: .76rem; opacity: .75; margin-bottom: 2px; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form textarea { min-height: 48px; height: 48px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.filters button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.modal-bg { position: fixed; inset: 0; background: rgba(15,27,45,.45); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 22px 20px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 16px; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .94rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
details.tech { margin-top: 12px; }
details.tech summary { cursor: pointer; color: var(--ink-3); font-size: .9rem; }
pre.code { background: #0f1b2d; color: #e6edf3; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: .82rem; }
.banner { background: var(--warn-bg); color: var(--warn); padding: 12px 18px; font-weight: 600; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; }
.modal-head h2 { font-size: 1.2rem; margin: 0; }
.modal-actions { margin-top: 18px; }
.mt { margin-top: 16px; } .mb0 { margin-bottom: 0; } .gap { height: 12px; }
.eyebrow-light { color: #9fe3d5; }
.hero-note { color: #cfe0ec; margin-top: 14px; }
.btn-block { width: 100%; }
.btn-row-center { justify-content: center; }
.btn-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-on-dark:hover { background: rgba(255,255,255,.1); color: #fff; }
.h-auth { font-size: 1.6rem; }
.h-page { font-size: clamp(1.8rem, 4.5vw, 2.4rem); }
.contact-grid { gap: 40px; align-items: start; }
/* ---------- dashboard helpers ---------- */
.h-section { font-size: 1.05rem; margin: 22px 0 12px; color: var(--ink-2); }
.mb-20 { margin-bottom: 20px; }
.stat-link { text-decoration: none; color: var(--ink); display: block; }
.stat-link:hover { border-color: var(--brand-2); }
.side-user { padding: 0 12px; word-break: break-all; margin-top: 8px; }
.side .btn { margin-left: 12px; }
.reasons { margin: 0 0 12px; padding-left: 20px; }
.reasons li { margin-bottom: 4px; }
.review-card { border-bottom: 1px solid var(--bg-3); padding: 16px 18px; }
.review-card:last-child { border-bottom: none; }
.review-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.note-input, .review-card textarea { min-height: 70px; }
.link-plain { color: inherit; text-decoration: none; }
.list-item.selected { background: var(--bg-3); }
.grow { flex: 1; }
.mobile-select { width: auto; min-height: 40px; padding: 6px 10px; }
@media (min-width: 900px) { .mobile-select { display: none; } }
.prewrap { white-space: pre-wrap; }
.support-grid { align-items: start; }
.panel-b.flush { padding: 0; }
.attention.tone-good { background: var(--good-bg); color: var(--good); }
.attention.tone-warn { background: var(--warn-bg); color: var(--warn); }
.attention.tone-bad { background: var(--bad-bg); color: var(--bad); }
.attention.tone-info { background: var(--info-bg); color: var(--info); }
/* Buttons always keep white text (nav link colours must not override them); accent darkened for readable contrast. */
.btn-accent { background: #0b7a66; color: #fff; }
.btn-accent:hover, .btn-accent:focus-visible { background: #08604f; color: #fff; }
.nav a.btn, .nav a.btn:hover, .mobile-nav a.btn, a.btn-primary, a.btn-primary:hover, a.btn-accent, a.btn-accent:hover,
a.btn-good, a.btn-danger { color: #fff; }
.nav a.btn-primary:hover { background: var(--brand-2); }
.check-label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check-label input { margin-top: 5px; width: 18px; height: 18px; flex-shrink: 0; }
.sep { border: none; border-top: 1px solid var(--line); margin: 26px 0 18px; }
.h-sub { font-size: 1.15rem; }
