/* ==========================================================================
   Theme: servershare

   The brand of the product (static/brand/README.md): ink #15171C, ivory
   #F4F2EC, and one accent in two strengths -- light blue #38BDF8 on dark, blue
   #1D4ED8 on light (the green of the first version read as money and nature,
   not as compute), with #3B82F6 as the second blue on dark. The brand forbids
   gradients, shadows and glows around the mark, so this theme has none of the
   effects the `nebula` theme carries: the chrome is flat ink, and the only
   colour in it is the accent.

   Like every theme here, this file redefines tokens; the chrome rules live in
   the package's main_new.css and are written against var(). Load order in
   index_servershare.html: tailwind -> /keepup-static/css/main_new.css -> this.

   Sora comes with the application (static/brand/fonts, SIL OFL) rather than
   from a font service: the panel of a host that rents out compute should not
   fetch anything from a third party to draw itself. Sora has no Cyrillic, so
   Russian text in the sections falls back to the system font -- that is why
   the stack names the fallbacks rather than Sora alone.
   ========================================================================== */

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/brand/fonts/sora-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/brand/fonts/sora-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
        U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* The brand's own values, named as the brand names them. */
    --brand-ink: #15171C;
    --brand-ivory: #F4F2EC;
    --brand-accent: #38BDF8;
    --brand-accent-light: #1D4ED8;
    --brand-blue: #3B82F6;

    /* Derived: ink lightened for surfaces and borders inside the dark chrome,
       so the whole sidebar stays one colour family instead of grey films. */
    --brand-surface: #1D2027;
    --brand-border: rgba(244, 242, 236, 0.10);
    --brand-text-dim: #A2A8B4;
    --brand-font: 'Sora', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue',
        Arial, sans-serif;

    /* Chrome tokens on that palette. */
    --sidebar-bg: var(--brand-ink);
    --sidebar-fg: var(--brand-ivory);
    --sidebar-header-bg: transparent;
    --sidebar-width: 16rem;
    --sidebar-width-collapsed: 72px;

    --nav-item-padding: 0.7rem 1.1rem;
    --nav-item-padding-collapsed: 0.7rem;
    --nav-item-radius: 10px;
    --nav-item-fg: var(--brand-text-dim);
    --nav-item-bg: transparent;
    --nav-item-fg-hover: var(--brand-ivory);
    /* The accent at low opacity: one colour marks hover and the open section,
       and the difference between them is its strength, not another hue. */
    --nav-item-bg-hover: rgba(56, 189, 248, 0.12);
    --nav-item-fg-active: var(--brand-ivory);
    --nav-item-bg-active: rgba(56, 189, 248, 0.22);
    --nav-item-icon-gap: 0.75rem;

    --modules-nav-max-height: calc(100vh - 200px);
    --modules-nav-padding: 8px 10px 16px;
    --sidebar-scrollbar-track: rgba(244, 242, 236, 0.04);
    --sidebar-scrollbar-thumb: var(--brand-accent);
    --sidebar-scrollbar-thumb-hover: var(--brand-blue);

    --chrome-transition: all 0.2s ease;

    /* The drawer is opaque ink: it floats above the content, and a translucent
       one would read the section's text through itself. */
    --drawer-bg: var(--brand-ink);
    --backdrop-color: rgba(21, 23, 28, 0.72);
}

body {
    background-color: #F6F5F1;
    color: var(--brand-ink);
    font-family: var(--brand-font);
}

/* The sidebar is the brand's own surface: ink, one hairline border, no film. */
#sidebar {
    border-right: 1px solid var(--brand-border);
}

#sidebar .nav-item {
    font-weight: 500;
}

/* The mark in the corner. The panel replaces `.logo-text` with the lockup when
   the theme carries a logo, so both cases are sized here: the image by height,
   the text by its own weight. */
.logo-text {
    font-family: var(--brand-font);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--brand-ivory);
}

.logo-text .accent {
    color: var(--brand-accent);
}

.logo-image {
    height: 26px;
    width: auto;
    display: block;
}

/* Collapsed, the sidebar keeps the mark alone: the lockup would be cut off at
   72px, and a cut wordmark is worse than none. */
:root:not(.is-narrow) .sidebar-collapsed .logo-image {
    content: url('/static/brand/servershare-icon-small-dark.svg');
    height: 28px;
}

.toggle-sidebar-btn {
    color: var(--brand-text-dim);
}

.toggle-sidebar-btn:hover {
    color: var(--brand-ivory);
    background-color: rgba(244, 242, 236, 0.06);
}

/* The sign-in screen: the same ink field the mark is drawn on, so the first
   screen of the product is the brand rather than a grey form. */
.auth-block {
    background-color: var(--brand-ink) !important;
}

.auth-block .bg-white {
    border: 1px solid rgba(21, 23, 28, 0.08);
}

/* Знак над формой: первый экран продукта называет продукт, а не просто
   просит логин. Надпись берётся в основном варианте -- карточка белая. */
.auth-mark {
    display: block;
    height: 30px;
    width: auto;
    margin-bottom: 1.25rem;
}

/* Кнопка и ссылки входа -- фирменные. На светлой карточке акцент тёмный:
   голубой на белом не набирает контраст. */
.brand-button {
    background-color: var(--brand-accent-light);
    color: #ffffff;
    font-weight: 600;
}

.brand-button:hover {
    background-color: #1E40AF;
}

.brand-tab {
    color: var(--brand-accent-light);
    border-color: var(--brand-accent-light);
}

.brand-link {
    color: var(--brand-accent-light);
}

.brand-link:hover {
    text-decoration: underline;
}

.brand-check {
    accent-color: var(--brand-accent-light);
}

/* Вкладки входа красит общий скрипт панели: он добавляет `text-blue-600` и
   `border-blue-600` при переключении. Скрипт -- код каркаса, а каркас из
   продуктовой задачи не правят, поэтому цвет переопределяется здесь и только
   внутри карточки входа. */
.auth-block .text-blue-600 {
    color: var(--brand-accent-light);
}

.auth-block .border-blue-600 {
    border-color: var(--brand-accent-light);
}

.brand-input:focus {
    border-color: var(--brand-accent-light);
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.25);
}
