/*
 * web/src/styles.css
 * ---------------------------------------------------------------------------
 * PURPOSE: One stylesheet for every page of vendor.exceledge.net.
 * Brand palette taken from the Excel Edge logo: navy + white + Excel green.
 * Pure CSS – no external fonts or CDNs (privacy + strict CSP).
 * ---------------------------------------------------------------------------
 */
/* ---------- fonts (self-hosted, SIL Open Font License – see public/fonts/LICENSE-*.txt) */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../public/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../public/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../public/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../public/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url('../public/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url('../public/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url('../public/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2'); }

:root {
  --navy: #0b1f3a; --navy-2: #13315c; --green: #1d8a3a; --green-2: #34b356; --green-soft: #e7f6ec;
  --amber: #b26b00; --amber-soft: #fff4e0; --red: #b42318; --red-soft: #fdecec; --grey: #5b6b82;
  --line: #e3e8f0; --bg: #f6f8fb; --white: #fff; --radius: 12px; --shadow: 0 6px 24px rgba(11, 31, 58, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute must always win over display:flex etc. */
html { scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.55 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--navy); background: var(--bg); }
a { color: var(--green); }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--green-2); outline-offset: 2px; }

/* ---------- header / footer */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 800; }
.brand img { height: 40px; width: 40px; }
.brand small { display: block; font-weight: 500; color: var(--grey); font-size: 11px; letter-spacing: .08em; }
.nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--navy); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--green); }
.site-footer { margin-top: 48px; padding: 24px 0 90px; background: var(--navy); color: #c9d4e5; font-size: 13px; }
.site-footer a { color: #fff; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

/* ---------- buttons, badges */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--navy);
  background: var(--white); color: var(--navy); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; transition: transform .1s, box-shadow .2s; }
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.small { padding: 6px 12px; font-size: 13px; border-width: 1.5px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.badge.ok { background: var(--green-soft); color: #1d6b32; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.info { background: #e8eef8; color: var(--navy-2); }

/* ---------- landing */
.hero { background: linear-gradient(135deg, #fff 0%, #eef6f1 100%); padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.hero .container { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; margin: 12px 0; }
.hero p.lead { font-size: 18px; color: var(--grey); margin: 0 0 18px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-logo { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 16px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step h3 { margin: 10px 0 4px; }
.notice { background: #fff; border-left: 5px solid var(--green); border-radius: 8px; padding: 14px 18px; margin: 14px 0; box-shadow: var(--shadow); }
.notice.warn { border-left-color: var(--amber); }

/* ---------- dashboard layout */
.page-title { margin: 24px 0 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; box-shadow: 0 1px 2px rgba(0,0,0,.02); }
.card h2 { font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.card h2 .n { background: var(--green); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.dropzone { border: 2px dashed #b8c4d6; border-radius: var(--radius); padding: 22px; text-align: center; background: #fafcff; cursor: pointer; transition: background .2s, border-color .2s; }
.dropzone.drag { background: var(--green-soft); border-color: var(--green); }
textarea { width: 100%; min-height: 110px; font: 13px Consolas, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
select, input[type=text], input[type=search] { font: inherit; padding: 7px 10px; border: 1px solid #c9d3e2; border-radius: 8px; background: #fff; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--grey); font-size: 12.5px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; cursor: pointer; }
.statuslist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.statuslist li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.hint { color: var(--grey); font-size: 13px; }
.progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--green-2)); transition: width .4s ease; }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* ---------- tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 520px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { position: sticky; top: 0; background: var(--navy); color: #fff; text-align: left; padding: 8px; white-space: nowrap; cursor: pointer; user-select: none; }
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:nth-child(even) td { background: #fafbfd; }
.mono { font-family: Consolas, monospace; }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--grey); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button[aria-selected=true] { color: var(--navy); border-bottom-color: var(--green); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: 13px; }
.st-FILED, .st-VERIFIED { color: #1d6b32; font-weight: 700; }
.st-NOT_FILED, .st-FAILED, .st-ERROR { color: var(--red); font-weight: 700; }
.st-UNVERIFIED, .st-PARTIAL, .st-WAITING_FOR_USER, .st-WAITING_FOR_PORTAL, .st-RATE_LIMITED { color: var(--amber); font-weight: 700; }
.st-NOT_APPLICABLE, .st-NOT_YET_DUE, .st-SKIPPED, .st-CANCELLED, .st-QUEUED { color: var(--grey); font-weight: 700; }

/* ---------- sticky download bar + toast */
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(11,31,58,.08); z-index: 30; }
.sticky-bar .container { display: flex; align-items: center; gap: 12px; height: 64px; }
.sticky-bar .hint { margin-right: auto; }
#toast { position: fixed; top: 78px; right: 20px; max-width: 380px; z-index: 50; display: grid; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; animation: slide .25s ease; }
.toast.err { background: var(--red); }
@keyframes slide { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- legal/help pages */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 24px auto; max-width: 900px; }
.doc h1 { margin-top: 0; }
.doc code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.desktop-only { display: none; }

@media (max-width: 900px) {
  .hero .container, .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .desktop-only { display: block; }
}
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .nav { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* step 2 option cards */
.options { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.opt input { margin-top: 4px; width: 18px; height: 18px; }
.opt small { color: var(--grey); }

/* ---------- headings use Plus Jakarta Sans */
h1, h2, h3, .brand, .page-title { font-family: "Plus Jakarta Sans", "Inter", "Segoe UI", sans-serif; letter-spacing: -0.01em; }

/* ---------- app shell (signed-in pages) */
.shell-nav { display: flex; gap: 4px; margin-left: 18px; }
.shell-nav a { padding: 8px 12px; border-radius: 8px; color: var(--navy); text-decoration: none; font-weight: 600; font-size: 14px; }
.shell-nav a[aria-current=page] { background: var(--green-soft); color: #1d6b32; }
.shell-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.credit-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; border: 0; }
.credit-pill b { color: #7ee2a0; font-size: 15px; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; color: var(--navy); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--green)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.menu { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 40; }
.menu button, .menu a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; font: inherit; color: var(--navy); cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--bg); }
.menu .who { padding: 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; color: var(--grey); }

/* ---------- modal */
.modal-back { position: fixed; inset: 0; background: rgba(11,31,58,.45); display: grid; place-items: center; z-index: 100; animation: fadeIn .15s ease; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(11,31,58,.3); animation: pop .2s ease; }
.modal header { padding: 18px 22px 0; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 19px; }
.modal .body { padding: 14px 22px; }
.modal footer { padding: 0 22px 18px; display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0 } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0 } }
.field { display: grid; gap: 4px; margin: 10px 0; }
.field label { font-weight: 600; font-size: 13px; }
.field input, .field select, .field textarea { font: inherit; padding: 10px 12px; border: 1px solid #c9d3e2; border-radius: 10px; }
.field textarea { min-height: 110px; font-family: inherit; }
.field .err { color: var(--red); font-size: 12.5px; min-height: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.plan b { display: block; font-size: 22px; font-family: "Plus Jakarta Sans", sans-serif; }
.plan .price { color: var(--green); font-weight: 700; margin-top: 4px; }
.pre { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 12px; font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat-card b { display: block; font-size: 28px; font-family: "Plus Jakarta Sans", sans-serif; }
.stat-card span { color: var(--grey); font-size: 13px; }

/* "Install" link next to the extension badge on the dashboard (hidden once the extension is detected) */
.ext-inline { font-size: 12.5px; margin-left: 6px; font-weight: 600; }
.ext-inline.installed { display: none; }
