/* ─────────────────────────────────────────────────────────────────────────────
   EUREKA PORTAL — styled to the EurekaNow UI system
   Palette, radii and motion mirror src/core/hooks.js (useTokens) in EurekaNow.
   ───────────────────────────────────────────────────────────────────────────── */

: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);
    --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;
}

* { 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;
}

/* 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: 1120px;
    margin: 0 auto;
    padding: 44px 24px 72px;
}

/* Top bar -------------------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.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;
}
.clock { text-align: right; line-height: 1.35; }
.clock__time { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock__date { display: block; font-size: 12px; color: var(--text-3); }

/* Hero -------------------------------------------------------------------------- */
.hero { margin: 44px 0 8px; }
.hero__greeting {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.6px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__sub { margin: 8px 0 0; font-size: 14px; color: var(--text-3); }

/* Search ------------------------------------------------------------------------ */
.search {
    position: relative;
    margin-top: 24px;
}
.search__icon {
    position: absolute;
    left: 18px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}
.search__input {
    width: 100%;
    height: 54px;
    padding: 0 52px 0 48px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.search__input::placeholder { color: var(--text-3); }
.search__input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.search__hint {
    position: absolute;
    right: 16px; top: 50%;
    transform: translateY(-50%);
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-3);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
}

/* Section headings ------------------------------------------------------------- */
.section__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    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);
}

.favourites { margin-top: 40px; }

/* Quick-launch pills --------------------------------------------------------- */
.fav-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.fav {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px 9px 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-ctl);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: transform .14s, border-color .14s, box-shadow .14s;
}
.fav:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.fav .ico { width: 20px; height: 20px; }
.fav .ico--fallback { font-size: 11px; border-radius: 7px; }

/* App sections -------------------------------------------------------------------- */
.section { margin-top: 34px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 14px;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    color: var(--text);
    text-decoration: none;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tile: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);
}
.tile:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.tile__label { font-size: 13px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.3; }

/* Icons ---------------------------------------------------------------------- */
.ico {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;
    flex-shrink: 0;
}
img.ico { display: block; }
.ico--invert { filter: invert(1) brightness(1.7); }
.ico--fallback {
    background: var(--grad-primary);
    color: #fff;
    border-radius: 12px;
    font-weight: 800;
    font-size: 19px;
    text-transform: uppercase;
}

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

/* Responsive ------------------------------------------------------------------- */
@media (max-width: 640px) {
    .wrap { padding: 32px 16px 56px; }
    .hero__greeting { font-size: 27px; }
    .search__input { height: 50px; font-size: 14px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
    .tile { padding: 18px 8px 14px; gap: 10px; }
    .tile__label { font-size: 12px; }
    .ico { width: 38px; height: 38px; }
}

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