/* ==========================================================================
   EGS IS website - styles. Same colour tokens as the application's EGS Dark theme
   (qt_app/ui_theme.py, class Tokens), so the site and the product look like one thing.
   ========================================================================== */

:root {
  --app-bg: #0A1220;
  --canvas: #0A111E;
  --surface: #0E1828;
  --surface-2: #121F33;
  --surface-3: #172840;
  --border: #1E3150;
  --border-strong: #2A4468;
  --text: #E4ECF7;
  --muted: #8EA3BF;
  --disabled: #6A7E9E;
  --accent: #2F8CFF;
  --accent-hover: #57A2FF;
  --accent-soft: #16345C;
  --on-accent: #FFFFFF;
  --ok: #3FD08F;
  --warn: #F2B440;
  --error: #FF6B6B;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--app-bg);
       line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: var(--text); }
p a:not(.btn), li a:not(.btn), td a:not(.btn), .card a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
.as-h3 { font-size: 1.15rem; font-weight: 650; }
.video-body h3 { font-size: 1em; font-weight: 700; margin: 0 0 0.5em; }
#pkg-cards { min-height: 26rem; }
.site-header { min-height: 64px; }
.site-footer { min-height: 320px; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.22; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); font-weight: 750; letter-spacing: -0.015em; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 32px; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px;
       font: inherit; font-weight: 650; font-size: 0.97rem; border: 1px solid transparent; cursor: pointer;
       text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
/* Deeper fill than --accent so white text reaches 4.5:1 (was 3.3:1); hover goes darker, not lighter. */
.btn-primary { background: #1A73E8; color: var(--on-accent); border-color: #1A73E8; }
.btn-primary:hover { background: #1560C4; border-color: #1560C4; color: var(--on-accent); }
.btn-outline, .btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover, .btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-dark { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.btn-lg { padding: 13px 26px; font-size: 1.04rem; }
.btn-mini { padding: 5px 12px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row, .hero-actions, .chip-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row { justify-content: center; }
.chip-row { gap: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(10, 18, 32, 0.94);
               backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; color: var(--text); font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 0.72rem; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav-links a { padding: 8px 13px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { background: var(--surface-3); color: var(--text); }
.nav-links a.active { background: var(--accent-soft); color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.version-badge { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); border: 1px solid var(--border);
                 padding: 3px 9px; border-radius: 999px; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; color: var(--text); cursor: pointer; }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 70% -10%, #16345C 0%, transparent 60%), var(--canvas);
        border-bottom: 1px solid var(--border); }
.hero-inner { padding: 80px 0 64px; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero .lead { font-size: 1.12rem; color: var(--muted); margin-bottom: 26px; }
.hero .accent { color: var(--accent-hover); }
.hero-proof { display: flex; gap: 28px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; margin-top: 30px; }
.hero-proof b { display: block; font-size: 1.35rem; color: var(--text); }
.hero-shot { position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius);
             overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.hero-shot .shot-bar { display: flex; gap: 7px; padding: 10px 14px; background: var(--surface-2); }
.hero-shot .shot-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.hero-tag { position: absolute; right: 14px; top: 46px; }
.badge-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
              background: var(--accent-soft); border: 1px solid var(--border-strong); color: var(--text); }
.badge-pill.gold { background: rgba(242, 180, 64, 0.12); border-color: rgba(242, 180, 64, 0.5); color: var(--warn); }

/* Sections */
.section { padding: 68px 0; }
.section.alt, .section-soft { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-head { max-width: 760px; margin: 0 auto 38px; text-align: center; }
.sec-head .kicker { color: var(--accent-hover); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.08em;
                    text-transform: uppercase; margin-bottom: 8px; }
.sec-head p { color: var(--muted); font-size: 1.04rem; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card.live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow); }
.card.soon { opacity: 0.88; }
.module-card .mc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.module-card .mc-icon { font-size: 1.3rem; }
.module-card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 14px; }
.chip { display: inline-block; font-size: 0.75rem; font-weight: 700; color: #7DB4FF;
        background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.chip-free { color: var(--ok); background: rgba(63, 208, 143, 0.12); }
.chip-coming { color: var(--warn); background: rgba(242, 180, 64, 0.12); }
.chip-live { color: #fff; background: #1A73E8; }
.package-card { display: flex; flex-direction: column; }
.package-card .pkg-title { display: flex; align-items: center; justify-content: space-between; }
.package-card ul { margin: 14px 0 4px; padding-left: 20px; color: var(--muted); font-size: 0.95rem; }
.package-card .price { margin-top: auto; padding-top: 18px; }
.package-card .price b { font-size: 1.55rem; }
.package-card .price span { color: var(--muted); font-size: 0.9rem; }
.feat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 30px 0; }
.feat-row.flip .feat-media { order: 2; }
.feat-media img { border-radius: var(--radius); border: 1px solid var(--border-strong); box-shadow: var(--shadow); width: 100%; }
.feat-copy .feat-step { font-family: var(--mono); font-size: 0.82rem; color: var(--accent-hover); font-weight: 700; }
.feat-copy ul { padding-left: 20px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 22px 20px 20px; counter-increment: step; }
.step::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
                background: var(--accent-soft); color: var(--text); font-weight: 800; margin-bottom: 10px; font-size: 0.9rem; }

/* Tables */
.table-shell { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { background: var(--surface-3); color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .free-text { color: var(--ok); font-weight: 650; }

/* Forms */
.form-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 650; font-size: 0.92rem; }
.label-hint { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
                          border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
textarea { min-height: 110px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.checks input { width: auto; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; gap: 10px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.88rem; }
.file-item .x { margin-left: auto; background: none; border: 0; color: var(--error); cursor: pointer; font-weight: 800; }
.form-actions { display: flex; gap: 14px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.form-msg { display: none; margin-top: 16px; padding: 13px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.form-msg.ok { display: block; background: rgba(63, 208, 143, 0.12); color: var(--ok); border: 1px solid rgba(63, 208, 143, 0.4); }
.form-msg.err { display: block; background: rgba(255, 107, 107, 0.1); color: var(--error); border: 1px solid rgba(255, 107, 107, 0.4); }

/* Pricing */
.pricing-toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 650; padding: 7px 16px;
              border-radius: 999px; cursor: pointer; }
.seg button.on { background: #1A73E8; color: var(--on-accent); }
.term-note { text-align: center; color: var(--muted); font-size: 0.9rem; }

/* Video / docs */
.video-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.video-thumb { position: relative; aspect-ratio: 16/9; background: linear-gradient(140deg, var(--surface-3), var(--accent-soft));
               display: grid; place-items: center; }
.video-thumb .play { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.12); display: grid;
                     place-items: center; font-size: 1.2rem; border: 1px solid rgba(255,255,255,0.35); }
.video-body { padding: 16px 18px; }
.video-body p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.badge-soon { position: absolute; top: 12px; right: 12px; font-size: 0.72rem; font-weight: 700; color: var(--warn);
              background: rgba(242, 180, 64, 0.14); border: 1px solid rgba(242, 180, 64, 0.5); padding: 3px 9px; border-radius: 999px; }

/* Download */
.release-box { background: var(--surface-2); border: 1px solid var(--accent); border-radius: var(--radius); padding: 24px; }
.release-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 14px 0; color: var(--muted); }
.release-box dd { margin: 0; color: var(--text); word-break: break-all; }

.cta-band { background: var(--accent-soft); border-top: 1px solid var(--border-strong); padding: 54px 0; text-align: center; }
.cta-band p { color: var(--muted); max-width: 640px; margin: 0 auto 24px; }

/* Footer */
.site-footer { background: var(--canvas); border-top: 1px solid var(--border); color: var(--muted); padding: 50px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; }
.site-footer h2 { font-size: 0.95rem; font-weight: 700; letter-spacing: 0; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
p a:not(.btn), li a:not(.btn), td a:not(.btn), .card a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
.as-h3 { font-size: 1.15rem; font-weight: 650; }
.video-body h3 { font-size: 1em; font-weight: 700; margin: 0 0 0.5em; }
#pkg-cards { min-height: 26rem; }
.site-header { min-height: 64px; }
.site-footer { min-height: 320px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand img { width: 28px; height: 28px; }
.foot-bottom { border-top: 1px solid var(--border); padding: 18px 0 22px; font-size: 0.86rem; display: flex;
               justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* Admin */
.ticket { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.ticket-head { display: flex; align-items: center; gap: 14px; padding: 13px 18px; background: var(--surface-3); flex-wrap: wrap; }
.ticket-head .t-id { font-family: var(--mono); color: var(--muted); font-size: 0.85rem; }
.ticket-head .t-subject { font-weight: 700; flex: 1; }
.ticket-body { padding: 16px 18px; }
.ticket-body img { max-width: 220px; border-radius: 6px; border: 1px solid var(--border-strong); }
.pill { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); }
.pill.resolved, .pill.issued { background: rgba(63, 208, 143, 0.14); color: var(--ok); }
.pill.reviewed, .pill.in_progress { background: rgba(242, 180, 64, 0.14); color: var(--warn); }
.pill.closed, .pill.declined { background: var(--surface); color: var(--muted); }

.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.88rem; margin-bottom: 8px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--radius-sm); padding: 12px; margin: 8px 0; font-family: inherit; }
pre.mono { font-family: var(--mono); }
.ticket-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.ticket-shots { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn-mini.danger { color: var(--error); border-color: var(--error); background: transparent; }
button.btn-mini { font: inherit; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface-3);
                  color: var(--text); border-radius: 6px; }

@media (max-width: 920px) {
  .hero-inner, .feat-row, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4, .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .feat-row.flip .feat-media { order: 0; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 10px 16px;
               background: var(--surface); border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-cta .btn { display: none; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .steps, .footer-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 48px 0 40px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
