/* ═════════════════════════════════════════════════════════════════════════════
   EUREKA UI — shared design system for Eureka surfaces.

   ►  THIS FILE (ui/eureka-ui.css) IS THE SINGLE SOURCE OF TRUTH.  ◄

   Edit here, then run:   npm run ui:sync      (from the workspace root)
   Verify parity with:    npm run ui:check

   sync copies this file verbatim into every consumer listed in ui/sites.json:
     • Portal/eureka-ui.css
     • email-notifications-server/eureka-ui.css
     • EurekaNetwork-Infrastructure/eureka-ui.css
     • documentation/eureka-ui.css

   Consumers load this first, then may add a small site-only stylesheet AFTER it
   for genuine per-site differences (e.g. Portal/styles.css). Never fork tokens.
   ═════════════════════════════════════════════════════════════════════════════ */

:root {
    --bg:          #0B1A30;   /* page background        */
    --surface:     #0F2340;   /* card / panel surface   */
    --surface-2:   #122545;   /* input surface          */
    --surface-3:   #1A335A;   /* hover surface          */
    --border:      #243B5A;
    --text:        #FFFFFF;
    --text-2:      #CBD5E1;
    --text-3:      #94A3B8;
    --accent:      #22D3EE;   /* EurekaNow cyan         */
    --accent-text: #67E8F9;
    --accent-bg:   rgba(34, 211, 238, 0.12);
    --grad-primary:   linear-gradient(135deg, #A855F7, #EC4899);
    --grad-secondary: linear-gradient(135deg, #22D3EE, #0891B2);
    --ok:      #34D399;
    --ok-bg:   rgba(52, 211, 153, 0.14);
    --warn:    #FBBF24;
    --warn-bg: rgba(251, 191, 36, 0.14);
    --radius-card: 14px;
    --radius-ctl:  12px;
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, 0.4);
    --font: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Ambient background flares ------------------------------------------------- */
.bg-flare {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
}
.bg-flare--purple { width: 520px; height: 520px; background: #A855F7; top: -180px; left: -120px; }
.bg-flare--cyan   { width: 460px; height: 460px; background: #22D3EE; bottom: -200px; right: -140px; opacity: 0.16; }

/* Layout ------------------------------------------------------------------------ */
.wrap {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 44px 24px 72px;
}

/* Top bar ------------------------------------------------------------------------ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand__mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    display: block;
    box-shadow: 0 0 0 1px var(--border);
}
.brand__name { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }
.brand__accent {
    background: var(--grad-secondary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Status badges --------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--border);
    color: var(--text-2);
    background: var(--surface);
}
.badge::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.badge--live     { color: var(--ok);     border-color: rgba(52, 211, 153, 0.4);  background: var(--ok-bg); }
.badge--wip      { color: var(--warn);   border-color: rgba(251, 191, 36, 0.4);  background: var(--warn-bg); }
.badge--internal { color: var(--accent-text); border-color: rgba(34, 211, 238, 0.4); background: var(--accent-bg); }

/* Hero ------------------------------------------------------------------------- */
.hero { margin: 44px 0 8px; }
.hero__title {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.15;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__sub { margin: 12px 0 0; font-size: 15px; color: var(--text-3); max-width: 60ch; }

/* Section headings ----------------------------------------------------------- */
.section__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 44px 0 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}
.section__title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Panels & cards ------------------------------------------------------------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 22px 22px 20px;
}
.panel + .panel { margin-top: 14px; }
.panel h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.panel p  { margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.panel p:last-child { margin-bottom: 0; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 18px 16px;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: var(--shadow-lift), 0 0 0 1px rgba(34, 211, 238, 0.16);
}
.card h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.card p  { margin: 0; font-size: 13px; color: var(--text-3); }

/* Key / value list --------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text-2); }

/* Tables ------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-card); }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 460px;
}
table.data th, table.data td {
    text-align: left;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
table.data th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--surface-2);
}
table.data tr:last-child td { border-bottom: none; }
table.data td { color: var(--text-2); }

/* Code ------------------------------------------------------------------------- */
code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    color: var(--accent-text);
}
pre {
    margin: 12px 0 0;
    padding: 16px 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-2);
}
pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }

/* Buttons / links ----------------------------------------------------------------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-ctl);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
    transition: transform .14s, border-color .14s, box-shadow .14s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, 0.45); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
.btn--primary {
    border-color: transparent;
    background: var(--grad-primary);
    color: #fff;
}

ul.clean { margin: 8px 0 0; padding-left: 20px; }
ul.clean li { font-size: 14px; color: var(--text-2); margin: 4px 0; }

a { color: var(--accent-text); }

/* Footer ------------------------------------------------------------------------- */
.foot {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
}

/* Responsive ------------------------------------------------------------------- */
@media (max-width: 640px) {
    .wrap { padding: 32px 16px 56px; }
    .hero__title { font-size: 27px; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
