/* illunare admin — brand overrides + small utilities layered on the theme. */

:root,
[data-bs-theme="light"] {
    --bs-primary: #3C8AF1;
    --bs-primary-rgb: 60, 138, 241;
    --bs-primary-active: #2f72cf;
    --bs-primary-light: #e8f1fe;
    --bs-primary-clarity: rgba(60, 138, 241, 0.2);
    --bs-primary-inverse: #ffffff;
}

[data-bs-theme="dark"] {
    --bs-primary: #3C8AF1;
    --bs-primary-rgb: 60, 138, 241;
    --bs-primary-active: #5b9ff5;
    --bs-primary-light: #1b2c46;
    --bs-primary-clarity: rgba(60, 138, 241, 0.25);
    --bs-primary-inverse: #ffffff;
}

/* Utilities the theme does not ship at this scale. */
.ps-12 { padding-left: 3.25rem !important; }
.ps-13 { padding-left: 3.5rem !important; }

/* Sign-in side panel. */
.il-auth-aside {
    background-color: #0d1117;
    background-image: radial-gradient(circle at 25% 25%, #1b3157 0%, rgba(27, 49, 87, 0) 55%),
        linear-gradient(135deg, #11233f 0%, #0d1117 100%);
}

/* Brand the active aside link with the illunare primary. */
.aside .menu .menu-item .menu-link.active {
    background-color: var(--bs-primary-light);
}

/* Theme icon visibility is driven by the theme attribute. */
[data-bs-theme="light"] .theme-dark-show { display: none !important; }
[data-bs-theme="dark"] .theme-light-show { display: none !important; }

/* The theme's max-h-* utilities are absent from this CSS bundle, so the brand
   SVGs (which carry intrinsic width/height) rendered at full size — notably the
   portrait symbol used for the collapsed/mobile logo. Restore the utilities and
   pin the aside brand sizes. */
.max-h-30px { max-height: 30px !important; }
.max-h-40px { max-height: 40px !important; }
.max-h-50px { max-height: 50px !important; }
#il_aside_logo img { width: auto; }
#il_aside_logo .logo-default { max-height: 34px !important; }
#il_aside_logo .logo-minimize { max-height: 28px !important; }
/* Mobile header brand symbol. */
.header .h-30px { height: 30px !important; width: auto; }

/* Auth: animated dot-grid pixel canvas behind the form (parity with the app
   sign-in). The wrap sits behind the form content; the canvas is painted by
   /assets/js/il/auth-canvas.js and adapts to the active theme. */
.il-auth-canvas-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.il-auth-canvas-wrap canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Auth: right-aligned input affordances (mail icon / password show-hide). */
.il-input-wrap { position: relative; }
.il-input-wrap .pe-12 { padding-right: 3rem !important; }
.il-input-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    color: var(--bs-gray-500);
    background: transparent;
    border: 0;
    padding: 0;
    line-height: 0;
}
button.il-input-icon { cursor: pointer; }
button.il-input-icon:hover { color: var(--bs-primary); }

/* Global search: larger field with an inset "Consultar" button. */
.pe-125px { padding-right: 125px !important; }
.me-110px { margin-right: 110px !important; }
.me-125px { margin-right: 125px !important; }
#il_header_search .search-input { height: 46px; }

/* Canonical pre-loader (illunare) — double SVG ring around the symbol mask,
   identical to illunare.ai's `#il-preloader`. Shown on load, fades out when
   ready. Keeps the admin asset path for the mark mask. */
#il-preloader {
    --il-pl-color: var(--bs-primary, #3C8AF1);
    --il-pl-bg: #ffffff;
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--il-pl-bg, #ffffff);
    transition: opacity 0.35s ease;
}
[data-bs-theme=dark] #il-preloader { --il-pl-bg: #15171c; --il-pl-mark-color: #fff; }
#il-preloader.il-hide { opacity: 0; pointer-events: none; }
#il-preloader .il-pl-box { position: relative; width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; }
#il-preloader .il-pl-ring { position: absolute; inset: 0; width: 100px; height: 100px; }
#il-preloader .il-pl-ring circle { fill: none; stroke: var(--il-pl-color, #3C8AF1); stroke-width: 4; stroke-linecap: round; transform-box: fill-box; transform-origin: center; }
#il-preloader .il-pl-a circle { stroke-dasharray: 6 9.5; animation: il-pl-spin 6s linear infinite reverse; }
#il-preloader .il-pl-b circle { stroke-dasharray: 173 289; animation: il-pl-spin 35s linear infinite; }
#il-preloader .il-pl-mark {
    position: relative; z-index: 2; width: 40px; height: 40px; display: block;
    background-color: var(--il-pl-mark-color, var(--bs-primary, #3C8AF1));
    -webkit-mask: url(/assets/media/logos/logotipo-symbol-white.svg) center/contain no-repeat;
    mask: url(/assets/media/logos/logotipo-symbol-white.svg) center/contain no-repeat;
}
@keyframes il-pl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    #il-preloader .il-pl-a circle, #il-preloader .il-pl-b circle { animation: none; }
}

/* Standardize card text so long titles/descriptions never force a scrollbar. */
.card .card-title .card-label,
.card .card-header h3:not(.fs-2hx),
.card .card-title > .fw-bold,
.card .card-title > .fw-bolder,
.card .card-title .text-muted,
.card .card-title .fs-7,
.il-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

/* Single-line clamp utility (titles). */
.il-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

/* "Anúncios" / "Agenda de hoje" carousel cards: title at most one line,
   description at most two lines, so long demo strings never grow the card past
   the official design. Scoped to cards tagged `il-clamp-card` so no other
   widget is affected. */
.il-clamp-card .carousel-wrapper a.fw-bolder {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.il-clamp-card .carousel-wrapper p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
