html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

.header-logo {
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url('../images/Logo.png');
    mask: url('../images/Logo.png');
    -webkit-mask-position: left;
    mask-position: left;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    width: 180px;
    height: 24px;
    mask-size: contain;
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

.loading-items-center > .bg-primary {
    background-color: #FF865B !important;
}

.loading-items-center > .border-primary {
    border-color: #FF865B !important;
}

.xaf-navmenu a .xaf-nav-link {
    text-decoration: revert !important;
}

.dxbl-grid-command-cell .dxbl-btn-link > span {
    text-decoration: revert !important;
}

/* ================================
   MODERN LOGIN COMPONENT STYLES
   ================================ */

#logon-template-component.modern-login-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
    overflow: hidden !important;
    z-index: 1000 !important;
}

#logon-template-component .login-background {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    z-index: 1 !important;
}

#logon-template-component .background-pattern {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 2px, transparent 2px) !important;
    background-size: 60px 60px !important;
    animation: patternMove 20s linear infinite !important;
}

#logon-template-component .background-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.1) !important;
}

@keyframes patternMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

#logon-template-component .login-container {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    max-width: 480px !important;
    padding: 2rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem !important;
}

#logon-template-component .login-header {
    text-align: center !important;
    color: white !important;
    margin-bottom: 1rem !important;
}

#logon-template-component .brand-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
}

#logon-template-component .brand-title {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    letter-spacing: -0.02em !important;
    color: white !important;
}

#logon-template-component .brand-subtitle {
    font-size: 1.1rem !important;
    margin: 0 !important;
    opacity: 0.9 !important;
    font-weight: 400 !important;
    color: white !important;
}

#logon-template-component .login-main {
    flex: 1 !important;
}

#logon-template-component .login-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    overflow: hidden !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

#logon-template-component .login-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important;
}

#logon-template-component .modern-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 1.5rem 2rem !important;
    text-align: center !important;
}

#logon-template-component .header-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

#logon-template-component .login-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #495057 !important;
    margin: 0 !important;
    letter-spacing: -0.01em !important;
}

#logon-template-component .language-switcher-container {
    display: flex !important;
    align-items: center !important;
}

#logon-template-component .modern-card-body {
    padding: 2rem !important;
}

#logon-template-component .login-form-container {
    margin-bottom: 1.5rem !important;
}

#logon-template-component .login-actions {
    margin-top: 1.5rem !important;
}

#logon-template-component .auth-separator {
    display: flex !important;
    align-items: center !important;
    margin: 1.5rem 0 !important;
    gap: 1rem !important;
}

#logon-template-component .separator-line {
    flex: 1 !important;
    height: 1px !important;
    background: #dee2e6 !important;
}

#logon-template-component .separator-text {
    color: #6c757d !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

#logon-template-component .external-auth-container {
    margin-top: 1rem !important;
}

#logon-template-component .login-footer {
    text-align: center !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.875rem !important;
}

#logon-template-component .footer-text {
    margin: 0 !important;
}

/* Enhanced form styling with high specificity */
#logon-template-component .modern-card-body .form-group {
    margin-bottom: 1.5rem !important;
}

#logon-template-component .modern-card-body .dx-textbox,
#logon-template-component .modern-card-body .dx-texteditor,
#logon-template-component .modern-card-body .form-control {
    border-radius: 12px !important;
    border: 2px solid #e9ecef !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

#logon-template-component .modern-card-body .dx-textbox.dx-state-focused,
#logon-template-component .modern-card-body .dx-texteditor.dx-state-focused,
#logon-template-component .modern-card-body .form-control:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
    background: white !important;
}

#logon-template-component .modern-card-body .dx-button.dx-button-mode-contained,
#logon-template-component .modern-card-body .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    color: white !important;
}

#logon-template-component .modern-card-body .dx-button.dx-button-mode-contained:hover,
#logon-template-component .modern-card-body .btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3) !important;
}

/* DevExpress specific overrides for login form */
#logon-template-component .dx-field-item-label {
    color: #495057 !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
}

#logon-template-component .dx-field-item-content {
    margin-bottom: 1rem !important;
}

/* Override DevExpress default styling that might interfere */
#logon-template-component * {
    box-sizing: border-box !important;
}

/* ================================
   SPLASH SCREEN COMPONENT STYLES
   ================================ */

.splash-screen-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    z-index: 9999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
    overflow: hidden !important;
}

.splash-content {
    text-align: center !important;
    color: white !important;
    max-width: 500px !important;
    padding: 2rem !important;
    animation: fadeInUp 0.8s ease-out !important;
    position: relative !important;
    z-index: 2 !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-logo-section {
    margin-bottom: 2rem !important;
}

.splash-screen-logo {
    max-width: 120px !important;
    height: auto !important;
    margin-bottom: 1rem !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)) !important;
    animation: logoFloat 3s ease-in-out infinite !important;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.splash-text {
    margin-bottom: 3rem !important;
}

.splash-title {
    font-size: 3rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.5rem 0 !important;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    letter-spacing: -0.02em !important;
    background: linear-gradient(45deg, #fff, #f8f9fa) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.splash-subtitle {
    font-size: 1.3rem !important;
    font-weight: 400 !important;
    margin: 0 0 1rem 0 !important;
    opacity: 0.9 !important;
    letter-spacing: 0.02em !important;
    color: white !important;
}

.splash-tagline {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
    animation: fadeIn 1s ease-out 0.5s both !important;
}

.tagline-text {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    opacity: 0.8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: white !important;
}

.tagline-separator {
    opacity: 0.6 !important;
    font-weight: 300 !important;
    color: white !important;
}

.loading-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1.5rem !important;
}

.loading-spinner-container {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.loading-spinner {
    width: 40px !important;
    height: 40px !important;
    border: 3px solid rgba(255, 255, 255, 0.3) !important;
    border-top: 3px solid white !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    position: relative !important;
    z-index: 2 !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-pulse {
    position: absolute !important;
    width: 60px !important;
    height: 60px !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 50% !important;
    animation: pulse-ring 2s ease-out infinite !important;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.loading-text {
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    margin: 0 !important;
    opacity: 0.9 !important;
    animation: pulse 1.5s ease-in-out infinite !important;
    color: white !important;
}

@keyframes pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.6; }
}

.loading-progress {
    width: 200px !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 2px !important;
    overflow: hidden !important;
    position: relative !important;
}

.progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.8) 100%) !important;
    border-radius: 2px !important;
    animation: progressSlide 2s ease-in-out infinite !important;
}

@keyframes progressSlide {
    0% {
        width: 0%;
        transform: translateX(-10px);
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
        transform: translateX(10px);
    }
}

.splash-version {
    margin-top: 2rem !important;
    animation: fadeIn 1s ease-out 1s both !important;
}

.version-text {
    font-size: 0.85rem !important;
    opacity: 0.7 !important;
    font-weight: 400 !important;
    letter-spacing: 0.05em !important;
    color: white !important;
}

/* Animated Background Elements */
.splash-bg-elements {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.bg-circle {
    position: absolute !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    animation: floatCircle 6s ease-in-out infinite !important;
}

.bg-circle-1 {
    width: 120px !important;
    height: 120px !important;
    top: 10% !important;
    left: 10% !important;
    animation-delay: 0s !important;
}

.bg-circle-2 {
    width: 80px !important;
    height: 80px !important;
    top: 70% !important;
    right: 15% !important;
    animation-delay: 2s !important;
}

.bg-circle-3 {
    width: 60px !important;
    height: 60px !important;
    bottom: 20% !important;
    left: 20% !important;
    animation-delay: 4s !important;
}

@keyframes floatCircle {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.2;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #logon-template-component .login-container {
        padding: 1rem !important;
        max-width: 100% !important;
    }
    
    #logon-template-component .brand-title {
        font-size: 2rem !important;
    }
    
    #logon-template-component .modern-card-header,
    #logon-template-component .modern-card-body {
        padding: 1.5rem !important;
    }
    
    #logon-template-component .header-content {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .splash-title {
        font-size: 2.5rem !important;
    }
    
    .splash-subtitle {
        font-size: 1.1rem !important;
    }
    
    .splash-content {
        padding: 1rem !important;
    }
    
    .splash-tagline {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .tagline-separator {
        display: none !important;
    }
    
    .splash-screen-logo {
        max-width: 100px !important;
    }
}

@media (max-width: 480px) {
    #logon-template-component .brand-title {
        font-size: 1.75rem !important;
    }
    
    #logon-template-component .login-title {
        font-size: 1.25rem !important;
    }
    
    .splash-title {
        font-size: 2rem !important;
    }
    
    .splash-screen-logo {
        max-width: 80px !important;
    }
    
    .loading-progress {
        width: 150px !important;
    }
    
    .bg-circle-1 {
        width: 80px !important;
        height: 80px !important;
    }
    
    .bg-circle-2 {
        width: 60px !important;
        height: 60px !important;
    }
    
    .bg-circle-3 {
        width: 40px !important;
        height: 40px !important;
    }
}

/* DevExpress theme integration */
.dx-theme-material,
.dx-theme-generic {
    --login-primary-color: #667eea;
    --login-secondary-color: #764ba2;
}

/* Enhanced button styling for DevExpress components */
.logon-bottom-toolbar .dx-toolbar-item {
    margin: 0.25rem !important;
}

.logon-bottom-toolbar .dx-button {
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.logon-bottom-toolbar .dx-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}