/*
 * VALSS Lite — brand layer (Phase I2, official identity v1).
 *
 * Plain CSS served by AssetController (Krayin's Tailwind build only scans core
 * sources, so the product ships its own stylesheet; same approach as realty.css).
 *
 * Values come from the approved identity package (06-Tokens/valss-lite-tokens.css):
 * VALSS black #1C1C1C, LITE grey #6F6A66, graphite #333333, pearl #B4B1AF,
 * deep #111111, and Montserrat as the only typeface.
 *
 * Rules of this file:
 *  - prefix `vl-` on every class: it never collides with Krayin or `wr-`;
 *  - only custom classes, never bare element selectors, so the core UI is
 *    untouched outside the branded blocks (the one deliberate exception, the
 *    header logo swap, is emitted inline ONLY when the official identity is
 *    installed — see branding/head.blade.php);
 *  - every colour comes from a variable set by the brand layer, so per-agency
 *    configuration changes the palette without editing this file;
 *  - Krayin's app.css forces `p { line-height: 17px !important }`, so any
 *    branded paragraph restores its own line-height explicitly.
 */

.vl-flag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.5 !important;
    text-transform: uppercase;
    vertical-align: middle;
}

.vl-flag--inline {
    margin-left: 6px;
    opacity: .85;
}

/* ---------- Login: workspace card of the agency ---------- */

.vl-login-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 20px 0;
    text-align: left;
    font-family: var(--vl-font);
}

/*
 * Login logo. Krayin renders a configured logo with `h-10 w-[110px]`, which
 * squashes a 5.6:1 lockup and sits far below the 320 px minimum the guide sets
 * for the complete variant. Height 57 px restores the official proportion and
 * lands at ~321 px wide on desktop. It is matched by the file name the native
 * field installs, so it never touches an operator's own logo.
 *
 * On phones the box follows the guide's other variant instead: the complete
 * lockup cannot reach its 320 px minimum inside a ~240 px card, so the official
 * layer swaps the artwork to `sin firma` (see branding/head.blade.php) and only
 * the box is set here — 240 px wide, which is that variant's minimum, with
 * `height:auto` so the proportion always comes from the image itself. If a
 * browser ever ignored the swap, the same box still renders the complete PNG
 * undistorted (240 x 42.6), just smaller.
 */
img[src*="configuration/valss-lite-logo"] {
    width: auto !important;
    height: 57px !important;
    max-width: 100%;
    object-fit: contain;
}

@media (max-width: 640px) {
    img[src*="configuration/valss-lite-logo"] {
        width: 240px !important;
        height: auto !important;
    }
}

.vl-login-workspace {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--vl-radius, 10px);
    background: #F7F7F6;
    border: 1px solid #E7E5E3;
}

.vl-login-workspace__initials {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
    background: var(--vl-accent, #1C1C1C);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

.vl-login-workspace__logo {
    height: 26px;
    width: auto;
}

.vl-login-workspace__name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4 !important;
    color: #1C1C1C;
}

.vl-login-head__logo {
    height: 36px;
    width: auto;
    margin-bottom: 4px;
}

.vl-login-head__product {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2 !important;
    letter-spacing: -.015em;
    color: var(--vl-primary, #1C1C1C);
}

.vl-login-head__tagline {
    margin: 0;
    font-size: 13px;
    line-height: 1.45 !important;
    color: #6F6A66;
}

.vl-login-head__agency {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45 !important;
    color: var(--vl-accent, #1C1C1C);
}

.vl-login-head__flag {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.4 !important;
    color: #6F6A66;
}

.vl-login-head__flag .vl-flag {
    color: #92400E;
    background: #FEF3C7;
    border-color: transparent;
}

/* ---------- Guest screens (login, forgot/reset password) ---------- */

/*
 * The presentation overrides drop Krayin's «Powered by…» block from the three
 * guest screens (see Resources/overrides/admin/sessions). That block used to
 * anchor the composition at the bottom, so without it the card would sit on the
 * exact centre line; this reserve restores the optical balance the approved
 * design had. It lives here — and not as a Tailwind utility — because Krayin's
 * build only scans core sources, so `pb-14` would silently do nothing.
 */
.vl-guest-frame {
    padding-bottom: 56px;
}

/* ---------- Vendor signature (two weights, uppercase) ---------- */

.vl-signature {
    margin: 0;
    font-family: var(--vl-font);
    font-size: 11px;
    line-height: 16px !important;
    text-transform: uppercase;
    color: #6F6A66;
    white-space: nowrap;
}

.vl-signature__lead {
    font-weight: 350;
    letter-spacing: .34em;
    margin-right: .34em;
}

.vl-signature__brand {
    font-weight: 700;
    letter-spacing: .42em;
}

.vl-signature--foot {
    text-align: right;
}

.vl-login-sign {
    padding: 0 20px 18px;
}

/*
 * Official identity, login. On desktop the complete lockup already carries
 * «DESARROLLADO POR WANDA» inside the artwork, so the live-text signature is
 * suppressed to avoid duplicating it. On phones the login shows the `sin firma`
 * variant, which by definition has no signature, so the text takes over there.
 * Both are never visible at the same time.
 */
@media (min-width: 641px) {
    .vl-login-sign--mobile-only {
        display: none;
    }
}

/* ---------- Sidebar: symbol + signature ---------- */

/*
 * The sidebar itself is `fixed top-[60px] h-full`, so its bottom edge sits 60 px
 * BELOW the viewport: an absolutely positioned block would be clipped. Fixed to
 * the viewport instead, inside the 200 px column the sidebar occupies, and above
 * the collapse control. The sidebar is hidden below `lg` (`max-lg:hidden`), so
 * this block must disappear there too.
 */
.vl-sidebar-brand {
    position: fixed;
    bottom: 46px;
    left: 0;
    z-index: 10003;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 200px;
    padding: 10px 16px 12px;
    border-top: 1px solid #E7E5E3;
    /* Same surface as the core sidebar, in both themes: the block is opaque so
       that a long menu scrolling under it stays hidden, and inheriting keeps it
       in step with Krayin's palette instead of hard-coding a second dark tone. */
    background-color: inherit;
    font-family: var(--vl-font);
}

@media (max-width: 1023px) {
    .vl-sidebar-brand {
        display: none;
    }
}

/*
 * Symbol at the foot of the menu. Height drives the size: the guide sets the
 * symbol's minimum at 24 px of height (guide §6), which is exactly the box used
 * here so the mark is never reduced below it.
 */
.vl-sidebar-brand__symbol {
    width: 30px;
    height: 24px;
    background: var(--vl-symbol-light) no-repeat left center / contain;
}

.vl-sidebar-brand .vl-signature {
    font-size: 9px;
    letter-spacing: .18em;
    white-space: normal;
    line-height: 1.6 !important;
    max-width: 100%;
}

.vl-sidebar-brand .vl-signature__lead {
    display: block;
    margin-right: 0;
}

.vl-sidebar-brand .vl-signature__brand {
    display: block;
}

/* Collapsed menu: the sidebar shrinks to 70 px, so only the symbol remains. */
.sidebar-collapsed .vl-sidebar-brand {
    align-items: center;
    width: 70px;
    padding: 10px 0 12px;
}

.sidebar-collapsed .vl-sidebar-brand .vl-signature {
    display: none;
}

.sidebar-collapsed .vl-sidebar-brand__symbol {
    background-position: center;
}

/* ---------- Administration shell footer ---------- */

.vl-appfoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 10px 16px 12px;
    border-top: 1px solid #E7E5E3;
    font-family: var(--vl-font);
}

.vl-appfoot__id {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    line-height: 1.5 !important;
}

.vl-appfoot__product {
    font-weight: 650;
    color: var(--vl-primary, #1C1C1C);
}

.vl-appfoot__sep,
.vl-appfoot__agency {
    color: #6F6A66;
}

/* ---------- Dashboard: branded identity banner ---------- */

.vl-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 16px 18px;
    border-radius: var(--vl-radius, 10px);
    background-color: var(--vl-primary, #1C1C1C);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0));
    color: #FFFFFF;
    font-family: var(--vl-font);
}

.vl-hero__main {
    min-width: 0;
}

/*
 * Dashboard banner. The dark band carries the `sin firma` inverted variant at
 * the 240 px minimum the guide sets for it (guide §2/§6): the complete lockup
 * would need 320 px and 57 px of height and would turn the banner into a
 * billboard, and the signature it embeds is already live text at the shell
 * footer and at the foot of the sidebar. Width drives the size here, so the
 * proportion always comes from the artwork (`height:auto`), never from the box.
 */
.vl-hero__logo {
    width: 240px;
    height: auto;
    max-width: 100%;
}

.vl-hero__eyebrow {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5 !important;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .82);
}

.vl-hero__product {
    margin: 2px 0 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15 !important;
    letter-spacing: -.02em;
}

.vl-hero__tagline {
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.5 !important;
    color: rgba(255, 255, 255, .82);
}

.vl-hero__agency {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    text-align: right;
}

.vl-hero__agency-label {
    font-size: 9px;
    font-weight: 600;
    line-height: 1.5 !important;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
}

.vl-hero__agency-name {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4 !important;
    color: #FFFFFF;
}

/* ---------- Dark mode (Krayin toggles the `dark` class on <html>) ---------- */

.dark .vl-login-workspace {
    background: #161616;
    border-color: #2B2A29;
}

.dark .vl-login-workspace__name {
    color: #F5F5F4;
}

.dark .vl-login-workspace__initials {
    background: #F5F5F4;
    color: #111111;
}

.dark .vl-login-head__product,
.dark .vl-appfoot__product {
    color: #F5F5F4;
}

.dark .vl-login-head__tagline,
.dark .vl-login-head__agency,
.dark .vl-login-head__flag,
.dark .vl-signature,
.dark .vl-appfoot__sep,
.dark .vl-appfoot__agency {
    color: #A29D99;
}

.dark .vl-login-head__flag .vl-flag {
    color: #FCD34D;
    background: rgba(245, 158, 11, .16);
}

.dark .vl-appfoot,
.dark .vl-sidebar-brand {
    border-top-color: #2B2A29;
}

.dark .vl-sidebar-brand__symbol {
    background-image: var(--vl-symbol-dark);
}

.dark .vl-hero {
    background-color: #111111;
    box-shadow: inset 0 0 0 1px #2B2A29;
}

/* ---------- Responsive: 390 px must not scroll sideways ---------- */

@media (max-width: 640px) {
    .vl-login-head {
        padding: 14px 16px 0;
    }

    .vl-login-head__product {
        font-size: 19px;
    }

    .vl-hero {
        padding: 14px;
    }

    /* The banner keeps the variant at its 240 px minimum: the band still has
       330 px of usable width at 390 px, so it fits without shrinking. */
    .vl-hero__product {
        font-size: 20px;
    }

    .vl-hero__agency {
        align-items: flex-start;
        text-align: left;
        border-radius: var(--vl-radius, 10px);
    }

    .vl-appfoot {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px 14px;
    }

    .vl-signature--foot {
        text-align: left;
    }

    .vl-signature {
        font-size: 10px;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vl-hero,
    .vl-appfoot,
    .vl-login-head,
    .vl-sidebar-brand {
        transition: none !important;
    }
}
