/* ============================================================
   VEMS public site chrome: the ONE header, menu and footer every
   public page wears (Home and MarketingLayout both render the
   PublicHeader / PublicFooter components). Classes are pc- prefixed
   so nothing in the app or Tailwind css can collide with them.
   ============================================================ */

:root {
    --pc-bg: #05060b;
    --pc-text: #f2f4fb;
    --pc-dim: #8f9ab4;
    --pc-stroke: rgba(160, 175, 220, .16);
    --pc-chrome: rgba(3, 4, 9, .85);
    --pc-menu-bg: #08060f;
    --pc-scrim: rgba(0, 0, 0, .5);
    --pc-magenta: #c0257f;
    --pc-grad: linear-gradient(93deg, #e6273e 0%, #c0257f 50%, #8d2ba6 100%);
    --pc-body: "Archivo", system-ui, sans-serif;
    --pc-mono: "JetBrains Mono", ui-monospace, monospace;
    --pc-header-h: 82px;
}

html[data-theme="light"] {
    --pc-bg: #f1f2f8;
    --pc-text: #1a1e2e;
    --pc-dim: #5c6479;
    --pc-stroke: rgba(24, 32, 64, .15);
    --pc-chrome: rgba(244, 245, 250, .9);
    --pc-menu-bg: #eef0f7;
    --pc-scrim: rgba(20, 30, 60, .25);
}

.pc-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--pc-header-h);
    max-width: 100%;
    background: var(--pc-bg);
}
.pc-shell > main { flex: 1 1 auto; min-width: 0; }

.pc-header, .pc-menu, .pc-footer { font-family: var(--pc-body) !important; line-height: 1.2; }
.pc-header button, .pc-menu button { font-family: var(--pc-body) !important; }
.pc-header *, .pc-menu *, .pc-footer * { box-sizing: border-box; }
.pc-mono { font-family: var(--pc-mono) !important; }

/* ============ HEADER ============ */
.pc-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 300;
    height: var(--pc-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 46px;
    color: var(--pc-text);
    max-width: 100%;
}
.pc-header--solid { background: var(--pc-bg); border-bottom: 1px solid var(--pc-stroke); }
html[data-theme="light"] .pc-header--hero { color: var(--pc-text); }
.pc-header--hero.is-scrolled {
    background: linear-gradient(to bottom, var(--pc-chrome), transparent);
    color: var(--pc-text);
}
body.menu-open .pc-header--hero { color: var(--pc-text); }
.pc-header a { color: inherit; text-decoration: none; }
.pc-logo { display: block; flex: 0 1 auto; min-width: 0; }
.pc-logo img { display: block; height: 30px; width: auto; max-width: 100%; }
.pc-header__right { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }

.pc-demo {
    display: inline-flex;
    align-items: center;
    padding: 11px 24px;
    border-radius: 999px;
    background: var(--pc-grad);
    color: #fff;
    box-shadow: 0 6px 22px rgba(198, 37, 127, .4);
    opacity: 0;
    transform: translateY(-16px);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s ease, box-shadow .25s ease;
}
.pc-demo.is-on { opacity: 1; transform: none; pointer-events: auto; }
.pc-demo:hover { box-shadow: 0 10px 30px rgba(198, 37, 127, .6); }
.pc-demo .pc-mono { font-size: 11px; letter-spacing: .2em; font-weight: 700; color: #fff; }

.pc-login {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 26px;
    border: 1px solid currentColor;
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
    color: inherit;
}
.pc-login:hover .pc-login__label { color: #fff; }
.pc-login__fill {
    position: absolute; inset: 0;
    background: var(--pc-grad);
    transform: translateY(101%);
    transition: transform .35s cubic-bezier(.65, 0, .35, 1);
}
.pc-login:hover .pc-login__fill { transform: translateY(0); }
.pc-login:hover { border-color: transparent; }
.pc-login__label { position: relative; font-size: 12px; letter-spacing: .22em; font-weight: 700; }

.pc-theme {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    padding: 0;
    background: none;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    opacity: .85;
    transition: opacity .2s ease, transform .2s ease;
}
.pc-theme:hover { opacity: 1; transform: scale(1.06); }
.pc-theme-ico {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    opacity: 0;
    transform: scale(.3) rotate(-120deg);
    transition: opacity .3s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}
.pc-theme[data-mode="auto"] .pc-theme-ico--auto,
.pc-theme[data-mode="light"] .pc-theme-ico--light,
.pc-theme[data-mode="dark"] .pc-theme-ico--dark {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
.pc-theme[data-mode="light"]:hover .pc-theme-ico--light { transform: scale(1) rotate(45deg); }
.pc-theme[data-mode="dark"]:hover .pc-theme-ico--dark { transform: scale(1) rotate(-18deg); }
.pc-theme[data-mode="auto"]:hover .pc-theme-ico--auto { transform: scale(1.12) rotate(0deg); }
.pc-theme::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    white-space: nowrap;
    font-family: var(--pc-mono);
    font-size: 10px;
    letter-spacing: .12em;
    padding: 8px 13px;
    border-radius: 8px;
    background: var(--pc-menu-bg);
    border: 1px solid var(--pc-stroke);
    color: var(--pc-text);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity .25s ease, transform .25s ease;
    z-index: 10;
}
.pc-theme:hover::after, .pc-theme:focus-visible::after { opacity: 1; transform: none; }
@media (hover: none) { .pc-theme::after { display: none; } }

.pc-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    background: none;
    border: 0;
    color: inherit;
    font-size: 12px;
    letter-spacing: .22em;
    cursor: pointer;
    padding: 10px 4px;
}
.pc-menu-btn__lines { display: flex; flex-direction: column; gap: 5px; width: 26px; }
.pc-menu-btn__lines span { height: 2px; background: currentColor; transition: transform .3s ease, width .3s ease; }
.pc-menu-btn__lines span:last-child { width: 60%; align-self: flex-end; }
.pc-menu-btn:hover .pc-menu-btn__lines span:last-child { width: 100%; }
body.menu-open .pc-menu-btn__lines span:first-child { transform: translateY(3.5px) rotate(45deg); }
body.menu-open .pc-menu-btn__lines span:last-child { width: 100%; transform: translateY(-3.5px) rotate(-45deg); }

/* ============ MENU ============ */
.pc-menu {
    position: fixed;
    inset: 0;
    z-index: 250;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .4s;
}
body.menu-open .pc-menu { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.pc-menu__scrim {
    position: absolute;
    inset: 0;
    background: var(--pc-scrim);
    opacity: 0;
    transition: opacity .35s ease;
}
body.menu-open .pc-menu__scrim { opacity: 1; }
.pc-menu__panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 360px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    padding: calc(var(--pc-header-h) + 8px) 24px 24px;
    background: var(--pc-menu-bg);
    border-left: 1px solid var(--pc-stroke);
    color: var(--pc-text);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .4s cubic-bezier(.65, 0, .35, 1);
}
body.menu-open .pc-menu__panel { transform: none; }
.pc-menu a { color: inherit; text-decoration: none; }
.pc-menu__demo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    background: var(--pc-grad);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 22px rgba(198, 37, 127, .35);
}
.pc-menu__label {
    margin: 22px 0 4px;
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pc-dim);
}
.pc-menu__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid var(--pc-stroke);
}
.pc-menu__row:hover { color: var(--pc-magenta); }
.pc-menu__arrow { width: 16px; height: 16px; flex: 0 0 auto; color: var(--pc-dim); }

/* ============ FOOTER ============ */
.pc-footer {
    margin-top: auto;
    border-top: 1px solid var(--pc-stroke);
    background: var(--pc-bg);
    color: var(--pc-dim);
    padding: 12px 0;
}
.vems-marketing .pc-footer { background: transparent; padding: 18px 0 56px; }
.pc-footer a { color: inherit; text-decoration: none; }
.pc-footer a:hover { color: var(--pc-text); }
.pc-footer__inner {
    width: min(1240px, calc(100% - 56px));
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    letter-spacing: .16em;
    white-space: nowrap;
}
.pc-footer__links { display: flex; align-items: center; gap: 4px; margin-right: -8px; }
.pc-footer__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }

/* ============ PHONE ============ */
@media (max-width: 767px) {
    :root { --pc-header-h: 68px; }
    .pc-header { padding: 0 16px; }
    .pc-logo img { height: 22px; }
    .pc-header__right { gap: 8px; }
    .pc-login { min-height: 36px; padding: 8px 12px; }
    .pc-login__label { font-size: 10px; letter-spacing: .12em; }
    .pc-theme { width: 36px; height: 36px; }
    .pc-menu-btn { width: 44px; justify-content: center; padding: 0; }
    .pc-menu-btn__word { display: none; }
    body.menu-open { overflow: hidden; }
    body.menu-open .pc-header--hero { background: var(--pc-menu-bg); }
    .pc-menu__scrim { display: none; }
    .pc-menu__panel { width: 100%; border-left: 0; }
    .pc-footer__inner { width: calc(100% - 32px); letter-spacing: .08em; }
    .pc-footer__links { gap: 0; }
    .pc-footer__links a { padding: 0 7px; }

    /* One row only: at the top the demo CTA is collapsed; once scrolled it
       expands into the row while login + theme collapse away. Negative margins
       cancel the flex gap of whichever side is collapsed. Opacity is scrubbed
       to scroll from JS (_wireNavScroll in marketing.js); widths flip INSTANTLY
       at the is-on toggle, while both sides are transparent, so the row never
       overflows and wrap-bounces. */
    .pc-demo {
        transform: none;
        max-width: 0; padding: 9px 0; margin-left: -8px;
        overflow: hidden;
        transition: none;
    }
    .pc-demo .pc-mono { font-size: 9px; letter-spacing: .1em; white-space: nowrap; }
    .pc-demo.is-on { max-width: 150px; padding: 9px 14px; margin-left: 0; }
    .pc-login, .pc-theme { overflow: hidden; transition: none; }
    .pc-demo.is-on ~ .pc-login,
    .pc-demo.is-on ~ .pc-theme {
        max-width: 0; min-height: 0; width: 0; padding-left: 0; padding-right: 0; margin-left: -8px;
        border-color: transparent; pointer-events: none;
    }
}
@media (max-width: 359px) {
    .pc-header { padding: 0 12px; }
    .pc-header__right { gap: 4px; }
    .pc-demo, .pc-demo.is-on ~ .pc-login, .pc-demo.is-on ~ .pc-theme { margin-left: -4px; }
    .pc-demo.is-on { margin-left: 0; }
    .pc-logo img { height: 20px; }
    .pc-login { padding: 8px 9px; }
    .pc-footer__inner { letter-spacing: .04em; }
}

@media (prefers-reduced-motion: reduce) {
    .pc-menu, .pc-menu__scrim, .pc-menu__panel { transition: none; }
}
