/* Global font setup for alfont_com_Cairo_regular */
@font-face {
    font-family: 'RB';
    src: url('../fonts/alfont_com_Cairo_regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'RB';
    src: url('../fonts/alfont_com_Cairo_regular.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Cairo Arabic font family (local, all weights) */
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo/Cairo-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bs-body-font-family: 'Cairo', 'RB', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans Arabic', 'Noto Sans', 'Droid Arabic Kufi', 'Tahoma', sans-serif;
    /* Dynamic theme variables */
    --theme-primary: #6f42c1;           /* default (current look) */
    --theme-primary-2: #8463f5;         /* gradient mate */
    --theme-primary-contrast: #ffffff;
    --theme-primary-rgb: 111, 66, 193;  /* for rgba() usage */
    /* Derived tokens */
    --theme-border-accent: color-mix(in srgb, var(--theme-primary), white 80%);
    --theme-soft-bg: color-mix(in srgb, var(--theme-primary), transparent 92%);
    --theme-gradient-from: var(--theme-primary);
    --theme-gradient-to: var(--theme-primary-2);
    /* Bridge to Bootstrap tokens so BS components follow */
    --bs-primary: var(--theme-primary);
    --bs-primary-rgb: var(--theme-primary-rgb);
    --bs-link-color: var(--theme-primary);
}

html, body {
    font-family: var(--bs-body-font-family) !important;
}

/* Bold headings across the app */
h1, h2, h3, h4, h5, h6,
.card-title,
.modal-title,
.offcanvas-title,
.page-title,
.pagetitle,
.breadcrumb-item.active {
    font-weight: 700 !important;
}

/* Theme palettes controlled by html[data-theme-colors] */
html[data-theme-colors='default'] {
    --theme-primary: #6f42c1;
    --theme-primary-2: #8463f5;
    --theme-primary-contrast: #ffffff;
    --theme-primary-rgb: 111, 66, 193;
}

html[data-theme-colors='purple'] {
    --theme-primary: #6f42c1;
    --theme-primary-2: #8463f5;
    --theme-primary-contrast: #ffffff;
    --theme-primary-rgb: 111, 66, 193;
}

html[data-theme-colors='blue'] {
    --theme-primary: #2f6de1;
    --theme-primary-2: #49a6ff;
    --theme-primary-contrast: #ffffff;
    --theme-primary-rgb: 47, 109, 225;
}

html[data-theme-colors='cyan'] {
    --theme-primary: #06b6d4;
    --theme-primary-2: #22d3ee;
    --theme-primary-contrast: #0f172a;
    --theme-primary-rgb: 6, 182, 212;
}

/* Ensure derived + bootstrap bridge update when palette changes */
html[data-theme-colors] {
    --theme-border-accent: color-mix(in srgb, var(--theme-primary), white 80%);
    --theme-soft-bg: color-mix(in srgb, var(--theme-primary), transparent 92%);
    --theme-gradient-from: var(--theme-primary);
    --theme-gradient-to: var(--theme-primary-2);
    --bs-primary: var(--theme-primary);
    --bs-primary-rgb: var(--theme-primary-rgb);
    --bs-link-color: var(--theme-primary);
}

/* Bridge compiled Bootstrap utilities to theme tokens (fallbacks) */
.text-primary {
    color: var(--theme-primary) !important;
}

.bg-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-primary-contrast) !important;
}

.border-primary {
    border-color: var(--theme-primary) !important;
}

.link-primary {
    color: var(--theme-primary) !important;
}
.link-primary:hover,
.link-primary:focus {
    color: color-mix(in srgb, var(--theme-primary), black 12%) !important;
}

.text-bg-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-primary-contrast) !important;
}

.bg-primary-subtle {
    background-color: var(--theme-soft-bg) !important;
}

.border-primary-subtle {
    border-color: var(--theme-border-accent) !important;
}

.text-primary-emphasis {
    color: color-mix(in srgb, var(--theme-primary), black 15%) !important;
}

/* Common component focus/active states */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: color-mix(in srgb, var(--theme-primary), transparent 70%) !important;
    box-shadow: 0 0 0 .25rem rgba(var(--theme-primary-rgb), .25) !important;
}

.form-check-input:checked {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.page-link:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--theme-primary-rgb), .25) !important;
}

.page-item.active .page-link,
.pagination .active > .page-link {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-primary-contrast) !important;
}

/* Selected app item pill in tenancy app selection */
.selected-app-item {
    background: rgba(var(--theme-primary-rgb), .05);
    border: 1px solid rgba(var(--theme-primary-rgb), .10);
}

/* Ensure common components inherit the body font */
h1, h2, h3, h4, h5, h6,
.btn,
.form-control,
.nav,
.pe-nav-content,
.pe-menu-title,
.pe-nav-link,
.table,
.modal,
.badge,
.breadcrumb,
.card,
.dropdown-menu,
.list-group,
.accordion,
label,
small,
p, span {
    font-family: inherit !important;
}

/* --- Enhanced Apps selection/catalog grid -------------------------------------- */
.apps-page {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

/* Layout containers with RTL/LTR support */
.apps-layout-ltr .apps-grid-container {
    padding-right: 1rem;
}

.apps-layout-rtl .apps-grid-container {
    padding-left: 1rem;
}

.apps-layout-ltr .apps-summary-container {
    padding-left: 1rem;
}

.apps-layout-rtl .apps-summary-container {
    padding-right: 1rem;
}

/* Apps grid styling */
.apps-grid {
    justify-content: center;
}

.apps-grid > .col {
    display: flex;
}

.app-selector {
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.app-selector:hover {
    transform: translateY(-2px);
}

.apps-tile {
    border-radius: 16px;
    transition: all .2s ease;
    border: 2px solid #edf1f7;
    min-height: 148px;
    background: linear-gradient(135deg, #ffffff, #fafbff);
    position: relative;
    overflow: hidden;
    transform-origin: center;
}

.apps-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--theme-gradient-from), var(--theme-gradient-to));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.apps-tile.selected::before {
    transform: scaleX(1);
}

html[dir='rtl'] .apps-tile::before {
    transform-origin: right;
}

.apps-tile .card-body {
    padding: 16px 12px 12px 12px;
}

.apps-tile .fw-semibold {
    font-weight: 700 !important;
    font-size: 1rem;
    line-height: 1.3;
}

.apps-tile .small {
    font-size: .8rem !important;
    line-height: 1.4;
}

.apps-tile:hover {
    border-color: var(--theme-border-accent);
    box-shadow: 0 12px 24px rgba(var(--theme-primary-rgb), .12);
    background: linear-gradient(135deg, #ffffff, #f8f9ff);
}

.apps-tile:active {
    transform: scale(0.98);
}

.apps-tile.selected {
    border-color: var(--theme-primary);
    box-shadow: 0 12px 28px rgba(var(--theme-primary-rgb), .2);
    background: linear-gradient(135deg, #ffffff, #f6f8ff);
}

/* Focus states for accessibility */
.app-check:focus + .apps-tile {
    outline: 2px solid var(--theme-primary);
    outline-offset: 2px;
}

/* Tighter grid spacing */
@media (min-width: 576px) {
    .apps-grid {
        row-gap: 1rem;
    }
}

/* Enhanced checkmark badge */
.check-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
    color: white;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb), .3);
    z-index: 2;
    animation: checkBadgeIn 0.3s ease-out;
}

@keyframes checkBadgeIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.apps-tile.selected .check-badge {
    display: inline-flex;
}

html[dir='rtl'] .check-badge {
    left: 10px;
    right: auto;
}

/* Enhanced app icon styling */
.app-icon {
    transition: all 0.2s ease;
    position: relative;
}

.apps-tile:hover .app-icon {
    transform: scale(1.05);
}

.apps-tile.selected .app-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(var(--theme-primary-rgb), .2) !important;
}

/* Enhanced summary card */
.summary-card {
    border-radius: 16px;
    border: 2px solid #edf1f7;
    background: linear-gradient(135deg, #ffffff, #fafbff);
}

.selected-list {
    max-height: 350px;
    overflow-y: auto;
}

.selected-list::-webkit-scrollbar {
    width: 6px;
}

.selected-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.selected-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
    border-radius: 3px;
}

.selected-app-item {
    transition: all 0.2s ease;
    animation: selectedAppIn 0.3s ease-out;
}

@keyframes selectedAppIn {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Removed invalid directional @keyframes override to avoid CSS parse errors */

.selected-app-item:hover {
    transform: translateX(4px);
    background: rgba(var(--theme-primary-rgb), 0.08) !important;
}

html[dir='rtl'] .selected-app-item:hover {
    transform: translateX(-4px);
}

/* Summary section enhancements */
.selected-apps-wrapper {
    position: relative;
}

.selected-apps-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--theme-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.selected-apps-wrapper:hover::before {
    opacity: 0.3;
}

/* Page header enhancements */
.apps-page h2 {
    font-weight: 700;
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary), white 15%), var(--theme-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

/* Card header enhancements */
.card-header {
    padding: 1.25rem 1.5rem 0.75rem 1.5rem;
}

.card-header i.text-primary {
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Empty state styling */
#selectedEmpty {
    padding: 2rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border: 2px dashed #d4d8ff;
    text-align: center;
}

#selectedEmpty i.bi-inbox {
    color: var(--theme-primary) !important;
    opacity: 0.6;
}

/* Enhanced buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-success {
    background: linear-gradient(135deg, #0ab39c, #20c997);
    border: none;
    box-shadow: 0 4px 12px rgba(10, 179, 156, .3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #089a82, #1ba085);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(10, 179, 156, .4);
}

.btn-primary {
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
    border: none;
    box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb), .3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary), black 12%), color-mix(in srgb, var(--theme-primary-2), black 12%));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(var(--theme-primary-rgb), .4);
}

.btn-outline-primary {
    border: 2px solid var(--theme-primary);
    color: var(--theme-primary);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
    border-color: var(--theme-primary);
    transform: translateY(-1px);
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

/* Button group styling */
.d-grid .btn + .btn {
    margin-top: 0.75rem;
}

/* Enhanced focus management */
.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.25);
    outline: none;
}

/* Animation for count updates */
#selectedCount {
    display: inline-block;
    transition: all 0.3s ease;
    min-width: 20px;
    text-align: center;
}

/* Improved hover states for remove buttons */
.selected-app-item .btn-outline-danger {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.selected-app-item:hover .btn-outline-danger {
    opacity: 1;
    transform: scale(1.1);
}

/* Improved text contrast */
.text-muted {
    color: #6c757d !important;
    opacity: 0.8;
}

.apps-tile .text-muted {
    opacity: 0.7;
}

.apps-tile.selected .text-muted {
    opacity: 0.9;
}

/* Tenant Apps index grid tweaks */
.tenant-apps-grid {
    justify-content: center;            /* center rows horizontally */
    margin-inline: auto;                /* ensure centering in RTL/LTR */
}

.tenant-apps-grid .apps-tile {
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.tenant-apps-grid .apps-tile:hover {
    color: var(--theme-primary-contrast);
    transform: translateY(-4px);
    border-color: var(--theme-border-accent);
    box-shadow: 0 12px 24px rgba(var(--theme-primary-rgb), .14);
    background: var(--theme-primary);

}

.tenant-apps-grid .apps-tile .card-body {
    min-height: 180px;                  /* bigger icon stage */
    padding: 1.25rem;                   /* compact padding */
    display: flex;
    align-items: center;
    justify-content: center;
}

.tenant-apps-grid .app-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tenant-apps-grid .app-icon i,
.tenant-apps-grid .app-icon span {
    font-size: clamp(3rem, 6vw, 4.5rem); /* fill the stage responsively */
    line-height: 1;
}

/* Slightly stronger hover on icon for a modern feel */
.tenant-apps-grid .apps-tile:hover .app-icon {
    transform: scale(1.03);
}

/* Subtle focus ring on hover/focus for modern feel */
.tenant-apps-grid .apps-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(var(--theme-primary-rgb), 0);
    transition: box-shadow .2s ease;
    pointer-events: none;
}

.tenant-apps-grid .apps-tile:hover::after,
.tenant-apps-grid .apps-tile:focus-visible::after {
    box-shadow: 0 0 0 .2rem rgba(var(--theme-primary-rgb), .10);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .apps-layout-ltr .apps-grid-container,
    .apps-layout-rtl .apps-grid-container {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .apps-layout-ltr .apps-summary-container,
    .apps-layout-rtl .apps-summary-container {
        padding-left: 0;
        padding-right: 0;
    }

    .summary-card {
        position: static !important;
    }
}

@media (max-width: 575.98px) {
    .apps-tile {
        min-height: 120px;
    }

    .apps-tile .card-body {
        padding: 12px 8px 10px 8px;
    }

    .apps-tile .fw-semibold {
        font-size: .9rem;
    }

    .check-badge {
        width: 22px;
        height: 22px;
        top: 8px;
        right: 8px;
    }

    html[dir='rtl'] .check-badge {
        left: 8px;
        right: auto;
    }
}

/* Improved sticky positioning */
@media (min-width: 992px) {
    .summary-card.sticky-top {
        top: 120px !important;
        max-height: calc(100vh - 140px);
        overflow: hidden;
    }

    .selected-apps-wrapper {
        max-height: calc(100vh - 300px);
        overflow-y: auto;
    }
}

/* Enhanced app grid responsiveness */
@media (min-width: 1200px) {
    .row-cols-xl-6 > * {
        flex: 0 0 auto;
        width: 16.66666667%;
    }
}

@media (min-width: 1400px) {
    .apps-grid.row-cols-xl-6 {
        --bs-gutter-x: 1.5rem;
    }
}

/* Smooth transitions for layout changes */
.apps-layout-ltr,
.apps-layout-rtl {
    transition: all 0.3s ease;
}

/* Auth Pages Styling (keeping existing styles) */
.auth-split-layout {
    min-height: 100vh;
    display: flex;
}

.auth-hero-section {
    position: relative;
    overflow: hidden;
}

.auth-hero-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
}

.auth-blob {
    position: absolute;
    background: white;
    border-radius: 50%;
}

.auth-blob-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    filter: blur(100px);
}

.auth-blob-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    right: 15%;
    filter: blur(80px);
}

.signup-blob-1 {
    width: 250px;
    height: 250px;
    top: 15%;
    right: 10%;
    filter: blur(120px);
}

.signup-blob-2 {
    width: 180px;
    height: 180px;
    bottom: 10%;
    left: 20%;
    filter: blur(90px);
}

.auth-form-container {
    max-width: 450px;
}

.auth-icon-20 {
    width: 20px;
    height: 20px;
}

.auth-avatar-40 {
    width: 40px;
    height: 40px;
}

/* Ensure background decorations never block clicks */
.bg-pattern,
.auth-pattern-outline,
.auth-pattern-shape,
.auth-pattern-extra {
    pointer-events: none !important;
}

/* Auth background images */
.auth-bg-image {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

.auth-bg--signin {
    background-image: url('../images/login_background4.png');
}

.auth-bg--signup {
    background-image: url('../images/register_background1.png');
}

/* Left panel backgrounds (auth pages) */
.auth-left--signin {
    background-image: url('../images/login_background11.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-left--signup {
    background-image: url('../images/login_background9.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Subtle inner-side overlay to improve text contrast over photo */
.auth-left--signin::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(8, 29, 73, .15), rgba(8, 29, 73, .06), transparent 55%);
    z-index: 1;
    pointer-events: none;
}

html[dir='rtl'] .auth-left--signin::before {
    background: linear-gradient(to right, rgba(8, 29, 73, .15), rgba(8, 29, 73, .06), transparent 55%);
}

/* Hero title/subtitle styling to ensure readability on photos */
.auth-hero-title {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 6px;
    line-height: 1.2;
    color: #fff;
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
    box-shadow: 0 12px 24px rgba(var(--theme-primary-rgb), .35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    font-size: clamp(1.75rem, 3.2vw, 3rem);
}

.auth-hero-subtitle {
    display: inline-block;
    margin-top: .5rem;
    padding: .3rem .6rem;
    border-radius: 6px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary-2), white 10%), var(--theme-primary));
    box-shadow: 0 8px 18px rgba(var(--theme-primary-rgb), .25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    font-size: clamp(1rem, 1.4vw, 1.25rem);
}

/* Stack container for hero texts */
.auth-hero-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    max-width: min(42vw, 640px);
}

html[dir='ltr'] .auth-hero-stack {
    align-items: flex-start;
}

html[dir='rtl'] .auth-hero-stack {
    align-items: flex-end;
}

/* Keep hero texts above decorative layers */
.auth-hero-title, .auth-hero-subtitle, .auth-hero-badge {
    position: relative;
    z-index: 3;
}

/* Glassy container for hero texts */
.auth-hero-card {
    display: inline-flex;
    flex-direction: column;
    gap: .35rem;
    padding: .6rem .8rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), .75), color-mix(in srgb, var(--theme-primary-2), transparent 45%));
    box-shadow: 0 16px 30px rgba(var(--theme-primary-rgb), .30);
    backdrop-filter: blur(2px) saturate(120%);
    -webkit-backdrop-filter: blur(2px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, .22);
}

/* Trusted-by badge */
.auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
    background: linear-gradient(135deg, var(--theme-gradient-from), color-mix(in srgb, var(--theme-primary), black 20%));
    box-shadow: 0 10px 20px rgba(var(--theme-primary-rgb), .25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    white-space: normal;
    word-break: break-word;
}

.auth-hero-badge .bi-star-fill {
    color: #ffd166;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .2));
}

/* Vertical feature bubbles (right edge of left auth panel) */
.auth-feature-bubbles {
    position: absolute;
    top: 50%;
    right: 16px; /* on the inside right of image panel */
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 2;
}

.auth-feature-item {
    display: flex;
    flex-direction: row-reverse; /* keep bubble on the edge, label toward center */
    align-items: center;
    gap: 10px;
}

.auth-feature-bubble {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28), inset 0 0 0 2px rgba(255, 255, 255, .18);
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
    backdrop-filter: saturate(120%) blur(1px);
}

.auth-feature-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .28);
}

.auth-feature-bubble i {
    font-size: 1.35rem;
}

/* Small pill label next to each bubble */
.auth-feature-label {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .8rem;
    line-height: 1;
    color: #fff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(255, 255, 255, .18);
    backdrop-filter: saturate(120%) blur(1px);
    white-space: nowrap;
}

/* Color variants with good contrast on most photos */
.auth-feature-bubble.bubble-1 {
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
}

.auth-feature-bubble.bubble-2 {
    background: linear-gradient(135deg, #0ab39c, #20c997);
}

.auth-feature-bubble.bubble-3 {
    background: linear-gradient(135deg, #f7b84b, #f59e0b);
    color: #1d2a3a;
}

.auth-feature-bubble.bubble-4 {
    background: linear-gradient(135deg, #ff6b6b, #f06595);
}

.auth-feature-bubble.bubble-5 {
    background: linear-gradient(135deg, var(--theme-gradient-to), var(--theme-gradient-from));
}

/* Match label colors to bubble variants */
.auth-feature-label.bubble-1 {
    background: linear-gradient(135deg, var(--theme-gradient-from), var(--theme-gradient-to));
}

.auth-feature-label.bubble-2 {
    background: linear-gradient(135deg, #0ab39c, #20c997);
}

.auth-feature-label.bubble-3 {
    background: linear-gradient(135deg, #f7b84b, #f59e0b);
    color: #1d2a3a;
}

.auth-feature-label.bubble-4 {
    background: linear-gradient(135deg, #ff6b6b, #f06595);
}

.auth-feature-label.bubble-5 {
    background: linear-gradient(135deg, var(--theme-gradient-to), var(--theme-gradient-from));
}

/* Direction-aware placement (RTL/LTR) */
html[dir='rtl'] .auth-feature-bubbles {
    left: 16px;
    right: auto;
}

html[dir='rtl'] .auth-feature-item {
    flex-direction: row;
    direction: ltr;
}

html[dir='rtl'] .auth-feature-label {
    direction: rtl;
    text-align: right;
}

html[dir='ltr'] .auth-feature-bubbles {
    right: 16px;
    left: auto;
}

html[dir='ltr'] .auth-feature-item {
    flex-direction: row-reverse;
}

html[dir='ltr'] .auth-feature-bubble:hover {
    transform: translateX(4px) scale(1.05);
}

html[dir='rtl'] .auth-feature-bubble:hover {
    transform: translateX(-4px) scale(1.05);
}

/* Direction-aware row order for auth split layout */
html[dir='ltr'] .auth-directional-row {
    flex-direction: row;
}

html[dir='rtl'] .auth-directional-row {
    flex-direction: row-reverse;
}

/* Direction-aware placement of sign-in promo content on image panel */
html[dir='ltr'] .auth-left--signin {
    justify-content: flex-end !important;
    align-items: flex-start !important;
    background-position: left center;
}

html[dir='rtl'] .auth-left--signin {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    background-position: right center;
}

@media (max-width: 991.98px) {
    .auth-feature-bubbles {
        display: none;
    }
}

/* ========================================
   ONOO ERP LOADING COMPONENT STYLES
   ======================================== */
.onoo-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(128, 128, 128, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.onoo-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Letter Animation Container */
.onoo-letter-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    height: 120px;
}

.onoo-letter {
    font-size: 72px;
    font-weight: 900;
    color: #ffffff;
    margin: 0 8px;
    opacity: 0;
    transform: scale(0) rotate(180deg);
    position: relative;
    text-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 5px 15px rgba(0, 0, 0, 0.5);
}

.onoo-letter.space {
    width: 20px;
    margin: 0 10px;
    animation: none;
}

/* Special styling for N letter (the source) */
.onoo-letter.source-n {
    animation: nSourceAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
               onooLetterPulse 2.5s ease-in-out infinite 3.5s,
               onooColorCycle 4s linear infinite 3.5s;
}

/* O letters that burst from N */
.onoo-letter.burst-o {
    animation: oBurstFromN 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
               onooLetterPulse 2.5s ease-in-out infinite 3.5s,
               onooColorCycle 4s linear infinite 3.5s;
}

/* Individual O burst timings and directions */
.onoo-letter.burst-o.first {
    animation-delay: 1.2s, 3.5s, 3.5s;
}
.onoo-letter.burst-o.second {
    animation-delay: 1.4s, 3.5s, 3.8s;
}
.onoo-letter.burst-o.third {
    animation-delay: 1.6s, 3.5s, 4.1s;
}

/* ERP letters appear with typewriter effect */
.onoo-letter.erp-letter {
    animation: erpTypewriter 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
               onooLetterPulse 2.5s ease-in-out infinite 3.5s,
               onooColorCycle 4s linear infinite 3.5s;
}

/*.onoo-letter.erp-letter.e-letter {*/
/*    animation-delay: 2.2s, 3.5s, 4.4s;*/
/*}*/
/*.onoo-letter.erp-letter.r-letter {*/
/*    animation-delay: 2.5s, 3.5s, 4.7s;*/
/*}*/
/*.onoo-letter.erp-letter.p-letter {*/
/*    animation-delay: 2.8s, 3.5s, 5s;*/
/*}*/

/* Creative Animation Keyframes */
@keyframes nSourceAppear {
    0% {
        transform: scale(0) rotate(360deg) translateY(-50px);
        opacity: 0;
        filter: blur(10px);
    }
    50% {
        transform: scale(1.3) rotate(180deg) translateY(0px);
        opacity: 0.8;
        filter: blur(2px);
    }
    100% {
        transform: scale(1) rotate(0deg) translateY(0px);
        opacity: 1;
        filter: blur(0px);
    }
}

@keyframes oBurstFromN {
    0% {
        transform: scale(0) translate(0, 0) rotate(0deg);
        opacity: 0;
        filter: blur(5px);
    }
    30% {
        transform: scale(0.5) translate(var(--burst-x, 0px), var(--burst-y, -30px)) rotate(180deg);
        opacity: 0.5;
        filter: blur(3px);
    }
    70% {
        transform: scale(1.2) translate(var(--final-x, 0px), var(--final-y, 0px)) rotate(360deg);
        opacity: 0.9;
        filter: blur(1px);
    }
    100% {
        transform: scale(1) translate(0, 0) rotate(0deg);
        opacity: 1;
        filter: blur(0px);
    }
}

@keyframes erpTypewriter {
    0% {
        transform: translateX(-20px) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateX(5px) scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Set burst directions for each O */
.onoo-letter.burst-o.first {
    --burst-x: -100px;
    --burst-y: -20px;
    --final-x: 0px;
    --final-y: 0px;
}

.onoo-letter.burst-o.second {
    --burst-x: 80px;
    --burst-y: -40px;
    --final-x: 0px;
    --final-y: 0px;
}

.onoo-letter.burst-o.third {
    --burst-x: 120px;
    --burst-y: 20px;
    --final-x: 0px;
    --final-y: 0px;
}

@keyframes onooLetterPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        text-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    50% {
        transform: translateY(-8px) scale(1.05);
        text-shadow: 0 0 30px currentColor, 0 0 60px currentColor, 0 8px 20px rgba(0, 0, 0, 0.6);
    }
}

@keyframes onooColorCycle {
    0% {
        color: #ff4757;
        text-shadow: 0 0 25px #ff4757, 0 0 50px #ff4757, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    12.5% {
        color: #ff6348;
        text-shadow: 0 0 25px #ff6348, 0 0 50px #ff6348, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    25% {
        color: #ffa502;
        text-shadow: 0 0 25px #ffa502, 0 0 50px #ffa502, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    37.5% {
        color: #f39c12;
        text-shadow: 0 0 25px #f39c12, 0 0 50px #f39c12, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    50% {
        color: #2ed573;
        text-shadow: 0 0 25px #2ed573, 0 0 50px #2ed573, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    62.5% {
        color: #1dd1a1;
        text-shadow: 0 0 25px #1dd1a1, 0 0 50px #1dd1a1, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    75% {
        color: #3742fa;
        text-shadow: 0 0 25px #3742fa, 0 0 50px #3742fa, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    87.5% {
        color: #a55eea;
        text-shadow: 0 0 25px #a55eea, 0 0 50px #a55eea, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
    100% {
        color: #ff4757;
        text-shadow: 0 0 25px #ff4757, 0 0 50px #ff4757, 0 5px 15px rgba(0, 0, 0, 0.5);
    }
}

.onoo-loading-status {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    margin-top: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .onoo-letter {
        font-size: 48px;
        margin: 0 4px;
    }

    .onoo-letter-container {
        height: 80px;
        margin-bottom: 30px;
    }
}

/* ========================================
   END OF ONOO ERP COMPONENT STYLES
   ======================================== */

/* Page-level loading: show overlay while the page is loading or navigating */
html.onoo-page-loading .onoo-loading-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
}
