.btn-block {
    width: 100%;
}

.password-wrapper {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

#id_password_field {
    padding-left: 16px;
    padding-right: 60px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: white;
    position: relative;
    z-index: 1;
}

/* RTL */
[dir="rtl"] #id_password_field {

    padding-left: 60px;
    padding-right: 16px;
}

/* Password toggle icon styles */
.password-toggle-icon {
    position: absolute;

    left: auto;
    right: 13px;
    top: 68%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 10;
    padding: 6px;
    color: #6c757d;
    font-size: 14px;
    width: 60px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* When direction is RTL */
[dir="rtl"] .password-toggle-icon {
    left: 13px;
    right: auto;
}

/* Override any error styling that might affect positioning */
.login-form-content .mform .fitem.error .felement .password-wrapper,
.login-form-content .mform .fitem .felement .password-wrapper {
    position: relative !important;
}

.login-form-content .mform .fitem.error .password-toggle-icon,
.login-form-content .mform .fitem .password-toggle-icon {
    position: absolute !important;
    left: 12px !important;
    top: 12px !important;
}

/* Button loader styles */
.btn-loader-container {
    --uib-size: 20px;
    --uib-color: white;
    --uib-speed: 1.5s;
    --dot-size: calc(var(--uib-size) * 0.17);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--uib-size);
    width: var(--uib-size);
    animation: smoothRotate calc(var(--uib-speed) * 1.8) linear infinite;
}

.btn-dot {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    width: 100%;
    animation: rotate var(--uib-speed) ease-in-out infinite;
}

.btn-dot::before {
    content: '';
    height: var(--dot-size);
    width: var(--dot-size);
    border-radius: 50%;
    background-color: var(--uib-color);
    transition: background-color 0.3s ease;
}

.btn-dot:nth-child(2),
.btn-dot:nth-child(2)::before {
    animation-delay: calc(var(--uib-speed) * -0.835 * 0.5);
}

.btn-dot:nth-child(3),
.btn-dot:nth-child(3)::before {
    animation-delay: calc(var(--uib-speed) * -0.668 * 0.5);
}

.btn-dot:nth-child(4),
.btn-dot:nth-child(4)::before {
    animation-delay: calc(var(--uib-speed) * -0.501 * 0.5);
}

.btn-dot:nth-child(5),
.btn-dot:nth-child(5)::before {
    animation-delay: calc(var(--uib-speed) * -0.334 * 0.5);
}

.btn-dot:nth-child(6),
.btn-dot:nth-child(6)::before {
    animation-delay: calc(var(--uib-speed) * -0.167 * 0.5);
}

/* Button loader overlay - positioned absolutely over the button */
.btn-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

/* Button loading state */
.btn-primary.loading {
    pointer-events: none;
    position: relative;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    65%,
    100% {
        transform: rotate(360deg);
    }
}

@keyframes smoothRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loader overlay styles */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#loader-overlay.show {
    display: flex;
}

/* Loader container styles */
.loader-container {
    --uib-size: 40px;
    --uib-color: #ffffff;
    --uib-speed: 1.5s;
    --dot-size: calc(var(--uib-size) * 0.17);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--uib-size);
    width: var(--uib-size);
    animation: smoothRotate calc(var(--uib-speed) * 1.8) linear infinite;
}

.loader-container .dot {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    width: 100%;
    animation: rotate var(--uib-speed) ease-in-out infinite;
}

.loader-container .dot::before {
    content: '';
    height: var(--dot-size);
    width: var(--dot-size);
    border-radius: 50%;
    background-color: var(--uib-color);
    transition: background-color 0.3s ease;
}

.loader-container .dot:nth-child(2),
.loader-container .dot:nth-child(2)::before {
    animation-delay: calc(var(--uib-speed) * -0.835 * 0.5);
}

.loader-container .dot:nth-child(3),
.loader-container .dot:nth-child(3)::before {
    animation-delay: calc(var(--uib-speed) * -0.668 * 0.5);
}

.loader-container .dot:nth-child(4),
.loader-container .dot:nth-child(4)::before {
    animation-delay: calc(var(--uib-speed) * -0.501 * 0.5);
}

.loader-container .dot:nth-child(5),
.loader-container .dot:nth-child(5)::before {
    animation-delay: calc(var(--uib-speed) * -0.334 * 0.5);
}

.loader-container .dot:nth-child(6),
.loader-container .dot:nth-child(6)::before {
    animation-delay: calc(var(--uib-speed) * -0.167 * 0.5);
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    65%,
    100% {
        transform: rotate(360deg);
    }
}

@keyframes smoothRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Validation error styles */
.error-field {
    border: 2px solid #dc3545 !important;
    background-color: #fff5f5 !important;
}

.error-field:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.field-error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: 500;
    display: block;
    width: 100%;
    clear: both;
}

/* Language toggle styles */
.language-toggle-container {
    display: flex;
    margin-top: 15px;
    margin-bottom: 0px;
    z-index: 100;
    padding: 0 33px;
}


.language-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    color: #8B0000;
    border: none;
    border-radius: 20px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.5);
}

.language-toggle-btn:active {
    transform: translateY(0);
}

.language-toggle-btn i {
    font-size: 16px;
}

.language-toggle-btn .lang-text {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {


    .language-toggle-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .language-toggle-btn i {
        font-size: 14px;
    }

    .language-toggle-btn .lang-text {
        font-size: 11px;
    }
}